From 2b8977ba9a224edb16d9283d161b596dd29b03f9 Mon Sep 17 00:00:00 2001 From: Can Yucel Date: Fri, 22 Jun 2018 01:25:06 -0700 Subject: [PATCH] [stable/nginx-ingress] Enable custom hostports (#6188) * [nginx-ingress] add custom host port support * [nginx-ingress] update README * version bump --- stable/nginx-ingress/Chart.yaml | 2 +- stable/nginx-ingress/README.md | 2 ++ stable/nginx-ingress/templates/controller-daemonset.yaml | 4 ++-- stable/nginx-ingress/values.yaml | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stable/nginx-ingress/Chart.yaml b/stable/nginx-ingress/Chart.yaml index 650fbbf2e6..227892465d 100755 --- a/stable/nginx-ingress/Chart.yaml +++ b/stable/nginx-ingress/Chart.yaml @@ -1,5 +1,5 @@ name: nginx-ingress -version: 0.20.3 +version: 0.20.4 appVersion: 0.14.0 home: https://github.com/kubernetes/ingress-nginx description: An nginx Ingress controller that uses ConfigMap to store the nginx configuration. diff --git a/stable/nginx-ingress/README.md b/stable/nginx-ingress/README.md index 851bbe205b..05ab48c223 100644 --- a/stable/nginx-ingress/README.md +++ b/stable/nginx-ingress/README.md @@ -64,6 +64,8 @@ Parameter | Description | Default `controller.extraArgs` | Additional controller container arguments | `{}` `controller.kind` | install as Deployment or DaemonSet | `Deployment` `controller.daemonset.useHostPort` | If `controller.kind` is `DaemonSet`, this will enable `hostPort` for TCP/80 and TCP/443 | false +`controller.daemonset.hostPorts.http` | If `controller.daemonset.useHostPort` is `true` and this is non-empty, it sets the hostPort | `"80"` +`controller.daemonset.hostPorts.https` | If `controller.daemonset.useHostPort` is `true` and this is non-empty, it sets the hostPort | `"443"` `controller.tolerations` | node taints to tolerate (requires Kubernetes >=1.6) | `[]` `controller.affinity` | node/pod affinities (requires Kubernetes >=1.6) | `{}` `controller.minReadySeconds` | how many seconds a pod needs to be ready before killing the next, during update | `0` diff --git a/stable/nginx-ingress/templates/controller-daemonset.yaml b/stable/nginx-ingress/templates/controller-daemonset.yaml index 57929b52db..756c3f5eb6 100644 --- a/stable/nginx-ingress/templates/controller-daemonset.yaml +++ b/stable/nginx-ingress/templates/controller-daemonset.yaml @@ -102,13 +102,13 @@ spec: containerPort: 80 protocol: TCP {{- if .Values.controller.daemonset.useHostPort }} - hostPort: 80 + hostPort: {{ .Values.controller.daemonset.hostPorts.http }} {{- end }} - name: https containerPort: 443 protocol: TCP {{- if .Values.controller.daemonset.useHostPort }} - hostPort: 443 + hostPort: {{ .Values.controller.daemonset.hostPorts.https }} {{- end }} {{- if .Values.controller.stats.enabled }} - name: stats diff --git a/stable/nginx-ingress/values.yaml b/stable/nginx-ingress/values.yaml index 8b84d5f873..b25cfc8ece 100755 --- a/stable/nginx-ingress/values.yaml +++ b/stable/nginx-ingress/values.yaml @@ -26,6 +26,10 @@ controller: daemonset: useHostPort: false + hostPorts: + http: 80 + https: 443 + ## Required only if defaultBackend.enabled = false ## Must be / ##