This is to test the PR ApplicationSet Generator.
You need a Kubernetes cluster. Kind is the easiest to test this.
kind create cluster
Deploy argocd with ApplicationSets addon.
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/applicationset/stable/manifests/install.yaml
To access the Argo CD UI, first get the Admin password:
kubectl get secret/argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d ; echo
In another window, do some port forwarding
kubectl -n argocd port-forward service/argocd-server 8080:443
Now you can visit the UI at http://localhost:8080
Deploy the Application
kubectl apply -f https://raw.githubusercontent.com/christianh814/bgd/main/manifests/applications/bgd-app.yaml
Verify
$ kubectl get apps -n argocd
NAME SYNC STATUS HEALTH STATUS
bgd Synced Healthy
Deploy the ApplicationSet
kubectl apply -f https://raw.githubusercontent.com/christianh814/bgd/main/manifests/applicationsets/bgd-pr-appset.yaml
Verify that
$ kubectl get appsets -n argocd
NAME AGE
bgd-pr-testing 51s
This should create an Application for every PR listed
here that has the preview
label.
$ kubectl get apps -n argocd
NAME SYNC STATUS HEALTH STATUS
bgd Synced Healthy
bgd-green-3 Synced Healthy
Note that out of the 2 PRs, only the one with the preview
label is deployed.