Skip to content

Instantly share code, notes, and snippets.

@ioggstream
Last active February 17, 2022 12:19
Show Gist options
  • Save ioggstream/dbd0850f53b9b54b56758d593308996a to your computer and use it in GitHub Desktop.
Save ioggstream/dbd0850f53b9b54b56758d593308996a to your computer and use it in GitHub Desktop.
ArgoCD in 5 minutes
# Install argocd CLI.
wget https://github.com/argoproj/argo-cd/releases/download/v2.2.5/argocd-linux-amd64 -O ~/.local/bin/argocd && chmod +x ~/.local/bin/argocd
# Run a minikube instance.
export CLUSTER_NAME="test-argocd"
minikube start --profile "${CLUSTER_NAME}"
# Deploy argocd in the `argocd` ns.
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# argocd uses CRDs
kubectl get crd -n argocd | grep argo
# applications.argoproj.io 2022-02-17T09:02:33Z
# appprojects.argoproj.io 2022-02-17T09:02:33Z
# Switch to the `argocd` ns to allow ./argocd to work
# on a given cluster
kubectl config set-context --current --namespace=argocd
./argocd cluster add "${CLUSTER_NAME}"
./argocd app create guestbook \
--repo https://github.com/ioggstream/argocd-example-apps.git \
--path guestbook \
--dest-server https://kubernetes.default.svc \
--dest-namespace default
# This will create under `argocd` ns various CRDs.
kubectl get applications.argoproj.io -n argocd
# NAME SYNC STATUS HEALTH STATUS
# guestbook Synced Healthy
# List the apps
./argocd app list
# Download the guestbook app on the argocd.
./argocd app get guestbook
# Deploy the guestbook app on the `default` ns
./argocd app sync guestbook
# NAME SYNC STATUS HEALTH STATUS
# guestbook Synced Healthy
# Check the deployment on the cluster.
kubectl get pods -n default
kubectl get pods -n default guestbook-ui
# Edit the guestbook app on the repo.
# https://github.com/ioggstream/argocd-example-apps.git
# and sync the changes to the argocd.
./argocd app sync guestbook
# Now it's healthy.
kubectl get applications.argoproj.io -n argocd
# Check the deployment on the cluster.
# Revert to the default ns.
kubectl config set-context --current --namespace=default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment