diff --git a/README.md b/README.md index 8250533..f99283b 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,15 @@ Codefresh GitOps Certification examples - Level 3 - GitOps Enterprise This repository contains examples for the ArgoCD/GitOps certification workshops (Level 3) Take the certification yourself at [https://codefresh.io/courses/get-gitops-certified/](https://learning.codefresh.io/) + + + +bad + +good commit + +good + +cc + +cccccc diff --git a/argocd-apps-structure/apps/invoices/envs/qa/deployment.yml b/argocd-apps-structure/apps/billing/envs/qa/deployment.yml similarity index 97% rename from argocd-apps-structure/apps/invoices/envs/qa/deployment.yml rename to argocd-apps-structure/apps/billing/envs/qa/deployment.yml index b4d29eb..5d7d968 100644 --- a/argocd-apps-structure/apps/invoices/envs/qa/deployment.yml +++ b/argocd-apps-structure/apps/billing/envs/qa/deployment.yml @@ -13,4 +13,4 @@ spec: value: "qa" - name: GPU_ENABLED value: "1" - \ No newline at end of file + diff --git a/argocd-apps-structure/apps/payments/envs/prod-us/kustomization.yml b/argocd-apps-structure/apps/billing/envs/qa/kustomization.yml similarity index 100% rename from argocd-apps-structure/apps/payments/envs/prod-us/kustomization.yml rename to argocd-apps-structure/apps/billing/envs/qa/kustomization.yml diff --git a/argocd-apps-structure/apps/billing/envs/qa/replicas.yml b/argocd-apps-structure/apps/billing/envs/qa/replicas.yml new file mode 100644 index 0000000..3af68f6 --- /dev/null +++ b/argocd-apps-structure/apps/billing/envs/qa/replicas.yml @@ -0,0 +1,7 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: simple-deployment +spec: + replicas: 2 diff --git a/argocd-apps-structure/apps/payments/envs/prod-us/settings.yml b/argocd-apps-structure/apps/billing/envs/qa/settings.yml similarity index 100% rename from argocd-apps-structure/apps/payments/envs/prod-us/settings.yml rename to argocd-apps-structure/apps/billing/envs/qa/settings.yml diff --git a/argocd-apps-structure/apps/payments/envs/prod-us/version.yml b/argocd-apps-structure/apps/billing/envs/qa/version.yml similarity index 100% rename from argocd-apps-structure/apps/payments/envs/prod-us/version.yml rename to argocd-apps-structure/apps/billing/envs/qa/version.yml diff --git a/argocd-apps-structure/apps/payments/envs/prod-us/deployment.yml b/argocd-apps-structure/apps/orders/envs/prod-eu/deployment.yml similarity index 87% rename from argocd-apps-structure/apps/payments/envs/prod-us/deployment.yml rename to argocd-apps-structure/apps/orders/envs/prod-eu/deployment.yml index 676bc41..8841797 100644 --- a/argocd-apps-structure/apps/payments/envs/prod-us/deployment.yml +++ b/argocd-apps-structure/apps/orders/envs/prod-eu/deployment.yml @@ -10,7 +10,7 @@ spec: - name: webserver-simple env: - name: ENV - value: "prod-us" + value: "prod-eu" - name: GPU_ENABLED value: "1" - \ No newline at end of file + diff --git a/argocd-apps-structure/apps/invoices/envs/qa/kustomization.yml b/argocd-apps-structure/apps/orders/envs/prod-eu/kustomization.yml similarity index 91% rename from argocd-apps-structure/apps/invoices/envs/qa/kustomization.yml rename to argocd-apps-structure/apps/orders/envs/prod-eu/kustomization.yml index 8d95e15..4034921 100644 --- a/argocd-apps-structure/apps/invoices/envs/qa/kustomization.yml +++ b/argocd-apps-structure/apps/orders/envs/prod-eu/kustomization.yml @@ -1,7 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization - resources: - ../../base @@ -9,6 +8,6 @@ resources: patchesStrategicMerge: - deployment.yml - version.yml +- replicas.yml - settings.yml - diff --git a/argocd-apps-structure/apps/payments/envs/prod-us/replicas.yml b/argocd-apps-structure/apps/orders/envs/prod-eu/replicas.yml similarity index 100% rename from argocd-apps-structure/apps/payments/envs/prod-us/replicas.yml rename to argocd-apps-structure/apps/orders/envs/prod-eu/replicas.yml diff --git a/argocd-apps-structure/apps/invoices/envs/qa/settings.yml b/argocd-apps-structure/apps/orders/envs/prod-eu/settings.yml similarity index 87% rename from argocd-apps-structure/apps/invoices/envs/qa/settings.yml rename to argocd-apps-structure/apps/orders/envs/prod-eu/settings.yml index 738a5be..d5d934c 100644 --- a/argocd-apps-structure/apps/invoices/envs/qa/settings.yml +++ b/argocd-apps-structure/apps/orders/envs/prod-eu/settings.yml @@ -10,7 +10,7 @@ spec: - name: webserver-simple env: - name: UI_THEME - value: "light" + value: "dark" - name: CACHE_SIZE value: "2048kb" - name: PAGE_LIMIT @@ -18,4 +18,4 @@ spec: - name: SORTING value: "ascending" - name: N_BUCKETS - value: "42" \ No newline at end of file + value: "42" diff --git a/argocd-apps-structure/apps/invoices/envs/qa/version.yml b/argocd-apps-structure/apps/orders/envs/prod-eu/version.yml similarity index 71% rename from argocd-apps-structure/apps/invoices/envs/qa/version.yml rename to argocd-apps-structure/apps/orders/envs/prod-eu/version.yml index 51bc535..0423d0f 100644 --- a/argocd-apps-structure/apps/invoices/envs/qa/version.yml +++ b/argocd-apps-structure/apps/orders/envs/prod-eu/version.yml @@ -8,4 +8,4 @@ spec: spec: containers: - name: webserver-simple - image: docker.io/kostiscodefresh/simple-env-app:1.0 + image: docker.io/kostiscodefresh/simple-env-app:2.0 diff --git a/argocd-apps-structure/appsets/README.md b/argocd-apps-structure/appsets/README.md new file mode 100644 index 0000000..06d80ef --- /dev/null +++ b/argocd-apps-structure/appsets/README.md @@ -0,0 +1,2 @@ +## 说明 +在实际环境中,应该需要使用 cluster labels and the matrix generator 以控制哪些应用程序将被分配到哪些集群。 diff --git a/argocd-apps-structure/appsets/my-prod-appset.yml b/argocd-apps-structure/appsets/my-prod-appset.yml index 4dbe20c..3ad4e4e 100644 --- a/argocd-apps-structure/appsets/my-prod-appset.yml +++ b/argocd-apps-structure/appsets/my-prod-appset.yml @@ -8,7 +8,7 @@ spec: goTemplateOptions: ["missingkey=error"] generators: - git: - repoURL: https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git + repoURL: https://github.com/ForcemCS/gitops-cert-level-3-examples.git revision: HEAD directories: - path: argocd-apps-structure/apps/*/envs/prod-us @@ -22,13 +22,13 @@ spec: # Source of the application manifests source: - repoURL: https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git + repoURL: https://github.com/ForcemCS/gitops-cert-level-3-examples.git targetRevision: HEAD path: '{{.path.path}}' # Destination cluster and namespace to deploy the application destination: - server: https://kubernetes.default.svc + name: cluster-2 namespace: '{{index .path.segments 2}}-{{index .path.segments 4}}' # Sync policy diff --git a/argocd-apps-structure/appsets/my-qa-appset.yml b/argocd-apps-structure/appsets/my-qa-appset.yml index 69592aa..c083d14 100644 --- a/argocd-apps-structure/appsets/my-qa-appset.yml +++ b/argocd-apps-structure/appsets/my-qa-appset.yml @@ -8,7 +8,7 @@ spec: goTemplateOptions: ["missingkey=error"] generators: - git: - repoURL: https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git + repoURL: https://github.com/ForcemCS/gitops-cert-level-3-examples.git revision: HEAD directories: - path: argocd-apps-structure/apps/*/envs/qa @@ -21,7 +21,7 @@ spec: # Source of the application manifests source: - repoURL: https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git + repoURL: https://github.com/ForcemCS/gitops-cert-level-3-examples.git targetRevision: HEAD path: '{{.path.path}}' diff --git a/argocd-apps-structure/appsets/my-staging-appset.yml b/argocd-apps-structure/appsets/my-staging-appset.yml index 969b8f0..61de015 100644 --- a/argocd-apps-structure/appsets/my-staging-appset.yml +++ b/argocd-apps-structure/appsets/my-staging-appset.yml @@ -8,7 +8,7 @@ spec: goTemplateOptions: ["missingkey=error"] generators: - git: - repoURL: https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git + repoURL: https://github.com/ForcemCS/gitops-cert-level-3-examples.git revision: HEAD directories: - path: argocd-apps-structure/apps/*/envs/staging @@ -21,7 +21,7 @@ spec: # Source of the application manifests source: - repoURL: https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git + repoURL: https://github.com/ForcemCS/gitops-cert-level-3-examples.git targetRevision: HEAD path: '{{.path.path}}' diff --git a/argocd-apps-structure/root-argocd-app.yml b/argocd-apps-structure/root-argocd-app.yml index 28574cf..9d45c20 100644 --- a/argocd-apps-structure/root-argocd-app.yml +++ b/argocd-apps-structure/root-argocd-app.yml @@ -6,7 +6,7 @@ metadata: spec: project: default source: - repoURL: https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git + repoURL: https://github.com/ForcemCS/gitops-cert-level-3-examples.git targetRevision: HEAD path: argocd-apps-structure/appsets destination: diff --git a/preview-environments/pr-generator/pr-generator.yml b/preview-environments/pr-generator/pr-generator.yml index e1d1289..650a545 100644 --- a/preview-environments/pr-generator/pr-generator.yml +++ b/preview-environments/pr-generator/pr-generator.yml @@ -9,15 +9,16 @@ spec: generators: - pullRequest: github: - owner: codefresh-contrib + owner: ForcemCS repo: gitops-cert-level-3-examples + labels: preview-ready requeueAfterSeconds: 180 template: metadata: name: 'myapp-{{.branch}}' spec: source: - repoURL: 'https://github.com/codefresh-contrib/gitops-cert-level-3-examples.git' + repoURL: 'https://github.com/ForcemCS/gitops-cert-level-3-examples.git' targetRevision: HEAD path: preview-environments/kustomize-preview-app/ kustomize: @@ -31,4 +32,4 @@ spec: automated: prune: true syncOptions: - - CreateNamespace=true \ No newline at end of file + - CreateNamespace=true