├── .gitignore ├── apps ├── bgd │ ├── base │ │ ├── kustomization.yaml │ │ ├── bgd-route.yaml │ │ ├── bgd-svc.yaml │ │ └── bgd-deployment.yaml │ └── overlays │ │ ├── bgd │ │ ├── bgd-ns.yaml │ │ ├── bgd-svc.yaml │ │ ├── bgd-route.yaml │ │ └── bgd-deployment.yaml │ │ └── bgdk │ │ ├── bgdk-ns.yaml │ │ └── kustomization.yaml ├── welcome-php │ ├── base │ │ ├── kustomization.yaml │ │ ├── welcome-php-svc.yaml │ │ ├── welcome-php-route.yaml │ │ └── welcome-php-deployment.yaml │ └── overlays │ │ ├── syncwaves │ │ ├── kustomization.yaml │ │ └── welcome-php-ns.yaml │ │ ├── hooks │ │ ├── kustomization.yaml │ │ ├── welcome-php-ns.yaml │ │ └── welcome-php-presync-job.yaml │ │ └── syncwaves-and-hooks │ │ ├── kustomization.yaml │ │ ├── welcome-php-ns.yaml │ │ ├── welcome-php-postsync-pod.yaml │ │ ├── welcome-php-presync-job.yaml │ │ └── welcome-php-presync-pod.yaml ├── todo │ ├── todo-namespace.yaml │ ├── postgres-secret.yaml │ ├── postgres-service.yaml │ ├── todo-route.yaml │ ├── todo-service.yaml │ ├── todo-insert-data.yaml │ ├── postgres-create-table.yaml │ ├── postgres-deployment.yaml │ └── todo-deployment.yaml └── quarkus-subchart │ ├── values.yaml │ └── Chart.yaml ├── README.md ├── bootstrap ├── openshift-gitops-operator-patch.yaml └── openshift-gitops-operator-sub.yaml └── components ├── kustomize-build ├── kustomization.yaml └── welcome.yaml └── applications ├── bgd-app.yaml ├── bgdk-app.yaml ├── quarkus-subchart.yaml ├── welcome-hooks.yaml ├── welcome-syncwaves.yaml ├── welcome-syncwaves-and-hooks.yaml └── quarkus-app.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /apps/bgd/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namespace: bgd 2 | resources: 3 | - bgd-svc.yaml 4 | - bgd-deployment.yaml 5 | - bgd-route.yaml 6 | -------------------------------------------------------------------------------- /apps/welcome-php/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - welcome-php-deployment.yaml 3 | - welcome-php-route.yaml 4 | - welcome-php-svc.yaml 5 | -------------------------------------------------------------------------------- /apps/todo/todo-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: todo 5 | annotations: 6 | argocd.argoproj.io/sync-wave: "-1" -------------------------------------------------------------------------------- /apps/bgd/overlays/bgd/bgd-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: bgd 5 | labels: 6 | argocd.argoproj.io/managed-by: openshift-gitops 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # openshift-gitops-examples 2 | 3 | GitOps scenario & workshop manifests. Currently used for the [Katacoda GitOps Scenarios](https://learn.openshift.com/gitops) 4 | -------------------------------------------------------------------------------- /apps/bgd/overlays/bgdk/bgdk-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: bgdk 5 | labels: 6 | argocd.argoproj.io/managed-by: openshift-gitops 7 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/syncwaves/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: welcome 4 | resources: 5 | - ../../base 6 | - welcome-php-ns.yaml 7 | -------------------------------------------------------------------------------- /apps/quarkus-subchart/values.yaml: -------------------------------------------------------------------------------- 1 | quarkus: 2 | build: 3 | enabled: false 4 | deploy: 5 | route: 6 | tls: 7 | enabled: true 8 | replicas: 1 9 | image: 10 | name: quay.io/ablock/gitops-helm-quarkus 11 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/hooks/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: welcome-hooks 4 | resources: 5 | - ../../base 6 | - welcome-php-ns.yaml 7 | - welcome-php-presync-job.yaml 8 | -------------------------------------------------------------------------------- /apps/todo/postgres-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: postgresql-secret 5 | namespace: todo 6 | annotations: 7 | argocd.argoproj.io/sync-wave: "0" 8 | type: Opaque 9 | data: 10 | username: YWRtaW4= 11 | password: YWRtaW4= -------------------------------------------------------------------------------- /apps/quarkus-subchart/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: quarkus-subchart 3 | type: application 4 | version: 1.0.0 5 | appVersion: "1.0.0" 6 | dependencies: 7 | - name: quarkus 8 | version: 0.0.3 9 | repository: https://redhat-developer.github.io/redhat-helm-charts 10 | -------------------------------------------------------------------------------- /apps/bgd/base/bgd-route.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: route.openshift.io/v1 2 | kind: Route 3 | metadata: 4 | labels: 5 | app: bgd 6 | name: bgd 7 | namespace: bgd 8 | spec: 9 | port: 10 | targetPort: 8080 11 | to: 12 | kind: Service 13 | name: bgd 14 | weight: 100 15 | -------------------------------------------------------------------------------- /apps/bgd/base/bgd-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: bgd 7 | name: bgd 8 | namespace: bgd 9 | spec: 10 | ports: 11 | - port: 8080 12 | protocol: TCP 13 | targetPort: 8080 14 | selector: 15 | app: bgd 16 | --- 17 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/hooks/welcome-php-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | annotations: 5 | argocd.argoproj.io/sync-wave: "0" 6 | name: welcome-hooks 7 | labels: 8 | argocd.argoproj.io/managed-by: openshift-gitops 9 | spec: {} 10 | status: {} 11 | -------------------------------------------------------------------------------- /apps/bgd/overlays/bgd/bgd-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: bgd 7 | name: bgd 8 | namespace: bgd 9 | spec: 10 | ports: 11 | - port: 8080 12 | protocol: TCP 13 | targetPort: 8080 14 | selector: 15 | app: bgd 16 | --- 17 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/syncwaves/welcome-php-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | creationTimestamp: null 5 | annotations: 6 | argocd.argoproj.io/sync-wave: "0" 7 | name: welcome 8 | labels: 9 | argocd.argoproj.io/managed-by: openshift-gitops 10 | spec: {} 11 | status: {} 12 | -------------------------------------------------------------------------------- /apps/todo/postgres-service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: postgresql 6 | namespace: todo 7 | annotations: 8 | argocd.argoproj.io/sync-wave: "0" 9 | spec: 10 | selector: 11 | app: postgresql 12 | ports: 13 | - name: pgsql 14 | port: 5432 15 | targetPort: 5432 -------------------------------------------------------------------------------- /apps/welcome-php/overlays/syncwaves-and-hooks/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: welcome-waves-and-hooks 4 | resources: 5 | - ../../base 6 | - welcome-php-ns.yaml 7 | - welcome-php-postsync-pod.yaml 8 | - welcome-php-presync-job.yaml 9 | - welcome-php-presync-pod.yaml 10 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/syncwaves-and-hooks/welcome-php-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | creationTimestamp: null 5 | annotations: 6 | argocd.argoproj.io/sync-wave: "0" 7 | name: welcome-waves-and-hooks 8 | labels: 9 | argocd.argoproj.io/managed-by: openshift-gitops 10 | spec: {} 11 | status: {} 12 | -------------------------------------------------------------------------------- /apps/todo/todo-route.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: route.openshift.io/v1 2 | kind: Route 3 | metadata: 4 | labels: 5 | app: todo 6 | name: todo 7 | namespace: todo 8 | annotations: 9 | argocd.argoproj.io/sync-wave: "3" 10 | spec: 11 | port: 12 | targetPort: 8080 13 | to: 14 | kind: Service 15 | name: todo-gitops 16 | weight: 100 -------------------------------------------------------------------------------- /apps/welcome-php/base/welcome-php-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | annotations: 5 | argocd.argoproj.io/sync-wave: "2" 6 | labels: 7 | app: welcome-php 8 | name: welcome-php 9 | spec: 10 | ports: 11 | - port: 8080 12 | protocol: TCP 13 | targetPort: 8080 14 | selector: 15 | app: welcome-php 16 | -------------------------------------------------------------------------------- /apps/welcome-php/base/welcome-php-route.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: route.openshift.io/v1 2 | kind: Route 3 | metadata: 4 | annotations: 5 | argocd.argoproj.io/sync-wave: "3" 6 | labels: 7 | app: welcome-php 8 | name: welcome-php 9 | spec: 10 | port: 11 | targetPort: 8080 12 | to: 13 | kind: Service 14 | name: welcome-php 15 | weight: null 16 | -------------------------------------------------------------------------------- /bootstrap/openshift-gitops-operator-patch.yaml: -------------------------------------------------------------------------------- 1 | spec: 2 | resourceCustomizations: | 3 | route.openshift.io/Route: 4 | ignoreDifferences: | 5 | jsonPointers: 6 | - /spec/host 7 | server: 8 | insecure: true 9 | route: 10 | enabled: true 11 | tls: 12 | insecureEdgeTerminationPolicy: Redirect 13 | termination: edge 14 | -------------------------------------------------------------------------------- /apps/bgd/overlays/bgd/bgd-route.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: route.openshift.io/v1 2 | kind: Route 3 | metadata: 4 | labels: 5 | app: bgd 6 | name: bgd 7 | namespace: bgd 8 | spec: 9 | port: 10 | targetPort: 8080 11 | tls: 12 | insecureEdgeTerminationPolicy: Redirect 13 | termination: edge 14 | to: 15 | kind: Service 16 | name: bgd 17 | weight: 100 18 | -------------------------------------------------------------------------------- /bootstrap/openshift-gitops-operator-sub.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: operators.coreos.com/v1alpha1 2 | kind: Subscription 3 | metadata: 4 | name: openshift-gitops-operator 5 | namespace: openshift-operators 6 | spec: 7 | channel: stable 8 | installPlanApproval: Automatic 9 | name: openshift-gitops-operator 10 | source: redhat-operators 11 | sourceNamespace: openshift-marketplace 12 | -------------------------------------------------------------------------------- /components/kustomize-build/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - ./welcome.yaml 5 | patchesJson6902: 6 | - target: 7 | version: v1 8 | group: apps 9 | kind: Deployment 10 | name: welcome-php 11 | patch: |- 12 | - op: add 13 | path: /metadata/labels/testkey 14 | value: testvalue 15 | -------------------------------------------------------------------------------- /apps/bgd/overlays/bgdk/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | namespace: bgdk 4 | resources: 5 | - ../../base 6 | - bgdk-ns.yaml 7 | patchesJson6902: 8 | - target: 9 | version: v1 10 | group: apps 11 | kind: Deployment 12 | name: bgd 13 | namespace: bgdk 14 | patch: |- 15 | - op: replace 16 | path: /spec/template/spec/containers/0/env/0/value 17 | value: yellow 18 | -------------------------------------------------------------------------------- /apps/todo/todo-service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: "v1" 3 | kind: "Service" 4 | metadata: 5 | labels: 6 | app.kubernetes.io/name: "todo-gitops" 7 | app.kubernetes.io/version: "1.0.0" 8 | name: "todo-gitops" 9 | annotations: 10 | argocd.argoproj.io/sync-wave: "2" 11 | namespace: todo 12 | spec: 13 | ports: 14 | - name: "http" 15 | port: 8080 16 | targetPort: 8080 17 | selector: 18 | app.kubernetes.io/name: "todo-gitops" 19 | app.kubernetes.io/version: "1.0.0" -------------------------------------------------------------------------------- /components/kustomize-build/welcome.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: welcome-php 6 | name: welcome-php 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: welcome-php 12 | strategy: {} 13 | template: 14 | metadata: 15 | labels: 16 | app: welcome-php 17 | spec: 18 | containers: 19 | - image: quay.io/redhatworkshops/welcome-php:latest 20 | name: welcome-php 21 | resources: {} 22 | -------------------------------------------------------------------------------- /components/applications/bgd-app.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: bgd-app 5 | namespace: openshift-gitops 6 | spec: 7 | destination: 8 | namespace: bgd 9 | server: https://kubernetes.default.svc 10 | project: default 11 | source: 12 | path: apps/bgd/overlays/bgd 13 | repoURL: https://github.com/redhat-developer-demos/openshift-gitops-examples 14 | targetRevision: main 15 | syncPolicy: 16 | automated: 17 | prune: true 18 | selfHeal: false 19 | syncOptions: 20 | - CreateNamespace=true 21 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/hooks/welcome-php-presync-job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: welcome-presyncjob 5 | annotations: 6 | argocd.argoproj.io/hook: PreSync 7 | spec: 8 | template: 9 | metadata: 10 | creationTimestamp: null 11 | spec: 12 | containers: 13 | - command: 14 | - /bin/bash 15 | - -c 16 | - | 17 | sleep 15 18 | image: registry.access.redhat.com/ubi8/ubi:latest 19 | imagePullPolicy: IfNotPresent 20 | name: welcome-sleep-job 21 | restartPolicy: Never 22 | -------------------------------------------------------------------------------- /components/applications/bgdk-app.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: bgdk-app 5 | namespace: openshift-gitops 6 | spec: 7 | destination: 8 | namespace: bgdk 9 | server: https://kubernetes.default.svc 10 | project: default 11 | source: 12 | path: apps/bgd/overlays/bgdk 13 | repoURL: https://github.com/redhat-developer-demos/openshift-gitops-examples 14 | targetRevision: main 15 | syncPolicy: 16 | automated: 17 | prune: true 18 | selfHeal: false 19 | syncOptions: 20 | - CreateNamespace=true 21 | -------------------------------------------------------------------------------- /apps/bgd/base/bgd-deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | labels: 6 | app: bgd 7 | name: bgd 8 | namespace: bgd 9 | spec: 10 | replicas: 1 11 | selector: 12 | matchLabels: 13 | app: bgd 14 | strategy: {} 15 | template: 16 | metadata: 17 | creationTimestamp: null 18 | labels: 19 | app: bgd 20 | spec: 21 | containers: 22 | - image: quay.io/rhdevelopers/bgd:1.0.0 23 | name: bgd 24 | env: 25 | - name: COLOR 26 | value: "blue" 27 | resources: {} 28 | --- 29 | -------------------------------------------------------------------------------- /apps/bgd/overlays/bgd/bgd-deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | labels: 6 | app: bgd 7 | name: bgd 8 | namespace: bgd 9 | spec: 10 | replicas: 1 11 | selector: 12 | matchLabels: 13 | app: bgd 14 | strategy: {} 15 | template: 16 | metadata: 17 | creationTimestamp: null 18 | labels: 19 | app: bgd 20 | spec: 21 | containers: 22 | - image: quay.io/rhdevelopers/bgd:1.0.0 23 | name: bgd 24 | env: 25 | - name: COLOR 26 | value: "blue" 27 | resources: {} 28 | --- 29 | -------------------------------------------------------------------------------- /components/applications/quarkus-subchart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: quarkus-subchart 5 | namespace: openshift-gitops 6 | spec: 7 | destination: 8 | namespace: demo 9 | server: https://kubernetes.default.svc 10 | project: default 11 | source: 12 | path: apps/quarkus-subchart/ 13 | repoURL: https://github.com/redhat-developer-demos/openshift-gitops-examples 14 | targetRevision: main 15 | syncPolicy: 16 | automated: 17 | prune: true 18 | selfHeal: true 19 | syncOptions: 20 | - CreateNamespace=true 21 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/syncwaves-and-hooks/welcome-php-postsync-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: welcome-postsync-pod 5 | annotations: 6 | argocd.argoproj.io/hook: PostSync 7 | argocd.argoproj.io/hook-delete-policy: HookSucceeded 8 | spec: 9 | containers: 10 | - command: 11 | - /bin/bash 12 | - -c 13 | - | 14 | echo "Post deployment work" 15 | sleep 10 16 | image: registry.access.redhat.com/ubi8/ubi:latest 17 | imagePullPolicy: IfNotPresent 18 | name: welcome-sleep-pod 19 | dnsPolicy: ClusterFirst 20 | restartPolicy: Never 21 | -------------------------------------------------------------------------------- /apps/welcome-php/base/welcome-php-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | annotations: 5 | argocd.argoproj.io/sync-wave: "1" 6 | labels: 7 | app: welcome-php 8 | name: welcome-php 9 | spec: 10 | replicas: 1 11 | selector: 12 | matchLabels: 13 | app: welcome-php 14 | strategy: {} 15 | template: 16 | metadata: 17 | creationTimestamp: null 18 | labels: 19 | app: welcome-php 20 | spec: 21 | containers: 22 | - image: quay.io/redhatworkshops/welcome-php:latest 23 | name: welcome-php 24 | resources: {} 25 | -------------------------------------------------------------------------------- /components/applications/welcome-hooks.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: welcome-hooks 5 | namespace: openshift-gitops 6 | spec: 7 | destination: 8 | namespace: welcome-hooks 9 | server: https://kubernetes.default.svc 10 | project: default 11 | source: 12 | path: apps/welcome-php/overlays/hooks 13 | repoURL: https://github.com/redhat-developer-demos/openshift-gitops-examples 14 | targetRevision: main 15 | syncPolicy: 16 | automated: 17 | prune: true 18 | selfHeal: false 19 | syncOptions: 20 | - CreateNamespace=true 21 | -------------------------------------------------------------------------------- /components/applications/welcome-syncwaves.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: welcome-syncwaves 5 | namespace: openshift-gitops 6 | spec: 7 | destination: 8 | namespace: welcome 9 | server: https://kubernetes.default.svc 10 | project: default 11 | source: 12 | path: apps/welcome-php/overlays/syncwaves 13 | repoURL: https://github.com/redhat-developer-demos/openshift-gitops-examples 14 | targetRevision: main 15 | syncPolicy: 16 | automated: 17 | prune: true 18 | selfHeal: false 19 | syncOptions: 20 | - CreateNamespace=true 21 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/syncwaves-and-hooks/welcome-php-presync-job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: welcome-presyncjob 5 | annotations: 6 | argocd.argoproj.io/hook: PreSync 7 | argocd.argoproj.io/sync-wave: "0" 8 | spec: 9 | template: 10 | metadata: 11 | creationTimestamp: null 12 | spec: 13 | containers: 14 | - command: 15 | - /bin/bash 16 | - -c 17 | - | 18 | sleep 15 19 | image: registry.access.redhat.com/ubi8/ubi:latest 20 | imagePullPolicy: IfNotPresent 21 | name: welcome-sleep-job 22 | restartPolicy: Never 23 | -------------------------------------------------------------------------------- /apps/welcome-php/overlays/syncwaves-and-hooks/welcome-php-presync-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: welcome-presync-pod 5 | annotations: 6 | argocd.argoproj.io/hook: PreSync 7 | argocd.argoproj.io/hook-delete-policy: HookSucceeded 8 | argocd.argoproj.io/sync-wave: "1" 9 | spec: 10 | containers: 11 | - command: 12 | - /bin/bash 13 | - -c 14 | - | 15 | echo "Pre deployment tasks" 16 | sleep 10 17 | image: registry.access.redhat.com/ubi8/ubi:latest 18 | imagePullPolicy: IfNotPresent 19 | name: welcome-sleep-pod 20 | dnsPolicy: ClusterFirst 21 | restartPolicy: Never 22 | -------------------------------------------------------------------------------- /components/applications/welcome-syncwaves-and-hooks.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: welcome-syncwaves-hooks 5 | namespace: openshift-gitops 6 | spec: 7 | destination: 8 | namespace: welcome-waves-and-hooks 9 | server: https://kubernetes.default.svc 10 | project: default 11 | source: 12 | path: apps/welcome-php/overlays/syncwaves-and-hooks 13 | repoURL: https://github.com/redhat-developer-demos/openshift-gitops-examples 14 | targetRevision: main 15 | syncPolicy: 16 | automated: 17 | prune: true 18 | selfHeal: false 19 | syncOptions: 20 | - CreateNamespace=true 21 | -------------------------------------------------------------------------------- /apps/todo/todo-insert-data.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: todo-insert 5 | annotations: 6 | argocd.argoproj.io/hook: PostSync # <1> 7 | argocd.argoproj.io/hook-delete-policy: HookSucceeded 8 | spec: 9 | ttlSecondsAfterFinished: 100 10 | template: 11 | spec: 12 | containers: 13 | - name: httpie 14 | image: alpine/httpie:2.4.0 15 | imagePullPolicy: Always 16 | command: ["http"] 17 | args: 18 | [ 19 | "POST", 20 | "todo-gitops:8080/api", 21 | "title=Finish ArgoCD tutorial", 22 | "--ignore-stdin" 23 | ] 24 | restartPolicy: Never 25 | backoffLimit: 1 -------------------------------------------------------------------------------- /apps/todo/postgres-create-table.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: todo-table 5 | namespace: todo 6 | annotations: 7 | argocd.argoproj.io/sync-wave: "1" 8 | spec: 9 | template: 10 | spec: 11 | containers: 12 | - name: postgresql-client 13 | image: postgres:12 14 | imagePullPolicy: Always 15 | env: 16 | - name: PGPASSWORD 17 | value: admin 18 | command: ["psql"] 19 | args: 20 | [ 21 | "--host=postgresql", 22 | "--username=admin", 23 | "--no-password", 24 | "--dbname=todo", 25 | "--command=create table Todo (id bigint not null,completed boolean not null,ordering integer,title varchar(255),url varchar(255),primary key (id));create sequence hibernate_sequence start with 1 increment by 1;", 26 | ] 27 | restartPolicy: Never 28 | backoffLimit: 1 -------------------------------------------------------------------------------- /components/applications/quarkus-app.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: demo 6 | labels: 7 | argocd.argoproj.io/managed-by: openshift-gitops 8 | --- 9 | apiVersion: argoproj.io/v1alpha1 10 | kind: Application 11 | metadata: 12 | name: quarkus-app 13 | namespace: openshift-gitops 14 | spec: 15 | destination: 16 | namespace: demo 17 | server: https://kubernetes.default.svc 18 | project: default 19 | source: 20 | helm: 21 | parameters: 22 | - name: build.enabled 23 | value: "false" 24 | - name: deploy.route.tls.enabled 25 | value: "true" 26 | - name: image.name 27 | value: quay.io/ablock/gitops-helm-quarkus 28 | chart: quarkus 29 | repoURL: https://redhat-developer.github.io/redhat-helm-charts 30 | targetRevision: 0.0.3 31 | syncPolicy: 32 | automated: 33 | prune: true 34 | selfHeal: true 35 | syncOptions: 36 | - CreateNamespace=true 37 | -------------------------------------------------------------------------------- /apps/todo/postgres-deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: postgresql 6 | namespace: todo 7 | annotations: 8 | argocd.argoproj.io/sync-wave: "0" 9 | spec: 10 | selector: 11 | matchLabels: 12 | app: postgresql 13 | template: 14 | metadata: 15 | labels: 16 | app: postgresql 17 | spec: 18 | containers: 19 | - name: postgresql 20 | image: quay.io/redhatdemo/openshift-pgsql12-primary:centos7 21 | imagePullPolicy: Always 22 | ports: 23 | - name: tcp 24 | containerPort: 5432 25 | env: 26 | - name: PG_USER_PASSWORD 27 | valueFrom: 28 | secretKeyRef: 29 | name: postgresql-secret 30 | key: password 31 | - name: PG_USER_NAME 32 | valueFrom: 33 | secretKeyRef: 34 | name: postgresql-secret 35 | key: username 36 | - name: PG_DATABASE 37 | value: todo 38 | - name: PG_NETWORK_MASK 39 | value: all 40 | 41 | -------------------------------------------------------------------------------- /apps/todo/todo-deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: "v1" 3 | kind: "ServiceAccount" 4 | metadata: 5 | labels: 6 | app.kubernetes.io/name: "todo-gitops" 7 | app.kubernetes.io/version: "1.0.0" 8 | name: "todo-gitops" 9 | namespace: todo 10 | annotations: 11 | argocd.argoproj.io/sync-wave: "2" 12 | --- 13 | apiVersion: "apps/v1" 14 | kind: "Deployment" 15 | metadata: 16 | labels: 17 | app.kubernetes.io/name: "todo-gitops" 18 | app.kubernetes.io/version: "1.0.0" 19 | name: "todo-gitops" 20 | namespace: todo 21 | annotations: 22 | argocd.argoproj.io/sync-wave: "2" 23 | spec: 24 | replicas: 1 25 | selector: 26 | matchLabels: 27 | app.kubernetes.io/name: "todo-gitops" 28 | app.kubernetes.io/version: "1.0.0" 29 | template: 30 | metadata: 31 | labels: 32 | app.kubernetes.io/name: "todo-gitops" 33 | app.kubernetes.io/version: "1.0.0" 34 | spec: 35 | containers: 36 | - env: 37 | - name: "KUBERNETES_NAMESPACE" 38 | valueFrom: 39 | fieldRef: 40 | fieldPath: "metadata.namespace" 41 | image: "quay.io/rhdevelopers/todo-gitops:1.0.0" 42 | imagePullPolicy: "Always" 43 | name: "todo-gitops" 44 | ports: 45 | - containerPort: 8080 46 | name: "http" 47 | protocol: "TCP" 48 | serviceAccount: "todo-gitops" --------------------------------------------------------------------------------