Listing 1: Einfache Kubernetes-Anwendung als CRD-Beispiel apiVersion: apps/v1 kind: Deployment metadata: name: simple-deployment spec: replicas: 1 selector: matchLabels: app: trivial-go-web-app template: metadata: labels: app: trivial-go-web-app spec: containers: - name: webserver-simple image: docker.io/kostiscodefresh/ gitops-simple-app:v1.0 ports: - containerPort: 8080 --- apiVersion: v1 kind: Service metadata: name: simple-service spec: type: ClusterIP selector: app: trivial-go-web-app ports: - protocol: TCP port: 80 targetPort: 8080 Listing 2: Argo-CD-Applikation per Manifest ausrollen apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: demo namespace: argocd finalizers: - resources-finalizer.argocd.argoproj.io spec: project: default source: repoURL: https://github.com/codefreshcontrib/gitops-certification-examples.git targetRevision: HEAD path: ./declarative/manifests directory: recurse: false destination: server: https://kubernetes.default.svc namespace: default syncPolicy: automated: prune: true selfHeal: true allowEmpty: false Listing 3: Multiple Anwendungen via App of Apps apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: app-of-apps namespace: argocd spec: project: default source: repoURL: https://github.com/your-org/ your-repo.git targetRevision: HEAD path: apps destination: server: https://kubernetes.default.svc namespace: argocd Listing 4: Dynamisches Deployment mit ApplicationSets apiVersion: argoproj.io/v1alpha1 kind: ApplicationSet metadata: name: my-app-set namespace: argocd spec: generators: - list: elements: - namespace: prod environment: production - namespace: staging environment: staging template: metadata: name: "{{namespace}}-app" spec: project: default source: repoURL: https://github.com/your-org/ your-repo.git targetRevision: HEAD path: charts/my-app helm: releaseName: "{{namespace}}-app" values: | environment: {{environment}} destination: server: https://kubernetes.default.svc namespace: "{{namespace}}"