Skip to content

jizusun/bgd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Blue/Green Test App for PR ApplicationSet

This is to test the PR ApplicationSet Generator.

Prereqs

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

Testing

Deploy the Application

kubectl apply -f https://raw.githubusercontent.com/jizusun/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/jizusun/bgd/main/manifests/applicationsets/bgd-pr-appset.yaml

Verify that

$ kubectl get appsets -n argocd
NAME             AGE
bgd-pr-testing   51s

Success

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.

About

Blue/Green Test App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published