brew install kustomize
kustomize version
- Open https://github.com/gitops-workshop/my-app-deployment
- Click “Fork”.
In your terminal:
export username=... ;# your Github username in lowercase
git clone [email protected]:${username}/my-app-deployment.git
cd my-app-deployment
kustomize build base
Note: The above URL should start with "git@" and you'll need to enter your username.
mkdir -p overlays/dev
cat > overlays/dev/kustomization.yaml <<EOL
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
EOL
kustomize build overlays/dev
git add . && git commit -am "add dev overlay"
git push
cd overlays/dev
kustomize edit set nameprefix ${username}-
git diff
kustomize build
git commit -am "set name prefix"
git push
- Open https://argo-cd-kubecon.apps.argoproj.io/
- Click "Login Via Github"
- Click "New application"
Field | Value |
---|---|
Application name: | ${username} |
Project: | default |
Sync policy: | Manual |
Repository: | https://github.com/${username}/my-app-deployment |
Revision: | HEAD |
Path: | overlays/dev |
Cluster: | https://kubernetes.default.svc |
Namespace: | default |
- Click "Sync".
- Click "Synchronize" in the Sliding panel.
kustomize edit set image gitopsworkshop/my-app:v2
git diff
kustomize build
git commit -am "upgrade to version 2"
git push
- Detect git changes: "Refresh"
- Preview Differences: "App Diff"
- Deploy New Version: "Sync"
- Open app
- Find the red heart
- Clik on the resource and check each tab
- Click "History And Rollback"
- Click "..." button in the last row
- Click "Rollback"
- Click "Ok" in the modal panel
git revert $(git rev-parse HEAD)
git push