πŸ—‚οΈ 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 μ„€μΉ˜