Skip to content

Instantly share code, notes, and snippets.

@ahmadiq
Created October 3, 2018 18:37
Show Gist options
  • Save ahmadiq/e0a483578768390246ff18440620ad0d to your computer and use it in GitHub Desktop.
Save ahmadiq/e0a483578768390246ff18440620ad0d to your computer and use it in GitHub Desktop.
ConfigMapController Stakater Reloader k8s-trigger-controller
Triggering resource Only supports watching ConfigMaps Can watch both ConfigMaps as well as Secrets for changes in configuration that may need to trigger a pod update Supports change detection in both ConfigMaps and Secrets
Updateable resource Only supports updating Deployments Supports updating Deployments, as well as StatefulSets and DaemonSets k8s-trigger-controller only supports updates to Deployments. It does not support DaemonSets or StatefulSets.
Change detection Configmap controller uses FABRICB_FOO_REVISION environment variable to store any change in configmap controller. It does not encode it or convert it in suitable hash value which can lead to data pollution in the Deployment uses SHA1 to encode the changes in ConfigMap or Secret. It then saves the SHA1 value in STAKATER_FOO_CONFIGMAP or STAKATER_FOO_SECRET environment variable depending upon where the change has happened. The use of SHA1 provides a concise 40 characters encoded value that is not prone to collision. k8s-trigger-controller stores the SHA-1 hash value in an annotation `trigger.k8s.io/[secret|configMap]-NAME-last-hash`. The hash value is added within the name of the annotation which makes it cumbersome to read.
Code stability Currently there are no unit test cases or end to end integration test cases. This can add difficulties for any additional updates in ConfigMapController or testing compatibility against future versions of Kubernetes. Reloader codebase has both unit test cases and end to end integration test cases. This is a huge advantage when extending or customizing the controller. One can make sure that new changes do not break any old functionality. Has end to end as well as unit test cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment