Add port configuration to k8s pod

This commit is contained in:
Waqar Ahmed 2020-10-16 15:21:28 +05:00
parent a88f0ad217
commit 5f85618cd0
3 changed files with 14 additions and 1 deletions

View File

@ -48,3 +48,15 @@ livenessProbe:
periodSeconds: {{ .Values.periodSeconds }} periodSeconds: {{ .Values.periodSeconds }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/*
Container Ports
*/}}
{{- define "containerPorts" }}
{{- if .Values.portForwardingList }}
ports:
{{- range $index, $config := .Values.portForwardingList }}
- containerPort: {{ $config.containerPort }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -62,6 +62,7 @@ containers:
{{- include "containerArgs" . | indent 2 }} {{- include "containerArgs" . | indent 2 }}
{{- include "containerEnvVariables" . | indent 2 }} {{- include "containerEnvVariables" . | indent 2 }}
{{- include "containerLivenssProbe" . | indent 2 }} {{- include "containerLivenssProbe" . | indent 2 }}
{{- include "containerPorts" . | indent 2 }}
{{- include "volumeConfiguration" . }} {{- include "volumeConfiguration" . }}
{{- include "dnsConfiguration" . }} {{- include "dnsConfiguration" . }}
{{- end }} {{- end }}

View File

@ -2,7 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{- include "ix-chart.fullname" . }} name: {{ include "ix-chart.fullname" . }}
labels: labels:
{{- include "ix-chart.labels" . | nindent 4 }} {{- include "ix-chart.labels" . | nindent 4 }}
spec: spec: