Skip to content
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

Helm extension not applying values #447

Closed
bfjelds opened this issue Nov 23, 2020 · 8 comments · Fixed by #474
Closed

Helm extension not applying values #447

bfjelds opened this issue Nov 23, 2020 · 8 comments · Fixed by #474

Comments

@bfjelds
Copy link

bfjelds commented Nov 23, 2020

Version

v0.7.0

Platform
Which platform did you run k0s on?

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

What happened?
First, the docs specify some yaml I'm unfamiliar with and was looking for an explanation (the 2 after the pipe character '|'' in the values definition). After playing around with a yaml validator, the 2 seems related to consolidating the indentation when converting everything after the | into a single string. Maybe this is more familiar to other people, but if it is obscure, a mention of what it means would be nice.

helm:
 repositories:
 - name: stable
   url: https://charts.helm.sh/stable
 - name: prometheus-community
   url: https://prometheus-community.github.io/helm-charts
 charts:
 - name: prometheus-stack
   chartname: prometheus-community/prometheus
   version: "11.16.8"
   values: |2
       <embed yaml>
   namespace: default

I've been trying out k0s with a project I'm working on and am not having luck getting the Helm chart quite right

  1. I specify the namespace as something other than default but the resulting components end up in default namespace.
  2. I specify values (that I would normally specify on the command line with --set), but the resulting deployment doesn't seem to reflect the values.

Is there a way to see some debug output or a log of what Helm is doing? Something in a log file that is equivalent to passing the --debug argument to Helm would be very helpful.

How To Reproduce
Add this to k0s.yaml (I have tried with values: |2, values: |, and values: ... all yield the same results):

extensions:
  helm:
    repositories:
    - name: akri
      url: https://deislabs.github.io/akri
    charts:
    - name: akri-dev
      chartname: akri/akri-dev
      version: "0.0.42"
      namespace: akri
      values: |2
        debugEcho.enabled: true
        debugEcho.shared: false
        agent.allowDebugEcho: true

I'm trying to do the equivalent of helm install akri akri-helm-charts/akri-dev --version 0.0.42 --set debugEcho.enabled=true,debugEcho.shared=false,agent.allowDebugEcho=true

Expected behavior
I expected to see the akri components show up in akri namespace rather than default ( though, it is entirely possible that akri is messing up :) )

I also expected to see a few more components starting based on the values specified, which makes me wonder if the values are being communicated to Helm ( though, again, it is entirely possible that akri is messing up :) )

$ kubectl get pods -A
NAMESPACE     NAME                                          READY   STATUS             RESTARTS   AGE
default       akri-agent-daemonset-l84qp                    1/1     Running            10         2d20h
default       akri-controller-deployment-6949859f84-7gml9   1/1     Running            7          2d20h

Screenshots & Logs

Additional context
Following up on the idea that the values were not being applied to the Akri helm chart, I added a paramater that would result in a path being mounted in the resulting containers.

extensions:
  helm:
    repositories:
    - name: akri
      url: https://deislabs.github.io/akri
    charts:
    - name: akri-dev
      chartname: akri/akri-dev
      version: "0.0.42"
      namespace: akri
      values: |2
        agent.host.dockerShimSock: /my/new/docker/shim/foo.sock

After deploying k0s, I can then test whether this new path was mounted as expected:

$ sudo crictl --runtime-endpoint unix:///run/k0s/containerd.sock inspect $(sudo crictl --runtime-endpoint unix:///run/k0s/containerd.sock ps | grep agent | awk '{print $1}') | grep hostPath | grep sock | grep /my/new/docker/shim/foo.sock && echo "Successfully passed Helm value" || echo "Failed to pass Helm value"
Failed to pass Helm value

It (from this contrived test) seems that the values are not being applied to the Helm chart.

@bfjelds bfjelds changed the title Helm extension documentation question Helm extension not applying values Nov 23, 2020
@jnummelin
Copy link
Member

Thanks @bfjelds for such a detailed issue. There seems to be two separate things going on so let's tackle the values thing first.

The "pipe" char in yaml indicates that everything below that with the same intendation will be treated as a single string. See e.g. https://yaml-multiline.info/ for info

So the intention is that you can add the normal Helm values.yaml as embedded as-is in the k0s.yaml

I specify values (that I would normally specify on the command line with --set), but the resulting deployment doesn't seem to reflect the values.

With Helm the values.yaml and --set values ARE different. For --set you need to give the "path" of the value. For values.yaml it's plain yaml and that you should embed into k0s.yaml too. Specifically for akri, you should look at https://github.com/deislabs/akri/blob/main/deployment/helm/values.yaml for reference.

@bfjelds
Copy link
Author

bfjelds commented Nov 24, 2020

With Helm the values.yaml and --set values ARE different. For --set you need to give the "path" of the value. For
values.yaml it's plain yaml and that you should embed into k0s.yaml too. Specifically for akri, you should look at
https://github.com/deislabs/akri/blob/main/deployment/helm/values.yaml for reference.

Thank you for the clarification! I was expecting each line of values to be equivalent to --set for some reason.

I tried copying the entirety of https://github.com/deislabs/akri/blob/main/deployment/helm/values.yaml into the values: |2 (with added indentation) and modified crictl (to be a nonsensical, but easy to verify: /usr/bin/crictlddd) and dockerShimSock (/var/run/dockershim.sockddd), but am still not seeing the modified values mounted in the resulting container

$ sudo crictl --runtime-endpoint unix:///run/k0s/containerd.sock inspect $(sudo crictl --runtime-endpoint unix:///run/k0s/containerd.sock ps | grep agent | awk '{print $1}') | grep hostPath`)
        ...
        "hostPath": "/usr/bin/crictl",
        "hostPath": "/var/run/dockershim.sock",
        ...

@jnummelin
Copy link
Member

@bfjelds #474 should fix this issue, finally. Would be nice if you could give it a spin to verify.

@bfjelds
Copy link
Author

bfjelds commented Dec 1, 2020

I haven't been building k0s, only downloading it ... how should I download and try out the new bits?

@trawler
Copy link
Contributor

trawler commented Dec 1, 2020

@bfjelds
To download, you need to git clone the repository from main branch (https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository). For building, instruction are in the main README, here: https://github.com/k0sproject/k0s#build

@bfjelds
Copy link
Author

bfjelds commented Dec 1, 2020

I don't have the bandwidth to build k0s, but will try it out when #474 gets released :)

@jasmingacic
Copy link
Contributor

@bfjelds the fix has been released and you can check it out here https://github.com/k0sproject/k0s/releases/tag/v0.8.0

@bfjelds
Copy link
Author

bfjelds commented Dec 1, 2020

awesome! that works for me!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants