From fee3de39797c82191d5f2a4308e59fef93becc02 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 5 Nov 2020 14:56:28 +0500 Subject: [PATCH] Add support for host networking and host paths --- test/ix-chart/2010.0.2/questions.yaml | 29 +++++++++++++++++++ .../2010.0.2/templates/_containers.tpl | 6 +++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/test/ix-chart/2010.0.2/questions.yaml b/test/ix-chart/2010.0.2/questions.yaml index 518fcfa190f..22719b7894e 100644 --- a/test/ix-chart/2010.0.2/questions.yaml +++ b/test/ix-chart/2010.0.2/questions.yaml @@ -293,6 +293,35 @@ questions: schema: type: string + - variable: hostNetwork + label: "Provide access to node network namespace for the workload" + group: "Networking" + schema: + type: boolean + default: false + + - variable: hostPortsList + label: "Specify host ports for the workload" + description: "Only use host ports if scaling of a workload is not required" + schema: + type: list + items: + - variable: hostPortConfiguration + label: "Host Port Configuration" + schema: + type: dict + attrs: + - variable: containerPort + label: "Container Port" + schema: + type: string + required: true + - variable: hostPort + label: "Host Port" + schema: + type: string + required: true + - variable: portForwardingList label: "Specify Node ports to forward to workload" group: "Networking" diff --git a/test/ix-chart/2010.0.2/templates/_containers.tpl b/test/ix-chart/2010.0.2/templates/_containers.tpl index 854bba27331..e07bb9160cd 100644 --- a/test/ix-chart/2010.0.2/templates/_containers.tpl +++ b/test/ix-chart/2010.0.2/templates/_containers.tpl @@ -53,11 +53,15 @@ livenessProbe: Container Ports */}} {{- define "containerPorts" }} -{{- if .Values.portForwardingList }} +{{- if or .Values.portForwardingList .Values.hostPortsList }} ports: {{- range $index, $config := .Values.portForwardingList }} - containerPort: {{ $config.containerPort }} {{- end }} + {{- range $index, $config := .Values.hostPortsList }} + - containerPort: {{ $config.containerPort }} + hostPort: {{ $config.hostPort }} + {{- end }} {{- end }} {{- end }}