I'm new here to helm world. I want to generate manifest from my values and sample.yaml so I trying to create a template from my sample.yaml files.
Values.yaml
prodapps:
alpha:
name: alpha
image: alpha.azurecr.io/alpha:latest
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "10000Mi"
cpu: "150m"
limits:
memory: "800Mi"
cpu: 600m"
ingress:
enabled: true
annotations:
zap.ingress.kubernetes.io/rule-type: PathPrefixStrip
nginx.ingress.kubernetes.io/rewrite-target: /
path: /alpha/api
hosts:
- demo.jumboapps.com
beta:
name: beta
disable: true
image: beta.azurecr.io/beta:latest
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "10000Mi"
cpu: "150m"
limits:
memory: "800Mi"
cpu: 600m"
ingress:
enabled: true
annotations:
zap.ingress.kubernetes.io/rule-type: PathPrefixStrip
nginx.ingress.kubernetes.io/rewrite-target: /
path: /beta/api
hosts:
- demo.jumboapps.com
Sample.yaml
apiVersion: v1
kind: Service
metadata:
name: "{{ .Values.prodapps.alpha.name }}-svc"
namespace: "{{ .Release.Namespace }}"
spec:
ports:
- port: 80
name: "http"
selector:
app: "{{ .Values.prodapps.alpha.name }}"
---
apiVersion: v1
kind: Service
metadata:
name: "{{ .Values.prodapps.beta.name }}-svc"
namespace: "{{ .Release.Namespace }}"
spec:
ports:
- port: 80
name: "http"
selector:
app: "{{ .Values.prodapps.beta.name }}"
My main goal is to templatize my sample.yaml.by and produce the valid Manifet file. following helm documentation. But I cant find any sensible(my understandable) syntax for looping through complex values files.
Please anyone help me out with this.