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

Inject values into charts from kubectl command statement result at runtime #4270

Closed
komal-SkyNET opened this issue Jun 26, 2018 · 3 comments
Closed

Comments

@komal-SkyNET
Copy link

I'm trying to inject values into my chart by obtaining values from the kubernetes cluster by executing certain kubectl commands. For instance, I need to inject the a value into my charts from kubernetes node labels.

Output of helm version:
Client: &version.Version{SemVer:"v2.7.2" , GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.7.2", GitTreeState:"clean"}

Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.6", GitTreeState:"clean", BuildDate:"2018-03-21T15:21:50Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.3+coreos.0", GitTreeState:"clean", BuildDate:"2017-11-13T10:18:37Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): VMware

@komal-SkyNET komal-SkyNET changed the title Inject values into charts from kubectl command statement result Inject values into charts from kubectl command statement result at runtime Jun 26, 2018
@komal-SkyNET
Copy link
Author

Just looking to see if there's a feature to do this from values file.

eg:

data:
environment: {{ $(kubectl get nodes --show-labels ) }}

I understand there's formatting issues and data type mismatch here, but just wondering if there's a way to execute and get output from command into values file. I've noticed --set option being used for stuff like this.

@bacongobbler
Copy link
Member

bacongobbler commented Jun 29, 2018

This seems like a good use case to add to the downward API. It's not possible to grab node labels, but this was requested upstream. See kubernetes/kubernetes#40610

For now, you'll have to use --set and manually inject your labels into the chart. There's no way currently to programmatically grab the node's labels on-the-fly.

@bacongobbler
Copy link
Member

Closing due to inactivity. Please open a new ticket against Helm 3 if this issue persists. Thanks!

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

No branches or pull requests

2 participants