Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Support deployment annotations #684

Closed
kernkonzentrat opened this issue Jun 23, 2020 · 6 comments
Closed

Support deployment annotations #684

kernkonzentrat opened this issue Jun 23, 2020 · 6 comments

Comments

@kernkonzentrat
Copy link
Contributor

Describe the feature:
It would be very nice, if deployment annotations would be supported

Describe a specific use case for the feature:
We're using Wave to manage deployments in our k8s cluster, which will trigger a Rolling Update, if related Config Maps or Secrets are updated. Unfortunately Wave keeps track of the managed deployments by targeting a specific deployment annotation. Would be super cool, if we could open a small pull request for this behavior :)

@kernkonzentrat
Copy link
Contributor Author

Could you please give some feedback, if this is feasible or not - we have to manually restart pods in production, whenever a configuration or secret changes.

@fatmcgav
Copy link
Contributor

@kernkonzentrat so according to wave-k8s/wave#59 (comment), wave will look for the annotations on the Statefulset aswell.

So you should be able to use the existing podannotations support.

Which charts were you looking at using with wave?

@jmlrt jmlrt added the feature label Jun 29, 2020
@kernkonzentrat
Copy link
Contributor Author

kernkonzentrat commented Jul 1, 2020

@fatmcgav ...thanks for the reply. We're using metricbeat charts from v7.7.1 - I already came across pusher/wave/issues/#59 but podannotations won't work, as they only label the created pods within a deployment/ daemonset (can't find statefulset resource definition within metricbeat charts)...wave only looks at the labels of a deployment/ daemonset / statefulset to support monitoring (at least in my understanding)

@fatmcgav
Copy link
Contributor

fatmcgav commented Jul 2, 2020

@kernkonzentrat Ah, ok...

In that case, and based on the example in the Wave docs, this should be a relatively trivial addition.

Something like adding this additional block:

      annotations:
        {{- range $key, $value := .Values.deploymentAnnotations }}
        {{ $key }}: {{ $value | quote }}
        {{- end }}

after this line:

release: '{{ .Release.Name }}'

Also set a default value in values.yml:

# Annotations to apply to the deployment
deploymentAnnotations: {}

And then adding a test to make sure the values are being set correctly. Something similar to

def test_adding_pod_labels():
config = """
labels:
app.kubernetes.io/name: metricbeat
"""
r = helm_template(config)
assert (
r["daemonset"][name]["metadata"]["labels"]["app.kubernetes.io/name"]
== "metricbeat"
)
assert (
r["daemonset"][name]["spec"]["template"]["metadata"]["labels"][
"app.kubernetes.io/name"
]
== "metricbeat"
)
should work, just with the correct paths.

If you fancy taking a stab at opening a PR with these changes, we can review and provide feedback as appropriate.

@kernkonzentrat
Copy link
Contributor Author

@fatmcgav cool...will open the PR within the next few days 👍

@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

Closing as #713 was merged

@jmlrt jmlrt closed this as completed Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants