-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[metricbeat] split values for daemonset and deployment #572
Conversation
b9a10e7
to
03a0cb7
Compare
03a0cb7
to
cea4e9a
Compare
04037cf
to
61c96be
Compare
d7383ff
to
c8af71b
Compare
* reorder some values * improve values description
c6386ab
to
7914ffb
Compare
d6e3741
to
07877a6
Compare
ce45c1a
to
12d6ffe
Compare
89e9d16
to
593c743
Compare
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.
LGTM
metricbeat/README.md
Outdated
[serviceAccount]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ | ||
[tolerations]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | ||
[updateStrategy]: https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy | ||
[values.yaml]: https://github.com/elastic/helm-charts/tree/master/metricbeat/values.yaml |
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.
New line missing
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.
fixed in b489901
metricbeat/templates/configmap.yaml
Outdated
{{ $path }}: | | ||
{{ $config | indent 4 -}} | ||
{{- end -}} | ||
{{- end -}} |
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.
New line missing
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.
fixed in b489901
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.
LGTM!
This is fantastic work! As the person that originally created this mess...thank you so much for fixing this up and making everything else better in the process :)
I thought I found an issue, but after testing it looks like it works as expected. I just hadn't seen that syntax before. I left the comments in anyway because it confused me until I looked up how it worked.
@@ -136,6 +130,13 @@ spec: | |||
mountPath: /usr/share/metricbeat/{{ $path }} | |||
readOnly: true | |||
subPath: {{ $path }} | |||
{{ else }} |
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.
🚫 I think this else should be an {{ end }}
and the other end
below needs to be removed. The range
loop above is going over .Values.metricbeatConfig
and doesn't seem to end properly.
{{ else }} | |
{{ end }} |
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.
So this looked like an issue to me but I couldn't make it cause any unexpected issues when testing. After looking at the docs it looks like you can do a {{ range }} {{ else }}
. I think the syntax just through me off:
{{range pipeline}} T1 {{else}} T0 {{end}}
The value of the pipeline must be an array, slice, map, or channel.
If the value of the pipeline has length zero, dot is unaffected and
T0 is executed; otherwise, dot is set to the successive elements
of the array, slice, or map and T1 is executed.
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.
Yeah {{ range }} {{ else }}
isn't documented in Helm doc, but is fine in Go template. That said, if you think this syntax can be confusing or lead to mistake, I'm fine with replacing it by 2 entirely different {{ range }}
loops instead.
@@ -32,17 +32,16 @@ spec: | |||
heritage: '{{ .Release.Service }}' | |||
release: '{{ .Release.Name }}' | |||
spec: | |||
{{- with .Values.tolerations }} |
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.
❤️ I really like all of these little cleanups here to add some consistency. I like the much cleaner and shorter versions using nindent below :)
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.
Yeah Helm templates are a little more readable with nindents
😃.
metricbeat/templates/deployment.yaml
Outdated
{{- if .Values.podSecurityContext }} | ||
securityContext: | ||
{{ toYaml .Values.podSecurityContext | indent 10 }} | ||
{{- if .Values.envFrom | default .Values.deployment.envFrom }} |
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.
💡 I think this if statement can just be dropped. Since the default is an empty list already.
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.
good catch
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.
fixed in 890428d
|
||
|
||
def test_adding_deprecated_envs(): | ||
config = """ | ||
extraEnvs: |
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.
❤️ Great to see this test being added to test the backwards compatibility logic!
mountPath: /usr/share/metricbeat/{{ $path }} | ||
readOnly: true | ||
subPath: {{ $path }} | ||
{{- end }} |
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.
{{- end }} |
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.
This comment was part of #572 (comment) and can be ignored.
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.
LGTM!
[metricbeat] split values for daemonset and deployment
backported to |
Split values for
DaemonSet
andDeployment
:affinity
envFrom
extraEnvs
extraVolumeMounts
extraVolumes
metricbeatConfig
nodeSelector
securityContext
resources
secretMounts
tolerations
Fixes #446
Replace #448
${CHART}/tests/*.py
${CHART}/examples/*/test/goss.yaml