-
Notifications
You must be signed in to change notification settings - Fork 18
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
Adding k3s support in helm chart #22
Conversation
added k3s as a flag for k3s clusters.
added the k3s containerd path if k3s is enabled in the values.yml
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA. |
deploy/charts/checkmk/values.yaml
Outdated
@@ -6,6 +6,9 @@ nameOverride: "" | |||
fullnameOverride: "" | |||
kubeVersionOverride: "" | |||
|
|||
k3s: |
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.
As this change also adds support for RKE2, please also add it and let's rename it for more clarity to:
k3s/rke2-compatibilityMode
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 would advise against using special characters like -
or /
in the variable names in Helm ... plain camelCase would be best!
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 agree with this as the user would most likely have to escape it to use it (I'm guessing). Should I rename it to k3sbackend or rancherbackend? Not sure what to rename it to
Hey Zach! |
For the future: ideally the commits individually should speak for themselves. E.g. updating a filename becomes very obvious when you see that the commit only touched the one filename. In this case, I would have recommended one commit which includes both changes and use the title of this PR for the commit :-) |
@@ -62,6 +62,9 @@ spec: | |||
args: | |||
{{- with .Values.nodeCollector.cadvisor.additionalArgs }} | |||
{{ toYaml . | nindent 12 }} | |||
{{- if $.Values.k3s.enabled }} |
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.
Why do you use {{- if $.Values.k3s.enabled }} instead of {{- if .Values.k3s.enabled }} ?
I am no Helm template expert, but it loosk rather unusual.
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.
You have to use $
if you are inside a loop or iteration (as here introduced with with
statement), in order to access variables on global level; because inside a loop using .
you would access variables inside the local context.
But nonetheless, why are we adding it inside the context in the first place? For me this reads like, for each additionalArg we add, if k3s is enabled, also add --containerd
... but we would like to only add it once, no?
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.
Yes, it would be better to do this outside the context.
We only need to add --containerd once, if the user is using k3s or rke2
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 it does just add it once and there was a weird thing I had happen to me where it actually added the other additionalArgs 2 times instead of once. The version you see here doesn't do that (at least for me). It just adds 1 containerd arg line after the original additionalArgs.
Two general questions on this:
though to the default samples, so it's ready to be uncommented. @unixbird you were mentioning "you would have to edit the DaemonSet to add the k3s containerd path" - were you aware of
|
@sjentzsch I just tested this with 1.27.5 and the cluster collector fails without using those additional args. I was thinking of the same thing but Martin thought of something else to try out and I like it a little better than what I originally had. Going to edit it into this PR for review. |
Added suggested changes to instead include a way to customize the containerd runtime path.
Adjusted to match the values.yml to allow customization of where the containerd runtime path is.
Added the changes that @martinhv suggested to my main branch. This allows you to customize the location of the containerd runtime if needed. |
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.
Works for me. Will forward to a dev.
Normally you would have to edit the DaemonSet to add the k3s containerd path so that the cluster collector would get metrics properly but with this you can enable k3s in the values.yml to do it for you.
I tested this on a brand new k3s instance and it works for me with data in the checkmk dashboard.