GitOps: Example of a GitOps workflow using Argo CD
Argo CD: Configuration Management using Helm
Argo CD supports a number of Kubernetes configuration management tools, and one of the most popular is Helm. If you have multiple environments, complex applications, dependent services, or just want to abstract away your Kubernetes manifests, Helm is a great choice.
Alternatives to Helm include Ksonnet and Kustomize. The first is deprecated, and the second is natively supported by kubectl and also supported by Argo CD; Kustomize is the recommended alternative to Helm.
You can also write your own configuration management plugin and use it as part of your workflow.
Back to Helm. This tool uses charts to define the structure of the application. A chart is a collection of files that describe a related set of Kubernetes resources. Our goal here is not to fully teach Helm but rather to show how to use it with Argo CD.
We already have a subfolder in the same GitHub repository that contains a Helm chart ready to use. Here is how to deploy it using an Application.
kubectl apply -f - <
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: flask-app
namespace: argocd
spec:
destination:
namespace: flask-app
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/eon01/argocd-examples
targetRevision: main
path: flask-app-helm
helm:
valueFiles:
- values.yaml
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: true
EOF
We will see how the Helm chart is structured later in this guide, but for now, our focus is on the values.yaml file, which is used to define the default values for our application.
Here is its content:
replicaCount: 3
image:
repository: eon01/stateless-flask
tag: v0
service:
type:Cloud-Native Microservices With Kubernetes - 2nd Edition
A Comprehensive Guide to Building, Scaling, Deploying, Observing, and Managing Highly-Available Microservices in KubernetesEnroll now to unlock all content and receive all future updates for free.
