Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a helm chart to deploy multiple applications using the same value.yaml file

Tags:

I'm trying to deploy an HTTPD instance and a couch db instance using the same values.yaml file

Is there a default document that can help me understand how to deploy two instances and there services using the same values.yaml file?

Anyone with a sample helm directory with multiple deployments and services created?

like image 536
anish anil Avatar asked Feb 15 '18 11:02

anish anil


People also ask

How do you pass values YAML in Helm?

You can use a --set flag in your Helm commands to override the value of a setting in the YAML file. Specify the name of the setting and its new value after the --set flag in the Helm command. The --set flag in the above command overrides the value for the <service>. deployment.

Can Helm use multiple values files?

Yes, it's possible to have multiple values files with Helm. Just use the --values flag (or -f ). You can also pass in a single value using --set . --set (and its variants --set-string and --set-file): Specify overrides on the command line.


1 Answers

You need to put both services into one helm chart. So they will use only one same values.yaml.

As a sample, I suggest you to look to stable/prometheus helm chart. Right now it has five separated services:

$ tree 
.
├── Chart.yaml
├── README.md
├── templates
│   ├── alertmanager-clusterrolebinding.yaml
│   ├── alertmanager-configmap.yaml
│   ├── alertmanager-deployment.yaml
│   ├── alertmanager-ingress.yaml
│   ├── alertmanager-networkpolicy.yaml
│   ├── alertmanager-pvc.yaml
│   ├── alertmanager-serviceaccount.yaml
│   ├── alertmanager-service.yaml
│   ├── _helpers.tpl
│   ├── kube-state-metrics-clusterrolebinding.yaml
│   ├── kube-state-metrics-clusterrole.yaml
│   ├── kube-state-metrics-deployment.yaml
│   ├── kube-state-metrics-networkpolicy.yaml
│   ├── kube-state-metrics-serviceaccount.yaml
│   ├── kube-state-metrics-svc.yaml
│   ├── node-exporter-clusterrolebinding.yaml
│   ├── node-exporter-daemonset.yaml
│   ├── node-exporter-serviceaccount.yaml
│   ├── node-exporter-service.yaml
│   ├── NOTES.txt
│   ├── pushgateway-deployment.yaml
│   ├── pushgateway-ingress.yaml
│   ├── pushgateway-service.yaml
│   ├── server-clusterrolebinding.yaml
│   ├── server-clusterrole.yaml
│   ├── server-configmap.yaml
│   ├── server-deployment.yaml
│   ├── server-ingress.yaml
│   ├── server-networkpolicy.yaml
│   ├── server-pvc.yaml
│   ├── server-serviceaccount.yaml
│   └── server-service.yaml
└── values.yaml
like image 61
nickgryg Avatar answered Sep 27 '22 17:09

nickgryg