refactor: migrar GitLab → Gitea (aulas 10, 11, 13)
- Aula 10: Gitea + Registry + Actions + Runner (substituiu GitLab) - gitea-values.yaml: PostgreSQL standalone, Valkey standalone, ~800Mi RAM - setup.sh/cleanup.sh: namespace gitea, Helm gitea-charts/gitea + actions - README.md: documentação completa com de→para (GitLab/Harbor/Tekton vs Gitea) - Aula 11: ArgoCD (GitOps) — removido GitLab Runner (runner vive na aula-10) - setup.sh: só ArgoCD, integração SSH com Gitea - node-bugado/.gitea/workflows/ci.yml: pipeline convertida - Aula 13: Container Factory — atualizado para Gitea - setup.sh/cleanup.sh: referências GitLab → Gitea - pipelines/postgresql/ci.yml: Gitea Actions workflow - README.md: conexão com act_runner explicada - CLAUDE.md: tabela de aulas atualizada
This commit is contained in:
131
aula-13/k8s/prepull-daemonset.yaml
Normal file
131
aula-13/k8s/prepull-daemonset.yaml
Normal file
@@ -0,0 +1,131 @@
|
||||
# =============================================================================
|
||||
# Pre-pull DaemonSet - Alternativa para Cold Start
|
||||
# =============================================================================
|
||||
# Garante que imagens críticas estejam em cache em TODOS os nodes.
|
||||
# Quando KEDA/Cluster Autoscaler criar pods, imagens já estarão disponíveis.
|
||||
# =============================================================================
|
||||
#
|
||||
# COMO USAR:
|
||||
# 1. Edite a lista de initContainers com suas imagens
|
||||
# 2. kubectl apply -f prepull-daemonset.yaml
|
||||
# 3. Aguarde todos os pods ficarem Ready
|
||||
# 4. Imagens estarão em cache em todos os nodes
|
||||
#
|
||||
# QUANDO USAR:
|
||||
# - Databases (PostgreSQL, MongoDB) que precisam de 100% dos arquivos
|
||||
# - Apps que precarregam (n8n, Laravel Octane)
|
||||
# - Qualquer imagem onde eStargz NÃO ajuda
|
||||
#
|
||||
# =============================================================================
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: image-prepuller
|
||||
namespace: kube-system
|
||||
labels:
|
||||
app: image-prepuller
|
||||
purpose: cold-start-optimization
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: image-prepuller
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: image-prepuller
|
||||
spec:
|
||||
# Tolera todos os taints para rodar em TODOS os nodes
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
|
||||
# InitContainers baixam as imagens e terminam
|
||||
initContainers:
|
||||
# ---------------------------------------------------------------------
|
||||
# PostgreSQL (Container Factory)
|
||||
# ---------------------------------------------------------------------
|
||||
- name: prepull-postgresql
|
||||
image: registry.kube.quest/factory/postgresql:17
|
||||
command: ["echo", "PostgreSQL image cached"]
|
||||
imagePullPolicy: Always
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 1Mi
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 10Mi
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# n8n
|
||||
# ---------------------------------------------------------------------
|
||||
- name: prepull-n8n
|
||||
image: docker.n8n.io/n8nio/n8n:latest
|
||||
command: ["echo", "n8n image cached"]
|
||||
imagePullPolicy: Always
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 1Mi
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 10Mi
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# PostgreSQL Oficial (para clientes)
|
||||
# ---------------------------------------------------------------------
|
||||
- name: prepull-postgres-alpine
|
||||
image: postgres:17-alpine
|
||||
command: ["echo", "PostgreSQL Alpine image cached"]
|
||||
imagePullPolicy: Always
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 1Mi
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 10Mi
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Redis
|
||||
# ---------------------------------------------------------------------
|
||||
- name: prepull-redis
|
||||
image: redis:7-alpine
|
||||
command: ["echo", "Redis image cached"]
|
||||
imagePullPolicy: Always
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 1Mi
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 10Mi
|
||||
|
||||
# Container principal apenas mantém o DaemonSet vivo
|
||||
containers:
|
||||
- name: pause
|
||||
image: gcr.io/google_containers/pause:3.9
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1m
|
||||
memory: 1Mi
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 10Mi
|
||||
|
||||
# Secrets para registries privados
|
||||
imagePullSecrets:
|
||||
- name: gitlab-registry
|
||||
|
||||
---
|
||||
# =============================================================================
|
||||
# Secret para Registry Privado (template)
|
||||
# =============================================================================
|
||||
# Crie este secret em kube-system se usar registry privado:
|
||||
#
|
||||
# kubectl create secret docker-registry gitlab-registry \
|
||||
# --namespace=kube-system \
|
||||
# --docker-server=registry.kube.quest \
|
||||
# --docker-username=<usuario> \
|
||||
# --docker-password=<token>
|
||||
# =============================================================================
|
||||
Reference in New Issue
Block a user