README.md aktualisiert
This commit is contained in:
112
README.md
112
README.md
@@ -1,111 +1 @@
|
|||||||
# Argo CD + Git Demo Bundle
|
README
|
||||||
|
|
||||||
Dieses Bundle setzt eine kleine Demo auf einem **bereits existierenden Kubernetes-Cluster** auf.
|
|
||||||
|
|
||||||
Ziel der Demo:
|
|
||||||
- Ein kleines **Git** im Cluster (Gitea)
|
|
||||||
- **Argo CD** als GitOps-CD
|
|
||||||
- Eine kleine **Helm-App**
|
|
||||||
- Ein sichtbarer **Upgrade-Flow nur über Git/Helm values**
|
|
||||||
|
|
||||||
## Architektur
|
|
||||||
- Namespace `gitea`: internes Demo-Git
|
|
||||||
- Namespace `argocd`: Argo CD
|
|
||||||
- Namespace `demo-app`: Demo-Anwendung
|
|
||||||
|
|
||||||
## Voraussetzung
|
|
||||||
- `kubectl` Zugriff auf den Cluster
|
|
||||||
- ausgehender Internetzugriff des Clusters auf Container-Images/Helm Charts
|
|
||||||
- optional `helm`
|
|
||||||
|
|
||||||
## Schnellstart
|
|
||||||
1. Namespaces und Basis anlegen:
|
|
||||||
```bash
|
|
||||||
kubectl apply -f bootstrap/namespaces.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Gitea installieren:
|
|
||||||
```bash
|
|
||||||
helm repo add gitea-charts https://dl.gitea.com/charts/
|
|
||||||
helm repo update
|
|
||||||
helm upgrade --install gitea gitea-charts/gitea \
|
|
||||||
-n gitea -f bootstrap/gitea-values.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Argo CD installieren:
|
|
||||||
```bash
|
|
||||||
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Warten bis Argo CD und Gitea laufen:
|
|
||||||
```bash
|
|
||||||
kubectl -n argocd rollout status deploy/argocd-server --timeout=300s
|
|
||||||
kubectl -n gitea rollout status statefulset/gitea-postgresql --timeout=300s || true
|
|
||||||
kubectl -n gitea rollout status deploy/gitea-http --timeout=300s || true
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Gitea lokal erreichbar machen:
|
|
||||||
```bash
|
|
||||||
kubectl -n gitea port-forward svc/gitea-http 3000:3000
|
|
||||||
```
|
|
||||||
Dann im Browser `http://localhost:3000` öffnen.
|
|
||||||
|
|
||||||
6. Initialen Admin-User anlegen (falls Setup-Seite erscheint) oder vorhandene Logins nutzen.
|
|
||||||
|
|
||||||
7. Ein neues Repo erstellen, z. B. `gitops-demo`.
|
|
||||||
|
|
||||||
8. Dieses Bundle in euer Repo pushen:
|
|
||||||
```bash
|
|
||||||
git init
|
|
||||||
git branch -M main
|
|
||||||
git add .
|
|
||||||
git commit -m "initial demo"
|
|
||||||
git remote add origin http://localhost:3000/<ORG_OR_USER>/gitops-demo.git
|
|
||||||
git push -u origin main
|
|
||||||
```
|
|
||||||
|
|
||||||
9. Argo CD Repo-Secret anpassen:
|
|
||||||
- Datei `argocd/repo-secret.yaml`
|
|
||||||
- `url`, `username`, `password` auf euer Gitea-Repo setzen
|
|
||||||
|
|
||||||
10. Repo-Secret und App deployen:
|
|
||||||
```bash
|
|
||||||
kubectl apply -f argocd/repo-secret.yaml
|
|
||||||
kubectl apply -f argocd/project.yaml
|
|
||||||
kubectl apply -f apps/demo-app.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
11. Argo CD UI öffnen:
|
|
||||||
```bash
|
|
||||||
kubectl -n argocd port-forward svc/argocd-server 8080:443
|
|
||||||
```
|
|
||||||
UI: `https://localhost:8080`
|
|
||||||
|
|
||||||
Admin-Passwort:
|
|
||||||
```bash
|
|
||||||
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d; echo
|
|
||||||
```
|
|
||||||
|
|
||||||
## Demo-Flow für Kundentermin
|
|
||||||
1. Zeige in Gitea die Datei `charts/demo-app/values.yaml`
|
|
||||||
2. In Argo CD ist die App `Healthy/Synced`
|
|
||||||
3. Ändere z. B.:
|
|
||||||
- `image.tag: "1.25"` -> `"1.27"`
|
|
||||||
- oder `replicaCount: 1` -> `2`
|
|
||||||
- oder `message: "v1"` -> `"v2 upgraded by gitops"`
|
|
||||||
4. Commit + Push
|
|
||||||
5. Argo CD erkennt die Git-Änderung und rollt aus
|
|
||||||
6. Zeige in Kubernetes:
|
|
||||||
```bash
|
|
||||||
kubectl -n demo-app get deploy,pods,svc,cm
|
|
||||||
kubectl -n demo-app rollout status deploy/demo-app
|
|
||||||
```
|
|
||||||
|
|
||||||
## Sauberer Upgrade-Nachweis
|
|
||||||
- **Git ist die einzige Wahrheit**: Keine direkte Cluster-Änderung
|
|
||||||
- Änderung nur im Repo
|
|
||||||
- Argo CD erkennt Drift und synchronisiert
|
|
||||||
- Rollout sauber über Deployment-Update
|
|
||||||
|
|
||||||
## Optional: Image Updater
|
|
||||||
Wenn ihr in einer zweiten Demo auch zeigen wollt, wie neue Container-Tags automatisch in Git zurückgeschrieben werden, könnt ihr zusätzlich Argo CD Image Updater evaluieren. Für diese Demo ist er nicht nötig.
|
|
||||||
Reference in New Issue
Block a user