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:
ArgoCD Setup
2026-03-14 01:44:30 -03:00
parent ff7af56c30
commit d380cd8585
35 changed files with 3374 additions and 1202 deletions

View File

@@ -0,0 +1,51 @@
# =============================================================================
# Dockerfile - PostgreSQL Production (Alpine)
# =============================================================================
#
# Imagem customizada PostgreSQL para substituir Bitnami.
# Otimizada para produção e formato eStargz (lazy pulling).
#
# Build (formato eStargz):
# docker buildx build \
# --output type=image,name=registry.kube.quest/factory/postgresql:17,push=true,compression=estargz,force-compression=true,oci-mediatypes=true \
# .
#
# =============================================================================
FROM postgres:17-alpine
LABEL maintainer="workshop"
LABEL description="PostgreSQL 17 Alpine - Production Ready"
LABEL org.opencontainers.image.title="postgresql"
LABEL org.opencontainers.image.version="17"
# Variáveis de ambiente padrão
ENV POSTGRES_USER=postgres \
POSTGRES_DB=postgres \
PGDATA=/var/lib/postgresql/data/pgdata \
LANG=en_US.UTF-8
# Instalar dependências adicionais úteis
RUN apk add --no-cache \
tzdata \
curl \
jq
# Criar diretório para configurações customizadas
RUN mkdir -p /etc/postgresql/postgresql.conf.d
# Copiar configuração de produção
COPY postgresql.conf /etc/postgresql/postgresql.conf.d/00-production.conf
# Healthcheck nativo
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB} || exit 1
# Expor porta padrão
EXPOSE 5432
# Usuário não-root (já vem configurado na imagem oficial)
USER postgres
# Comando padrão com configuração customizada
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf.d/00-production.conf"]

View File

@@ -0,0 +1,77 @@
# =============================================================================
# PostgreSQL Production Configuration
# =============================================================================
# Otimizado para containers Kubernetes com ~1GB de memória
# Documentação: https://www.postgresql.org/docs/17/runtime-config.html
# =============================================================================
# -----------------------------------------------------------------------------
# Conexões
# -----------------------------------------------------------------------------
listen_addresses = '*'
max_connections = 100
superuser_reserved_connections = 3
# -----------------------------------------------------------------------------
# Memória (para container com 1GB)
# -----------------------------------------------------------------------------
# shared_buffers: ~25% da RAM disponível
shared_buffers = 256MB
# effective_cache_size: ~50% da RAM (estimativa para o planner)
effective_cache_size = 512MB
# work_mem: memória por operação de sort/hash (cuidado com max_connections)
work_mem = 8MB
# maintenance_work_mem: para VACUUM, CREATE INDEX, etc.
maintenance_work_mem = 64MB
# -----------------------------------------------------------------------------
# WAL (Write-Ahead Logging)
# -----------------------------------------------------------------------------
wal_level = replica
max_wal_size = 1GB
min_wal_size = 80MB
checkpoint_completion_target = 0.9
# -----------------------------------------------------------------------------
# Query Planner
# -----------------------------------------------------------------------------
# random_page_cost: baixo para SSD (1.1) vs HDD (4.0)
random_page_cost = 1.1
# effective_io_concurrency: alto para SSD
effective_io_concurrency = 200
# default_statistics_target: mais estatísticas = melhores planos
default_statistics_target = 100
# -----------------------------------------------------------------------------
# Logging
# -----------------------------------------------------------------------------
# Log para stderr (compatível com kubectl logs)
log_destination = 'stderr'
logging_collector = off
# O que logar
log_statement = 'ddl'
log_min_duration_statement = 1000
# Formato do log
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
# -----------------------------------------------------------------------------
# Locale/Encoding
# -----------------------------------------------------------------------------
timezone = 'America/Sao_Paulo'
lc_messages = 'en_US.UTF-8'
# -----------------------------------------------------------------------------
# Performance
# -----------------------------------------------------------------------------
# JIT: desabilitar em containers pequenos (overhead de compilação)
jit = off
# Huge pages: requer configuração do host
huge_pages = off