I am trying to implement helm chart. I need to pass value via CLI to values.yaml file.
values.yaml
internalPort: 8081
volumeMounts:
name: ebs-pvc
ingress:# Default values for miqp-ui-dep.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
##################Names of files and Applications################
Depname: miqp-server-dep
Appname: miqp-server
Svcname: miqp-server-svc
Ingname: miqp-ing
#################################################################
replicaCount: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
minReadySeconds: 5
nodeSelector:
role: nginxplus
image:
repository: xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/miqp-devops
tag: miqpserver_2sep
pullPolicy: IfNotPresent
service:
name: miqp-ui-svc
externalPort: 80
enabled: true
hosts:
- kubernetes-miq.xxxxxx.com
tls:
- secretName: default-token-k33w6
hosts:
- kubernetes-xxxxxx.com
persistence:
enabled: true
volume:
accessModes: ReadWriteOnce
pvcName: ebs-pvc
storageClass: standard
storageSize: 20G
ingress.yaml
{{- if .Values.ingress.enabled -}}
{{- $serviceName := .Values.service.name -}}
{{- $servicePort := .Values.service.externalPort -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ .Values.Ingname }}
namespace: {{ .Release.Namespace }}
spec:
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path:
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
- path: /api/
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end -}}
{{- if .Values.ingress.tls}}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
How do I replace parameter values in the bellow example?
ingress:
enabled: true
hosts:
- kubernetes-miq.xxxxxx.com
tls:
- secretName: default-token-k33w6
hosts:
- kubernetes-miq.xxxxxx.com
For example, I need to replace the value of the parameters sectretName and hosts.
How do I do it?