Faizan AhmadandRasheed Amir 003eaee887 [STK-322] Add reloader vs k8s-trigger-controller doc (#13)
* Add reloader vs k8s-trigger-controller doc

* Fix kubectl command in readme
2018-08-01 11:41:45 +02:00
2018-07-17 09:15:03 +00:00
2018-07-13 16:46:35 +05:00
2018-07-31 09:57:23 +00:00
2018-07-24 21:17:56 +05:00
2018-07-17 12:55:56 +05:00
2018-07-13 14:55:02 +05:00
2018-07-26 20:23:20 +05:00
2018-08-01 11:41:26 +02:00

RELOADER

Problem

We would like to watch if some change happens in ConfigMap and Secret objects and then perform rolling upgrade on relevant Deployment, Deamonset and Statefulset

Solution

Reloader can watch changes in ConfigMap and Secret and do rolling upgrades on Pods with their associated Deployments, Deamonsets and Statefulsets.

NOTE: This controller has been inspired from configmapController

How to use Reloader

For a Deployment called foo have a ConfigMap called foo. Then add this annotation to your Deployment

metadata:
  annotations:
    configmap.reloader.stakater.com/reload: "foo"

OR

For a Deployment called foo have a Secret called foo. Then add this annotation to your Deployment

metadata:
  annotations:
    secret.reloader.stakater.com/reload: "foo"

How Reloader works

Then, providing Reloader is running, whenever you edit the ConfigMap or Secret called foo the Reloader will update the Deployment by adding the environment variable:

STAKATER_FOO_CONFIGMAP=${reloaderRevisionHash}

Or if the change is detected in secret

STAKATER_FOO_SECRET=${reloaderRevisionHash}

reloaderRevisionHash is the change in secret or configmap that is converted into SHA1. This value gets updated every time when reloader detects any change.

This then triggers a rolling upgrade of your deployment's pods to use the new configuration.

Same procedure can be followed to perform rolling upgrade on Deamonsets and Statefulsets as well.

Please refer to this document for detailed working of reloader.

Deploying to Kubernetes

You can deploy Reloader by following methods:

Vanilla Manifests

You can apply vanilla manifests by running the following command

kubectl apply -f https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloader.yaml

Helm Charts

Alternatively if you have configured helm on your cluster, you can add reloader to helm from our public chart repository and deploy it via helm using below mentioned commands

helm repo add stakater https://stakater.github.io/stakater-charts

helm repo update

helm install stakater/reloader

Monitor All namespaces

By default Reloader gets deployed in default namespace and watches changes secrets and configmaps in all namespaces.

Help

Got a question? File a GitHub issue, or send us an email.

Talk to us on Slack

Join and talk to us on the #tools-imc channel for discussing Reloader

Join Slack Chat

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Developing

PRs are welcome. In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Changelog

View our closed Pull Requests.

License

Apache2 © Stakater

About

Reloader is maintained by Stakater. Like it? Please let us know at hello@stakater.com

See our other projects or contact us in case of professional services and queries on hello@stakater.com

S
Description
A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!
Readme Apache-2.0
31 MiB
Languages
Go 95%
Shell 2.9%
Go Template 1.2%
Makefile 0.8%
Dockerfile 0.1%