This is a POC project and not ready for production use !
kube-trigger is a controller running in cluster to watches source updates(ConfigMap,Secrets) and apply some actions.
kube-trigger use a CRD
TriggerRule to define sources and actions.
TriggerRule defines that when configmap changes, trigger a rolling update for statefulset busybox.
apiVersion: app.example.com/v1alpha1 kind: TriggerRule metadata: name: example spec: actions: - updatePodTemplate: objectRef: kind: StatefulSet name: busybox namespace: kubetrigger-statefulset-1560220263 sources: - objectRef: kind: ConfigMap name: cm namespace: kubetrigger-statefulset-1560220263
Check exmaples for setting up kube-trigger in your cluster.
Kubernetes has a historical issue that people wants to automatically rollout their configmaps.
A common approach is to write your app to listening to a url or signal to reload itself. And use a sidecar watches config file changes and reload the app.
kube-trigger provide a alternative to do this without using sidecar. For apps that not support reload, kube-trigger can trigger rolling update.
More important, sources and actions in kube-trigger can be extended(eg. source can be a timer to restart pod periodly), which give a more custom ability to achieve your goals.
- support rolling update
- support webhook
- support exec
- CRD validations
- golang environment(1.12, with go mudule enabled)
- docker (used for creating container images, etc.)
- kind or minikube (optional)
operator-sdk build --verbose <ImageName> docker push <ImageName>
Running end-to-end tests on local cluster:
operator-sdk test local ./test/e2e --verbose