Procházet zdrojové kódy

Add port configuration to k8s pod

Waqar Ahmed před 5 roky
rodič
revize
5f85618cd0

+ 12 - 0
charts/ix-chart/2010.0.1/templates/_containers.tpl

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

+ 1 - 0
charts/ix-chart/2010.0.1/templates/_workload.tpl

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

+ 1 - 1
charts/ix-chart/2010.0.1/service.yaml → charts/ix-chart/2010.0.1/templates/service.yaml

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