Skip to content

alvarof2/argocd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArgoCD poc

Deploy ArgoCD as a Github App.

Requirements:

  • Kind
  • Helm
  • ArgoCD registered as a Github App with its own key installed in the repo (fill out configs.credentialTemplates.github-app-creds: in argocd/argocd/values.yaml)
    • Github Settings -> Developer settings -> GitHub Apps: Create new App and get private key.
    • Github Settings -> Applications: Configure read access to the repo.

Create Kind cluster

kind create cluster --config=./kind/cluster.yaml

Install ArgoCD

helm repo add argo https://argoproj.github.io/argo-helm && helm repo update

kubectl create ns argocd && helm upgrade --install -n argocd argocd argo/argo-cd --version 5.17.1 --values argocd/values.yaml 

Access ArgoCD through localhost:8080 (admin/argocd):

kubectl port-forward -n argocd svc/argocd-server 8080:80

Change ArgoCD admin pass

Generate password:

 # If Linux:
 # sudo apt-get install apache2-utils
 ARGO_PWD=argocd
 htpasswd -nbBC 10 "" $ARGO_PWD | tr -d ':\n' | sed 's/$2y/$2a/'

Change the value of configs.secret.argocdServerAdminPassword: in argocd/argocd/values.yaml with this password.

Deploy ArgoCD Applications

# Deploy manifests from master branch in this repo in argocd/argocd/argo-apps/nginx-vanilla/ path.
# Update argocd/argo-apps/nginx-vanilla.yaml spec.source to read from other repo/branch/path (will require installing ArgoCD as github app if you change the repo)
kubectl apply -f argocd/argo-apps/nginx-vanilla.yaml

# Deploy Bitnami's Nginx Helm chart
kubectl apply -f argocd/argo-apps/standalone-nginx-bitnami-helm.yaml

# Deploy App Of Apps pattern
kubectl apply -f argocd/argo-apps/app-of-apps.yaml

App of Apps

For bootstraping: manually deploy just one app, all other are deployed automatically through GitOps:

App Of Apps pattern

Using values.yaml file or tuning a Helm chart

This is still not fully solved, but it shoul in version 2.6. The most common WA is to use a "dummy/proxy" chart that does nothing but installing the desired chart as a dependency (example in dir argocd/argo-apps/nginx-bitnami-helm-values).

Note:

  • The version: and appVersion: fields of the "dummy/proxy" chart Chart.yaml mean nothing.
    • The real chart version is dependencies[0].version
  • The values.yaml file must be indented taking into account the dependencies[].name.
    • For example if dependencies[0].name: nginx, the values.yaml file starts with nginx: as in the demo.

ArgoCD Image Updater

Install argocd-image-updater:

kubectl apply -f argocd/image-updater/argocd-image-updater.yaml

Deploy example apps:

# Declarative app
kubectl apply -f argocd/image-updater/test-image-updater-nginx.yaml
# App-of-apps deployment
kubectl apply -f argocd/image-updater/app-of-apps.yaml

The examples use alvarof2/nginx:latest image that is built and pushed from argocd/image-updater/nginx-docker folder.

Delete Kind cluster

kind delete cluster --name argocd-cluster

Extra Resources

ArgoCon22 Workshops:

Other topics

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published