https://pulumi.com logo
#general
Title
# general
t

thankful-island-60540

05/31/2019, 9:56 AM
Hi, have a question for injecting a values file to a helm chart deployment (no just specific values), so for example i'm deploying the latest stable jenkins helm chart, when deploying it manually via
helm upgrade ...
its all running fine, When using next code example
Copy code
jenkins_values = "PATH_TO_VALUES.yaml"
with open(jenkins_values) as f:
    jenkins_values = f.read()
    jenkins_values = yaml.load(jenkins_values)

Chart("jenkins",
      ChartOpts(chart="jenkins",
                repo="stable",
                version="1.1.23",
                namespace="jenkins",
                values=jenkins_values))
The chart is being deployed, but not taking any of the values (it just deploys the default chart values). Does Pulumi support of injecting a values file, or should i actually pass exact values i want to change (equivalent to --set)?
r

rapid-eye-32575

05/31/2019, 10:06 AM
Hey, i'm just a regular user of Pulumi so I might be wrong. But as I understood it Pulumi will in essence use the options in your code to generate the manifests using helm and then compare it to the state of the resources in the cluster. So yes, you have to specify the same value you did when creating the release manually.
I.e. Pulumi is not running
helm upgrade
and is not using (and not requiring) Tiller in your Cluster
t

thankful-island-60540

05/31/2019, 10:13 AM
Hey, yes that sounds right (btw, i'm not deploying via helm and then letting pulumi to do some more work, but deploying using pulumi from scratch). the issue is if i use
Copy code
Chart("jenkins",
      ChartOpts(chart="jenkins",
                repo="stable",
                version="1.1.23",
                namespace="jenkins",
                values={
                    "alice": "bob"
                }))
Then the deploy will override a key named
alice
to a value of
bob
and that's ok, but what if i have hundreds (for example) values that i need to change? it would be easier to just
yaml.load
it from a file and that seems to not work... or maybe its just my values syntax is wrong🤔 i'll double check the dictionary that's being generated, but it look fine....
r

rapid-eye-32575

05/31/2019, 10:20 AM
Ah sorry, I misread your question completely!
Hmm I just checked my code and I actually do the same using the Node.js SDK. So it should work. Maybe this is some sort of concurrency issue and not actually a Pulumi issue? I don't know Python so I couldn't say 😉
b

busy-umbrella-36067

05/31/2019, 4:18 PM
My biggest issue with Helm Charts was that the wrong values were documented
You can edit your
@pulumi/kubernetes
package inside
node_modules
to add that and compare the default chart values to what you are passing to it
I had a case where the
ingress-nginx
chart documented the wrong values for setting targetPorts. Got it resolved using the above. I hope this helps
t

thankful-island-60540

06/01/2019, 6:57 AM
@busy-umbrella-36067 Thanks, i've really updated the python package and added some prints (too bad i cannot run the python code without the CLI to debug), and it really seems to have some bugs, thanks for the tip