Skip to content

Statefulset support. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
113 changes: 77 additions & 36 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
name = "github.com/golang/glog"

[[constraint]]
branch = "master"
name = "k8s.io/api"
branch = "release-1.11"

[[constraint]]
name = "k8s.io/client-go"
version = "7.0.0"
branch = "release-8.0"

[[constraint]]
name = "k8s.io/apimachinery"
branch = "release-1.10"
branch = "release-1.11"

[prune]
go-tests = true
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,17 @@ the value of the *'foo'* key and save, you should see that a new rollout is trig

## How it works

When the controller observe Deployment with `trigger.k8s.io/triggering-secrets` annotation, it will automatically
calculate hash of the Secret 'data' field and store it inside the Secret `trigger.k8s.io/data-hash` annotation.
When the controller observes a Deployment or StatefulSet with the `trigger.k8s.io/triggering-secrets` annotation, it will automatically calculate hash of the Secret 'data' field and store it inside the Secret `trigger.k8s.io/data-hash` annotation. It will behave similarly for configMaps via the `trigger.k8s.io/triggering-configMaps` annotation.

The it look up the Deployment and check if the ReplicaSet template embedded inside Deployment contain
Then it looks up the Deployment and checks if the ReplicaSet template embedded inside Deployment contain
the `trigger.k8s.io/[secret|configMap]-NAME-last-hash` annotation. This annotation value represents the last
observed hash. If the hash differs or the annotation is not present, the controller update the template
with the current Secret or ConfigMap hash. Updating the Deployment template will cause the Deployment to
rollout new version.
with the current Secret or ConfigMap hash. Updating the template will cause the the Deployment or StatefulSet to
rollout new version as per it's RollingUpdate configuration.

## Limitations && TODO

* Currently only Deployments are supported, StatefulSets and DaemonSets is TBD
* Currently only Deployments and StatefulSets are supported, DaemonSets are TBD
* If secrets or configMaps are updated in bulk, the controller might trigger rollout for every update (you should pause the Deployment in that case)
* The hash calculation should be more efficient
* Versioning of ConfigMaps and Secrets is out of scope for this controller
Expand Down
Loading