From a88f0ad217bf7b6738aca901e6f0629289af7526 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Fri, 16 Oct 2020 15:16:54 +0500 Subject: [PATCH] Add service to specify port forwarding --- charts/ix-chart/2010.0.1/questions.yaml | 31 +++++++++++++++++++++++++ charts/ix-chart/2010.0.1/service.yaml | 19 +++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 charts/ix-chart/2010.0.1/service.yaml diff --git a/charts/ix-chart/2010.0.1/questions.yaml b/charts/ix-chart/2010.0.1/questions.yaml index cc72f4d7b30..4b0d352369f 100644 --- a/charts/ix-chart/2010.0.1/questions.yaml +++ b/charts/ix-chart/2010.0.1/questions.yaml @@ -274,6 +274,37 @@ questions: schema: type: string + - variable: portForwardingList + label: "Specify Node ports to forward to workload" + group: "Networking" + description: "Specify ports of node and workload to forward traffic from node port to workload port" + schema: + type: list + items: + - variable: portForwarding + label: "Port Forwarding Configuration" + schema: + type: dict + attrs: + - variable: containerPort + label: "Container Port" + schema: + type: string + required: true + - variable: nodePort + label: "Node Port" + schema: + type: string + required: true + - variable: protocol + label: "Protocol" + schema: + type: string + default: "TCP" + enum: + - "TCP" + - "UDP" + # Storage Options # Host path based volumes - variable: hostPathVolumes diff --git a/charts/ix-chart/2010.0.1/service.yaml b/charts/ix-chart/2010.0.1/service.yaml new file mode 100644 index 00000000000..21581585476 --- /dev/null +++ b/charts/ix-chart/2010.0.1/service.yaml @@ -0,0 +1,19 @@ +{{- if .Values.portForwardingList }} +apiVersion: v1 +kind: Service +metadata: + name: {{- include "ix-chart.fullname" . }} + labels: + {{- include "ix-chart.labels" . | nindent 4 }} +spec: + type: NodePort + ports: + {{- range $index, $config := .Values.portForwardingList }} + - port: {{ $config.containerPort }} + targetPort: {{ $config.containerPort }} + protocol: {{ $config.protocol }} + nodePort: {{ $config.nodePort }} + {{- end }} + selector: + {{- include "ix-chart.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file