From 33e4cdab2c3dcaf26e43a8b13c1788bc349e9050 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 5 Nov 2020 14:41:45 +0500 Subject: [PATCH 1/7] Add new version --- test/ix-chart/{2010.0.1 => 2010.0.2}/.helmignore | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/Chart.yaml | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/README.md | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/app-readme.md | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/questions.yaml | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/NOTES.txt | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_containers.tpl | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_helpers.tpl | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_networking.tpl | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_volumes.tpl | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_workload.tpl | 0 .../{2010.0.1 => 2010.0.2}/templates/external-interfaces.yaml | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/service.yaml | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/templates/workload.yaml | 0 test/ix-chart/{2010.0.1 => 2010.0.2}/values.yaml | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename test/ix-chart/{2010.0.1 => 2010.0.2}/.helmignore (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/Chart.yaml (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/README.md (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/app-readme.md (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/questions.yaml (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/NOTES.txt (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_containers.tpl (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_helpers.tpl (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_networking.tpl (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_volumes.tpl (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/_workload.tpl (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/external-interfaces.yaml (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/service.yaml (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/templates/workload.yaml (100%) rename test/ix-chart/{2010.0.1 => 2010.0.2}/values.yaml (100%) diff --git a/test/ix-chart/2010.0.1/.helmignore b/test/ix-chart/2010.0.2/.helmignore similarity index 100% rename from test/ix-chart/2010.0.1/.helmignore rename to test/ix-chart/2010.0.2/.helmignore diff --git a/test/ix-chart/2010.0.1/Chart.yaml b/test/ix-chart/2010.0.2/Chart.yaml similarity index 100% rename from test/ix-chart/2010.0.1/Chart.yaml rename to test/ix-chart/2010.0.2/Chart.yaml diff --git a/test/ix-chart/2010.0.1/README.md b/test/ix-chart/2010.0.2/README.md similarity index 100% rename from test/ix-chart/2010.0.1/README.md rename to test/ix-chart/2010.0.2/README.md diff --git a/test/ix-chart/2010.0.1/app-readme.md b/test/ix-chart/2010.0.2/app-readme.md similarity index 100% rename from test/ix-chart/2010.0.1/app-readme.md rename to test/ix-chart/2010.0.2/app-readme.md diff --git a/test/ix-chart/2010.0.1/questions.yaml b/test/ix-chart/2010.0.2/questions.yaml similarity index 100% rename from test/ix-chart/2010.0.1/questions.yaml rename to test/ix-chart/2010.0.2/questions.yaml diff --git a/test/ix-chart/2010.0.1/templates/NOTES.txt b/test/ix-chart/2010.0.2/templates/NOTES.txt similarity index 100% rename from test/ix-chart/2010.0.1/templates/NOTES.txt rename to test/ix-chart/2010.0.2/templates/NOTES.txt diff --git a/test/ix-chart/2010.0.1/templates/_containers.tpl b/test/ix-chart/2010.0.2/templates/_containers.tpl similarity index 100% rename from test/ix-chart/2010.0.1/templates/_containers.tpl rename to test/ix-chart/2010.0.2/templates/_containers.tpl diff --git a/test/ix-chart/2010.0.1/templates/_helpers.tpl b/test/ix-chart/2010.0.2/templates/_helpers.tpl similarity index 100% rename from test/ix-chart/2010.0.1/templates/_helpers.tpl rename to test/ix-chart/2010.0.2/templates/_helpers.tpl diff --git a/test/ix-chart/2010.0.1/templates/_networking.tpl b/test/ix-chart/2010.0.2/templates/_networking.tpl similarity index 100% rename from test/ix-chart/2010.0.1/templates/_networking.tpl rename to test/ix-chart/2010.0.2/templates/_networking.tpl diff --git a/test/ix-chart/2010.0.1/templates/_volumes.tpl b/test/ix-chart/2010.0.2/templates/_volumes.tpl similarity index 100% rename from test/ix-chart/2010.0.1/templates/_volumes.tpl rename to test/ix-chart/2010.0.2/templates/_volumes.tpl diff --git a/test/ix-chart/2010.0.1/templates/_workload.tpl b/test/ix-chart/2010.0.2/templates/_workload.tpl similarity index 100% rename from test/ix-chart/2010.0.1/templates/_workload.tpl rename to test/ix-chart/2010.0.2/templates/_workload.tpl diff --git a/test/ix-chart/2010.0.1/templates/external-interfaces.yaml b/test/ix-chart/2010.0.2/templates/external-interfaces.yaml similarity index 100% rename from test/ix-chart/2010.0.1/templates/external-interfaces.yaml rename to test/ix-chart/2010.0.2/templates/external-interfaces.yaml diff --git a/test/ix-chart/2010.0.1/templates/service.yaml b/test/ix-chart/2010.0.2/templates/service.yaml similarity index 100% rename from test/ix-chart/2010.0.1/templates/service.yaml rename to test/ix-chart/2010.0.2/templates/service.yaml diff --git a/test/ix-chart/2010.0.1/templates/workload.yaml b/test/ix-chart/2010.0.2/templates/workload.yaml similarity index 100% rename from test/ix-chart/2010.0.1/templates/workload.yaml rename to test/ix-chart/2010.0.2/templates/workload.yaml diff --git a/test/ix-chart/2010.0.1/values.yaml b/test/ix-chart/2010.0.2/values.yaml similarity index 100% rename from test/ix-chart/2010.0.1/values.yaml rename to test/ix-chart/2010.0.2/values.yaml From 937a26e43b3bda4d97efe3562ff3c019921238cb Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 5 Nov 2020 14:42:26 +0500 Subject: [PATCH 2/7] Fix node port service not allowing multiple forwarding ports without name --- test/ix-chart/2010.0.2/templates/service.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ix-chart/2010.0.2/templates/service.yaml b/test/ix-chart/2010.0.2/templates/service.yaml index c68ba7ef833..b2e472f256a 100644 --- a/test/ix-chart/2010.0.2/templates/service.yaml +++ b/test/ix-chart/2010.0.2/templates/service.yaml @@ -13,6 +13,7 @@ spec: targetPort: {{ $config.containerPort }} protocol: {{ $config.protocol }} nodePort: {{ $config.nodePort }} + name: ix-{{ $.Release.Name }}-{{ $config.nodePort }}-{{ $index }} {{- end }} selector: {{- include "ix-chart.selectorLabels" . | nindent 4 }} From fee3de39797c82191d5f2a4308e59fef93becc02 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 5 Nov 2020 14:56:28 +0500 Subject: [PATCH 3/7] 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 }} From c0b76b6d2832765bf669dbaabb181c3b7e33861c Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 5 Nov 2020 15:22:07 +0500 Subject: [PATCH 4/7] Set hostnetwork --- test/ix-chart/2010.0.2/templates/_workload.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ix-chart/2010.0.2/templates/_workload.tpl b/test/ix-chart/2010.0.2/templates/_workload.tpl index 0d83756a282..98939363251 100644 --- a/test/ix-chart/2010.0.2/templates/_workload.tpl +++ b/test/ix-chart/2010.0.2/templates/_workload.tpl @@ -51,6 +51,7 @@ Pod specification */}} {{- define "podSepc" }} restartPolicy: {{ template "restartPolicy" . }} +hostNetwork: {{ .Values.hostNetwork }} containers: - name: {{ .Chart.Name }} {{- include "volumeMountsConfiguration" . | indent 2}} From bc4dd83e95cc8f8adcbbd5e2f6e68f040b0f8a96 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 5 Nov 2020 15:25:34 +0500 Subject: [PATCH 5/7] Update chart version --- test/ix-chart/2010.0.2/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ix-chart/2010.0.2/Chart.yaml b/test/ix-chart/2010.0.2/Chart.yaml index 3ffb1abda44..b3a82ed351f 100644 --- a/test/ix-chart/2010.0.2/Chart.yaml +++ b/test/ix-chart/2010.0.2/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2010.0.1 +version: 2010.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to From 6917269a3ee5c3ffb0f0e4c8e9333992b5ee4a57 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 5 Nov 2020 15:32:30 +0500 Subject: [PATCH 6/7] Update documentation --- test/ix-chart/2010.0.2/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/ix-chart/2010.0.2/README.md b/test/ix-chart/2010.0.2/README.md index a29dcb5030a..e9cdf2092e2 100644 --- a/test/ix-chart/2010.0.2/README.md +++ b/test/ix-chart/2010.0.2/README.md @@ -30,6 +30,8 @@ their default values. | `externalInterfaces` | Add external interfaces in the pod | `null` | | `dnsPolicy` | Specify DNS Policy for pod | `Default` | | `dnsConfig` | Specify custom DNS configuration which will be applied to the pod | `{"nameservers": [], "searches": []}` | +| `hostNetwork` | Use host network for workload ( similar to docker host networking ) | `false` | +| `hostPortsList` | Specify ports of host and workload to forward traffic from host port to workload port. | `null` | | `portForwardingList` | Specify ports of node and workload to forward traffic from node port to workload port | `null` | | `hostPathVolumes` | Specify host paths to be used as hostpath volumes for the workload | `null` | | `volumes` | Specify `ix_volumes` | `null` | From 9d5d7b6c078b270d7303ef8318ef2b4123793033 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Fri, 6 Nov 2020 05:09:15 +0500 Subject: [PATCH 7/7] Add validation for only using host ports when update strategy is recreate --- test/ix-chart/2010.0.2/questions.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ix-chart/2010.0.2/questions.yaml b/test/ix-chart/2010.0.2/questions.yaml index 22719b7894e..a7d38295a00 100644 --- a/test/ix-chart/2010.0.2/questions.yaml +++ b/test/ix-chart/2010.0.2/questions.yaml @@ -304,6 +304,7 @@ questions: label: "Specify host ports for the workload" description: "Only use host ports if scaling of a workload is not required" schema: + show_if: [["updateStrategy", "=", "Recreate"]] type: list items: - variable: hostPortConfiguration