28

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?

Romain
  • 19,910
  • 6
  • 56
  • 65
anish anil
  • 2,299
  • 7
  • 21
  • 41

2 Answers2

40

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
Dave
  • 21,524
  • 28
  • 141
  • 221
nickgryg
  • 25,567
  • 5
  • 77
  • 79
  • 6
    Does anyone know a more digestable (read - smaller) example that illustrates configuring multiple services/deployments with a single Helm Chart? – IvanR Feb 18 '20 at 11:08
  • 7
    Prometheus community has given up on this structure. Have a look at https://github.com/prometheus-community/helm-charts for better examples. – Nagri Dec 14 '20 at 10:15
  • nice talk with codes! – zx1986 Oct 02 '21 at 16:55
5

You can also use the following command to deploy both applications separately with one values.yaml file:

helm install -f my-values.yaml chart1
helm install -f my-values.yaml chart2
030
  • 10,842
  • 12
  • 78
  • 123
Jainish Shah
  • 1,217
  • 10
  • 15