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:
129
aula-13/benchmarks/benchmark-pull-only.sh
Executable file
129
aula-13/benchmarks/benchmark-pull-only.sh
Executable file
@@ -0,0 +1,129 @@
|
||||
#!/bin/bash
|
||||
# =============================================================================
|
||||
# Benchmark de PULL: eStargz vs Traditional
|
||||
# =============================================================================
|
||||
#
|
||||
# Mede apenas o tempo de PULL das imagens (não espera container ficar Ready)
|
||||
# Executa em node limpo sem cache.
|
||||
#
|
||||
# =============================================================================
|
||||
|
||||
set -e
|
||||
|
||||
NAMESPACE="benchmark-pull"
|
||||
ESTARGZ_IMAGE="registry.kube.quest/factory/postgresql:17"
|
||||
TRADITIONAL_IMAGE="postgres:17-alpine"
|
||||
TARGET_NODE="worker-pool-6bea48339a15ab6e" # Node 128.140.11.113 - sem cache
|
||||
|
||||
echo "========================================================================"
|
||||
echo "Benchmark de PULL: eStargz vs Traditional"
|
||||
echo "========================================================================"
|
||||
echo ""
|
||||
echo "Target node: $TARGET_NODE (sem cache)"
|
||||
echo ""
|
||||
|
||||
# Setup
|
||||
kubectl delete namespace $NAMESPACE --ignore-not-found=true --wait=true 2>/dev/null || true
|
||||
kubectl create namespace $NAMESPACE
|
||||
kubectl create secret docker-registry gitlab-registry \
|
||||
--docker-server=registry.kube.quest \
|
||||
--docker-username=root \
|
||||
--docker-password="${GITLAB_TOKEN:-glpat-dummy}" \
|
||||
-n $NAMESPACE 2>/dev/null || true
|
||||
|
||||
echo ""
|
||||
echo "========================================================================"
|
||||
echo "TESTE 1: Pull de Imagem Tradicional (gzip)"
|
||||
echo "========================================================================"
|
||||
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-traditional
|
||||
namespace: $NAMESPACE
|
||||
spec:
|
||||
nodeName: $TARGET_NODE
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: postgres
|
||||
image: $TRADITIONAL_IMAGE
|
||||
imagePullPolicy: Always
|
||||
command: ["sleep", "infinity"]
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: test
|
||||
EOF
|
||||
|
||||
echo "Aguardando pull..."
|
||||
sleep 2
|
||||
while true; do
|
||||
PULLED=$(kubectl get events -n $NAMESPACE --field-selector involvedObject.name=test-traditional,reason=Pulled -o jsonpath='{.items[0].message}' 2>/dev/null)
|
||||
if [ -n "$PULLED" ]; then
|
||||
echo "RESULTADO: $PULLED"
|
||||
break
|
||||
fi
|
||||
PULLING=$(kubectl get events -n $NAMESPACE --field-selector involvedObject.name=test-traditional,reason=Pulling -o jsonpath='{.items[0].message}' 2>/dev/null)
|
||||
if [ -n "$PULLING" ]; then
|
||||
echo -n "."
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "========================================================================"
|
||||
echo "TESTE 2: Pull de Imagem eStargz (lazy pulling)"
|
||||
echo "========================================================================"
|
||||
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-estargz
|
||||
namespace: $NAMESPACE
|
||||
spec:
|
||||
nodeName: $TARGET_NODE
|
||||
restartPolicy: Never
|
||||
imagePullSecrets:
|
||||
- name: gitlab-registry
|
||||
containers:
|
||||
- name: postgres
|
||||
image: $ESTARGZ_IMAGE
|
||||
imagePullPolicy: Always
|
||||
command: ["sleep", "infinity"]
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: test
|
||||
EOF
|
||||
|
||||
echo "Aguardando pull..."
|
||||
sleep 2
|
||||
while true; do
|
||||
PULLED=$(kubectl get events -n $NAMESPACE --field-selector involvedObject.name=test-estargz,reason=Pulled -o jsonpath='{.items[0].message}' 2>/dev/null)
|
||||
if [ -n "$PULLED" ]; then
|
||||
echo "RESULTADO: $PULLED"
|
||||
break
|
||||
fi
|
||||
PULLING=$(kubectl get events -n $NAMESPACE --field-selector involvedObject.name=test-estargz,reason=Pulling -o jsonpath='{.items[0].message}' 2>/dev/null)
|
||||
if [ -n "$PULLING" ]; then
|
||||
echo -n "."
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "========================================================================"
|
||||
echo "RESUMO"
|
||||
echo "========================================================================"
|
||||
echo ""
|
||||
echo "Todos os eventos de pull:"
|
||||
kubectl get events -n $NAMESPACE --sort-by='.lastTimestamp' \
|
||||
-o custom-columns='TIME:.lastTimestamp,REASON:.reason,POD:.involvedObject.name,MESSAGE:.message' \
|
||||
| grep -E "Pull|pull"
|
||||
|
||||
echo ""
|
||||
echo "Status dos pods:"
|
||||
kubectl get pods -n $NAMESPACE -o wide
|
||||
|
||||
echo ""
|
||||
echo "Para limpar: kubectl delete namespace $NAMESPACE"
|
||||
Reference in New Issue
Block a user