-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Implement restarter.stackable.tech/ignore label #410
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
base: main
Are you sure you want to change the base?
Changes from all commits
bc0e239
dc5a83e
87a00e0
42e15d4
4ec9e81
7d3005f
faf1a73
26e336b
6432058
c1a4906
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ resolver = "2" | |
| version = "0.0.0-dev" | ||
| authors = ["Stackable GmbH <info@stackable.tech>"] | ||
| license = "OSL-3.0" | ||
| edition = "2021" | ||
| edition = "2024" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have preferred a separate PR (as part of stackabletech/issues#832), but I followed https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html and ended up with nearly the same changes, so LGTM |
||
| repository = "https://github.com/stackabletech/commons-operator" | ||
|
|
||
| [workspace.dependencies] | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,3 +30,61 @@ Label:: `restarter.stackable.tech/enabled` | |||||
|
|
||||||
| The operator can restart StatefulSets when any referenced configuration object (ConfigMap or Secret) changes. | ||||||
| To enable this, set the `restarter.stackable.tech/enabled` label on the StatefulSet to `true`. | ||||||
|
|
||||||
| Annotation:: `restarter.stackable.tech/ignore-configmap.*` | ||||||
| Annotation:: `restarter.stackable.tech/ignore-secret.*` | ||||||
|
|
||||||
| These annotations can be added if the restarter is enabled on a StatefulSet, but some ConfigMaps or Secrets should be excluded from triggering a restart. `*` can be replaced with any value and is only used to make the annotation key unique. | ||||||
|
|
||||||
| [source,yaml] | ||||||
| ---- | ||||||
| --- | ||||||
| apiVersion: apps/v1 | ||||||
| kind: StatefulSet | ||||||
| metadata: | ||||||
| name: statefulset-with-enabled-restarter | ||||||
| labels: | ||||||
| restarter.stackable.tech/enabled: "true" | ||||||
| annotations: | ||||||
| restarter.stackable.tech/ignore-configmap.0: hot-reloaded-configmap | ||||||
| restarter.stackable.tech/ignore-secret.0: hot-reloaded-secret | ||||||
| spec: | ||||||
| template: | ||||||
| spec: | ||||||
| volumes: | ||||||
| - name: configuration | ||||||
| configMap: | ||||||
| name: hot-reloaded-configmap | ||||||
| - name: credentials | ||||||
| secret: | ||||||
| secretName: hot-reloaded-secret | ||||||
| ... | ||||||
| ---- | ||||||
|
|
||||||
| == ConfigMap/Secret | ||||||
|
|
||||||
| Label:: `restarter.stackable.tech/ignore` | ||||||
|
|
||||||
| If a ConfigMap or Secret is only used for initializing a StatefulSet or contains data which can be hot-reloaded, add the label `restarter.stackable.tech/ignore: "true"` to avoid unnecessary restarts of the StatefulSet pods: | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| [source,yaml] | ||||||
| ---- | ||||||
| --- | ||||||
| apiVersion: v1 | ||||||
| kind: ConfigMap | ||||||
| metadata: | ||||||
| name: hot-reloaded-configmap | ||||||
| labels: | ||||||
| restarter.stackable.tech/ignore: "true" | ||||||
| ... | ||||||
| --- | ||||||
| apiVersion: v1 | ||||||
| kind: Secret | ||||||
| metadata: | ||||||
| name: hot-reloaded-secret | ||||||
| labels: | ||||||
| restarter.stackable.tech/ignore: "true" | ||||||
| ... | ||||||
| ---- | ||||||
|
|
||||||
| Unlike the StatefulSet annotations `restarter.stackable.tech/ignore-configmap.\*` and `restarter.stackable.tech/ignore-secret.*`, this label affects every StatefulSet that references the labeled ConfigMaps or Secrets. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.