From 1de5d8b70c115a689564dc5425c0abff1bd292ee Mon Sep 17 00:00:00 2001 From: "Javier J. Salmeron Garcia" Date: Wed, 21 Nov 2018 11:54:11 +0100 Subject: [PATCH] [bitnami/apache] Add service.type to values.yaml --- bitnami/apache/Chart.yaml | 2 +- bitnami/apache/README.md | 8 ++++++++ bitnami/apache/templates/svc.yaml | 26 +++++++++++++++++++------- bitnami/apache/values.yaml | 19 +++++++++++++++++++ 4 files changed, 47 insertions(+), 8 deletions(-) diff --git a/bitnami/apache/Chart.yaml b/bitnami/apache/Chart.yaml index baa24e218..a254df2ad 100644 --- a/bitnami/apache/Chart.yaml +++ b/bitnami/apache/Chart.yaml @@ -1,5 +1,5 @@ name: apache -version: 2.1.2 +version: 3.0.0 appVersion: 2.4.37 description: Chart for Apache HTTP Server keywords: diff --git a/bitnami/apache/README.md b/bitnami/apache/README.md index 37171d74a..a1c08cfa1 100644 --- a/bitnami/apache/README.md +++ b/bitnami/apache/README.md @@ -52,6 +52,14 @@ The following tables lists the configurable parameters of the Apache chart and t | `image.tag` | Apache Image tag | `{VERSION}` | | `image.pullPolicy` | Apache image pull policy | `Always` | | `image.pullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) | +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.httpsPort` | Service HTTPS port | `443` | +| `service.nodePorts.http` | Kubernetes http node port | `""` | +| `service.nodePorts.https` | Kubernetes https node port | `""` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.loadBalancerIP` | LoadBalancer service IP address | `""` | + Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/apache/templates/svc.yaml b/bitnami/apache/templates/svc.yaml index a52501f96..2c712f3f2 100644 --- a/bitnami/apache/templates/svc.yaml +++ b/bitnami/apache/templates/svc.yaml @@ -8,13 +8,25 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: LoadBalancer + type: {{ .Values.service.type }} + {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} ports: - - name: http - port: 80 - targetPort: http - - name: https - port: 443 - targetPort: https + - name: http + port: {{ .Values.service.port }} + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} + nodePort: {{ .Values.service.nodePorts.http }} + {{- end }} + - name: https + port: {{ .Values.service.httpsPort }} + targetPort: https + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}} + nodePort: {{ .Values.service.nodePorts.https }} + {{- end }} selector: app: {{ template "fullname" . }} diff --git a/bitnami/apache/values.yaml b/bitnami/apache/values.yaml index d6073c610..26db8be64 100644 --- a/bitnami/apache/values.yaml +++ b/bitnami/apache/values.yaml @@ -21,3 +21,22 @@ image: ## # pullSecrets: # - myRegistrKeySecretName + +service: + type: LoadBalancer + # HTTP Port + port: 80 + # HTTPS Port + httpsPort: 443 + ## + ## nodePorts: + ## http: + ## https: + ## loadBalancerIP: + nodePorts: + http: "" + https: "" + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster