Installation via ArgoCD
Installation via ArgoCD (ecosystem-core)
Neben der manuellen Installation des ecosystem-core mit Hilfe des Helm-Charts, kann auch ArgoCD als GitOps-Tool
für die Installation verwendet werden.
Voraussetzungen
- Laufender Kubernetes-Cluster
kubectlCLI konfiguriert und mit dem Cluster verbunden- Cluster-Admin-Rechte
ArgoCD-Instanz
Falls keine ArgoCD-Instanz bereits im Cluster läuft, kann diese wie folgt installiert werden:
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yamlFür den Zugriff auf das ArgoCD-Dashboard muss eine separate Ingress-Ressource für den Port 443 eingerichtet werden.
Alternativ kann ein Zugriff temporär über ein Port-Forwarding eingerichtet werden, bei dem das ArgoCD-Dashboard anschließend über
https://localhost:8080 erreichbar ist.
kubectl port-forward svc/argocd-server -n argocd 8080:443Für den initialen admin User muss das erstellte Password ausgelesen werden:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d && echoSecrets
Damit ArgoCD auf die Helm-Charts zugreifen kann, wird ein Secret für die Cloudogu Helm-Registry benötigt. Über kubectl lässt es sich wie folgt ausbringen:
apiVersion: v1
kind: Secret
metadata:
name: cloudogu-oci-registry-k8s
namespace: argocd
labels:
argocd.argoproj.io/secret-type: repository
stringData:
type: "helm"
name: "Cloudogu-Registry"
url: "registry.cloudogu.com/k8s"
enableOCI: "true"
username: "USERNAME"
password: "TOKEN"Ist das Repository für die GitOps-Ressourcen privat, muss hierfür separat ein Secret für das Repository angelegt werden:
apiVersion: v1
kind: Secret
metadata:
name: scm-repo-secret
namespace: argocd
labels:
# Tells Argo CD this secret defines a repository
argocd.argoproj.io/secret-type: repository
type: Opaque
stringData:
url: "<Link to repository>"
username: "my_username"
password: "API_TOKEN"Deployment
Das komplette CES-MN kann mittels ArgoCD über mehrere sogenannte Sync-Waves in Form von Applikationen ausgebracht werden:
- k8s-component-operator-crd (sync-wave -1): installiert die Component CRD als Voraussetzung für den Component-Operator
- ecosystem-core (sync-wave 0): installiert den Component-Operator mit allen notwendigen Komponenten und erstellt eine Default-Konfiguration
- blueprint (sync-wave 1): installiert ein Blueprint mit einer nutzerspezfischen Konfiguration sowie alle gewünschten Dogus
Darüber hinaus könnten weitere Sync-Waves mit Priorität -1 verwendet werden, um Zertifkate oder Secrets im Cluster bereitzustellen.
k8s-component-operator-crd
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: k8s-component-operator-crd
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "-1"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: registry.cloudogu.com/k8s
chart: k8s-component-operator-crd
targetRevision: "1.10.0"
path: "." # required for Helm OCI sources
destination:
server: https://kubernetes.default.svc
namespace: ecosystem
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- PruneLast=true # safer deletionecosystem-core
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ecosystem-core
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "0"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: registry.cloudogu.com/k8s
chart: ecosystem-core
targetRevision: "0.2.2"
path: "." # required for Helm OCI sources
helm:
valuesObject:
skipPreconditionValidation: true
destination:
server: https://kubernetes.default.svc
namespace: ecosystem
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- PruneLast=true # safer deletionblueprint
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: blueprint
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: registry.cloudogu.com/k8s
chart: k8s-blueprint
targetRevision: "1.1.1"
path: "." # required for Helm OCI sources
# You can override the default configuration here.
# See https://github.com/cloudogu/k8s-blueprint-helm/blob/develop/k8s/helm/values.yaml for all available options.
#helm:
# valuesObject:
# spec:
# blueprint:
# official/cas: "7.2.7-5"
destination:
server: https://kubernetes.default.svc
namespace: ecosystem
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- PruneLast=true # safer deletionCES-MN
Alle oben genannten Applikationen bzw. das Blueprint werden zusammen über eine übergeordnete Applikation ausgebracht, die im folgenden
als ces-mn betitelt wird:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: "ces-mn"
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://example.local/repo/ces
targetRevision: main # branch, tag, or commit
path: apps/ces-mn # folder with manifests
directory:
recurse: true # pick up nested folders
destination:
server: https://kubernetes.default.svc
namespace: ecosystem
syncPolicy:
automated:
prune: true # delete drifted resources
selfHeal: true # fix out-of-band changesAlle Bestandteile der Applikation finden sich im Repositry repoURL im Branch/Tag/Commit targetRevision unter dem Pfad path.
Health Checks
Das EcoSystem wird mit ecosystem-core und blueprint Component-CRs und eine Blueprint-CR erstellen.
Diese CRDs sind ArgoCD nicht bekannt und somit ist es ohne Hilfe nicht möglich den wirklichen Health-Status in ArgoCD zu visualisieren.
Daher kann in diesem Fall ein Healthcheck definiert werden.
Dazu sollte die argocd-cm ConfigMap erweitert werden:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
data:
resource.customizations.health.k8s.cloudogu.com_Component: |
hs = {}
if obj.status ~= nil and obj.status.status == "installed" and obj.status.health == "available" then
hs.status = "Healthy"
else
hs.status = "Progressing"
end
if obj.status ~= nil and obj.status.health ~= nil then
hs.message = obj.status.health
end
return hs
resource.customizations.health.k8s.cloudogu.com_Blueprint: |
blueprintCompleted = false
blueprintCompletedMsg = "Blueprint uncompleted"
ecosystemHealthy = false
ecosystemHealthyMsg = "Ecosystem unhealthy"
hs = {}
hs.status = "Progressing"
if obj.status ~= nil and obj.status.conditions ~= nil then
for i, cond in ipairs(obj.status.conditions) do
if cond.type == "Completed" then
if cond.status == "True" then
blueprintCompleted = true
blueprintCompletedMsg = cond.message or "Blueprint completed"
end
end
if cond.type == "EcosystemHealthy" then
if cond.status == "True" then
ecosystemHealthy = true
ecosystemHealthyMsg = cond.message or "Ecosystem healthy"
end
end
end
if blueprintCompleted and ecosystemHealthy then
hs.status = "Healthy"
end
end
hs.message = blueprintCompletedMsg .. " and " .. ecosystemHealthyMsg
return hsFalls kein Blueprint verwendet wird, sondern das Ecosystem ausschließlich mit Dogu-CRs aufgesetzt wird, kann folgender Healthcheck verwendet werden:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
data:
resource.customizations.health.k8s.cloudogu.com_Component: |
hs = {}
if obj.status ~= nil and obj.status.status == "installed" and obj.status.health == "available" then
hs.status = "Healthy"
else
hs.status = "Progressing"
end
if obj.status ~= nil and obj.status.health ~= nil then
hs.message = obj.status.health
end
return hs
resource.customizations.health.k8s.cloudogu.com_Dogu: |
hs = {}
hs.status = "Progressing"
if obj.status ~= nil and obj.status.conditions ~= nil then
for i, cond in ipairs(obj.status.conditions) do
if cond.type == "healthy" then
if cond.status == "True" then
hs.status = "Healthy"
end
if cond.message ~= nil then
hs.message = cond.message
end
break
end
end
end
return hsZuletzt aktualisiert am 10.3.2026