ποΈ 4λ¨κ³: Helm Chart ꡬ쑰 λ° Git Repository μ€μ
4.1 κΆμ₯ Repository ꡬ쑰
runna-k8s-manifests/
βββ README.md
βββ charts/ # Helm Charts
β βββ backend-api/ # Backend API Chart
β β βββ Chart.yaml
β β βββ values.yaml
β β βββ values-prod.yaml
β β βββ templates/
β β βββ deployment.yaml
β β βββ service.yaml
β β βββ configmap.yaml
β β βββ secret.yaml
β β βββ hpa.yaml
β β
β βββ function-executor/ # Function Executor Chart
β β βββ Chart.yaml
β β βββ values.yaml
β β βββ values-prod.yaml
β β βββ templates/
β β βββ deployment.yaml
β β βββ service.yaml
β β βββ configmap.yaml
β β
β βββ redis/ # Redis Chart
β βββ Chart.yaml
β βββ values.yaml
β βββ templates/
β βββ statefulset.yaml
β βββ service.yaml
β βββ pvc.yaml
β
βββ argocd/ # ArgoCD Applications
β βββ applications/
β β βββ backend-api.yaml
β β βββ function-executor.yaml
β β βββ redis.yaml
β β βββ monitoring.yaml
β βββ projects/
β βββ runna-prod.yaml
β
βββ monitoring/ # Monitoring Stack
βββ prometheus-values.yaml
βββ grafana-values.yaml
βββ loki-values.yaml
4.2 Git Repository μμ±
# GitHubμμ μ Repository μμ±# Repository μ΄λ¦: runna-k8s-manifests# λ‘컬μμ μ΄κΈ°νmkdir runna-k8s-manifests
cd runna-k8s-manifests
git init
git remote add origin <https://github.com/><your-org>/runna-k8s-manifests.git
# κΈ°λ³Έ ꡬ쑰 μμ±mkdir -p charts/{backend-api,function-executor,redis}/{templates}
mkdir -p argocd/{applications,projects}
mkdir -p monitoring
# README μμ±cat > README.md << 'EOF'
# Runna Kubernetes Manifests
Helm Charts and ArgoCD configurations for Runna platform.
## Structure
- `charts/`: Helm charts for applications
- `argocd/`: ArgoCD application definitions
- `monitoring/`: Monitoring stack configurations
EOF
git add .
git commit -m "Initial commit: repository structure"
git push -u origin main
π 6λ¨κ³: ArgoCD μ€μΉ λ° μ€μ
6.1 ArgoCD μ€μΉ
6.2 ArgoCD μ΄κΈ° λΉλ°λ²νΈ νμΈ
# μ΄κΈ° admin λΉλ°λ²νΈ νμΈ
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
echo
# ν¬νΈ ν¬μλ© (λ‘컬μμ μ μ)
kubectl port-forward svc/argocd-server -n argocd 8080:443
# λΈλΌμ°μ μμ <https://localhost:8080> μ μ# Username: admin# Password: <μμμ νμΈν λΉλ°λ²νΈ>
6.3 ArgoCD Application μμ±
# argocd/applications/backend-api.yamlcat > argocd/applications/backend-api.yaml << 'EOF'
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: backend-api
namespace: argocd
spec:
project: runna-prod
source:
repoURL: <https://github.com/><your-org>/runna-k8s-manifests.git
targetRevision: main
path: charts/backend-api
helm:
valueFiles:
- values-prod.yaml
destination:
server: <https://kubernetes.default.svc>
namespace: default
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
EOF
# ArgoCDμ Application λ±λ‘
kubectl apply -f argocd/applications/backend-api.yaml
π 7λ¨κ³: Monitoring Stack μ€μΉ
7.1 Prometheus μ€μΉ
# Prometheus values νμΌ μμ±cat > monitoring/prometheus-values.yaml << 'EOF'
server:
nodeSelector:
workload: ops
persistentVolume:
enabled: true
size: 20Gi
alertmanager:
nodeSelector:
workload: ops
persistentVolume:
enabled: true
size: 5Gi
EOF
# Prometheus μ€μΉ
helm install prometheus prometheus-community/prometheus \
-n monitoring \
--create-namespace \
-f monitoring/prometheus-values.yaml
7.2 Grafana μ€μΉ