├── portal ├── values-production.yaml ├── .helmignore ├── templates │ ├── service.yaml │ ├── _helpers.tpl │ └── deployment.yaml ├── Chart.yaml └── values.yaml ├── guestbook ├── values-production.yaml ├── .helmignore ├── templates │ ├── service.yaml │ ├── _helpers.tpl │ └── deployment.yaml ├── Chart.yaml └── values.yaml ├── app-of-apps.yaml ├── README.md └── apps ├── portal.yaml └── guestbook.yaml /portal/values-production.yaml: -------------------------------------------------------------------------------- 1 | service: 2 | type: LoadBalancer 3 | -------------------------------------------------------------------------------- /guestbook/values-production.yaml: -------------------------------------------------------------------------------- 1 | service: 2 | type: LoadBalancer 3 | -------------------------------------------------------------------------------- /app-of-apps.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: applications 5 | namespace: argocd 6 | spec: 7 | destination: 8 | name: in-cluster 9 | project: default 10 | source: 11 | path: apps 12 | repoURL: https://github.com/shell/intro-argo-cd-tutorial # Update to your repo URL. 13 | targetRevision: HEAD -------------------------------------------------------------------------------- /portal/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /guestbook/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction to Argo CD Template 2 | 3 | These are the supporting files for [the Introduction to Argo CD tutorial](https://docs.akuity.io/tutorials/introduction-to-argo-cd) in the Akuity docs. 4 | 5 | This tutorial will walk you through implementing Argo CD with the Akuity Platform, to manage the deployment of the Helm charts in a declarative fashion. 6 | 7 | Ultimately, you will have a Kubernetes cluster, with Applications deployed using an Argo CD control plane. 8 | -------------------------------------------------------------------------------- /apps/portal.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: portal 5 | namespace: argocd 6 | spec: 7 | project: default 8 | source: 9 | repoURL: 'https://github.com/shell/intro-argo-cd-tutorial' # Update to match your fork. 10 | path: portal 11 | targetRevision: HEAD 12 | destination: 13 | namespace: portal 14 | name: stage # Update this value. 15 | syncPolicy: 16 | syncOptions: 17 | - CreateNamespace=true 18 | -------------------------------------------------------------------------------- /apps/guestbook.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: guestbook 5 | namespace: argocd 6 | spec: 7 | project: default 8 | source: 9 | repoURL: 'https://github.com/shell/intro-argo-cd-tutorial' # Update to match your fork. 10 | path: guestbook 11 | targetRevision: HEAD 12 | destination: 13 | namespace: guestbook 14 | name: stage # Update this value. 15 | syncPolicy: 16 | syncOptions: 17 | - CreateNamespace=true -------------------------------------------------------------------------------- /portal/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "portal.fullname" . }} 5 | labels: 6 | app.kubernetes.io/name: {{ template "portal.name" . }} 7 | helm.sh/chart: {{ template "portal.chart" . }} 8 | spec: 9 | type: {{ .Values.service.type }} 10 | ports: 11 | - port: {{ .Values.service.port }} 12 | targetPort: http 13 | protocol: TCP 14 | name: http 15 | selector: 16 | app: {{ template "portal.name" . }} 17 | release: {{ .Release.Name }} 18 | -------------------------------------------------------------------------------- /guestbook/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "guestbook.fullname" . }} 5 | labels: 6 | app.kubernetes.io/name: {{ template "guestbook.name" . }} 7 | helm.sh/chart: {{ template "guestbook.chart" . }} 8 | spec: 9 | type: {{ .Values.service.type }} 10 | ports: 11 | - port: {{ .Values.service.port }} 12 | targetPort: http 13 | protocol: TCP 14 | name: http 15 | selector: 16 | app: {{ template "guestbook.name" . }} 17 | release: {{ .Release.Name }} 18 | -------------------------------------------------------------------------------- /portal/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "portal.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "portal.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "portal.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | -------------------------------------------------------------------------------- /portal/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: portal 3 | description: A Helm chart for the portal application 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: "1.0" 24 | -------------------------------------------------------------------------------- /guestbook/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "guestbook.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "guestbook.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "guestbook.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | -------------------------------------------------------------------------------- /guestbook/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: guestbook 3 | description: A Helm chart for the guestbook application 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: "1.0" 24 | -------------------------------------------------------------------------------- /portal/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for portal. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | image: 8 | repository: quay.io/akuity/argo-cd-learning-assets/guestbook 9 | tag: 0.1.0 10 | pullPolicy: IfNotPresent 11 | 12 | service: 13 | type: ClusterIP 14 | port: 80 15 | 16 | ingress: 17 | enabled: false 18 | annotations: {} 19 | # kubernetes.io/ingress.class: nginx 20 | # kubernetes.io/tls-acme: "true" 21 | path: / 22 | hosts: 23 | - chart-example.local 24 | tls: [] 25 | # - secretName: chart-example-tls 26 | # hosts: 27 | # - chart-example.local 28 | 29 | resources: {} 30 | # We usually recommend not to specify default resources and to leave this as a conscious 31 | # choice for the user. This also increases chances charts run on environments with little 32 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 33 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 34 | # limits: 35 | # cpu: 100m 36 | # memory: 128Mi 37 | # requests: 38 | # cpu: 100m 39 | # memory: 128Mi 40 | 41 | nodeSelector: {} 42 | 43 | tolerations: [] 44 | 45 | affinity: {} 46 | -------------------------------------------------------------------------------- /guestbook/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for guestbook. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 2 6 | 7 | image: 8 | repository: quay.io/akuity/argo-cd-learning-assets/guestbook 9 | tag: 0.2.0 10 | pullPolicy: IfNotPresent 11 | 12 | service: 13 | type: ClusterIP 14 | port: 80 15 | 16 | ingress: 17 | enabled: false 18 | annotations: {} 19 | # kubernetes.io/ingress.class: nginx 20 | # kubernetes.io/tls-acme: "true" 21 | path: / 22 | hosts: 23 | - chart-example.local 24 | tls: [] 25 | # - secretName: chart-example-tls 26 | # hosts: 27 | # - chart-example.local 28 | 29 | resources: {} 30 | # We usually recommend not to specify default resources and to leave this as a conscious 31 | # choice for the user. This also increases chances charts run on environments with little 32 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 33 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 34 | # limits: 35 | # cpu: 100m 36 | # memory: 128Mi 37 | # requests: 38 | # cpu: 100m 39 | # memory: 128Mi 40 | 41 | nodeSelector: {} 42 | 43 | tolerations: [] 44 | 45 | affinity: {} 46 | -------------------------------------------------------------------------------- /portal/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "portal.fullname" . }} 5 | labels: 6 | app.kubernetes.io/name: {{ template "portal.name" . }} 7 | helm.sh/chart: {{ template "portal.chart" . }} 8 | spec: 9 | replicas: {{ .Values.replicaCount }} 10 | revisionHistoryLimit: 3 11 | selector: 12 | matchLabels: 13 | app: {{ template "portal.name" . }} 14 | release: {{ .Release.Name }} 15 | template: 16 | metadata: 17 | labels: 18 | app: {{ template "portal.name" . }} 19 | release: {{ .Release.Name }} 20 | spec: 21 | containers: 22 | - name: {{ .Chart.Name }} 23 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 24 | imagePullPolicy: {{ .Values.image.pullPolicy }} 25 | ports: 26 | - name: http 27 | containerPort: 80 28 | protocol: TCP 29 | livenessProbe: 30 | httpGet: 31 | path: / 32 | port: http 33 | readinessProbe: 34 | httpGet: 35 | path: / 36 | port: http 37 | resources: 38 | {{ toYaml .Values.resources | indent 12 }} 39 | {{- with .Values.nodeSelector }} 40 | nodeSelector: 41 | {{ toYaml . | indent 8 }} 42 | {{- end }} 43 | {{- with .Values.affinity }} 44 | affinity: 45 | {{ toYaml . | indent 8 }} 46 | {{- end }} 47 | {{- with .Values.tolerations }} 48 | tolerations: 49 | {{ toYaml . | indent 8 }} 50 | {{- end }} 51 | -------------------------------------------------------------------------------- /guestbook/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "guestbook.fullname" . }} 5 | labels: 6 | app.kubernetes.io/name: {{ template "guestbook.name" . }} 7 | helm.sh/chart: {{ template "guestbook.chart" . }} 8 | spec: 9 | replicas: {{ .Values.replicaCount }} 10 | revisionHistoryLimit: 3 11 | selector: 12 | matchLabels: 13 | app: {{ template "guestbook.name" . }} 14 | release: {{ .Release.Name }} 15 | template: 16 | metadata: 17 | labels: 18 | app: {{ template "guestbook.name" . }} 19 | release: {{ .Release.Name }} 20 | spec: 21 | containers: 22 | - name: {{ .Chart.Name }} 23 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 24 | imagePullPolicy: {{ .Values.image.pullPolicy }} 25 | ports: 26 | - name: http 27 | containerPort: 80 28 | protocol: TCP 29 | livenessProbe: 30 | httpGet: 31 | path: / 32 | port: http 33 | readinessProbe: 34 | httpGet: 35 | path: / 36 | port: http 37 | resources: 38 | {{ toYaml .Values.resources | indent 12 }} 39 | {{- with .Values.nodeSelector }} 40 | nodeSelector: 41 | {{ toYaml . | indent 8 }} 42 | {{- end }} 43 | {{- with .Values.affinity }} 44 | affinity: 45 | {{ toYaml . | indent 8 }} 46 | {{- end }} 47 | {{- with .Values.tolerations }} 48 | tolerations: 49 | {{ toYaml . | indent 8 }} 50 | {{- end }} 51 | --------------------------------------------------------------------------------