This is a toy controller built by kubebuilder that watches a k8s resource managed by Helm. The controller will keep track of the helm application version after it locates the resource.
It only supports deployment type of resource for now.
git clone [email protected]:ryanzhang-oss/deployment-watcher.git
- Install deployment based workloadDefinition
make install
make run
- Create a Ryan object, here is an example
apiVersion: practice.shipa.io/v1alpha1
kind: Ryan
metadata:
name: helm-watcher
spec:
ResourceName: ryan-test
- Install an application through helm
helm repo add podinfo https://stefanprodan.github.io/podinfo
helm repo update
helm upgrade --install helmapp podinfo/podinfo --version 5.0.0 --wait
- Apply the watcher object
kubectl apply -f doc/examples/podinfo.yaml
- Watch the watcher object
kubectl get Ryan --watch
NAME APPVERSION
helm-watcher 5.0.0
helm-watcher 5.0.3
helm-watcher 5.1.1
- Upgrade an application through helm
helm upgrade --install helmapp podinfo/podinfo --version 5.0.3 --wait
helm upgrade --install helmapp podinfo/podinfo --version 5.1.1 --wait