From e086544f8468b46e651f37d734d81c74536bc5b9 Mon Sep 17 00:00:00 2001 From: Andres Martinez Gotor Date: Fri, 11 Oct 2019 15:33:40 +0200 Subject: [PATCH] [stable/wordpress] Allow to specify a single hostname (#17861) * Allow to specify a single hostname Signed-off-by: Andres Martinez Gotor * Apply changes to values-production Signed-off-by: Andres Martinez Gotor --- stable/wordpress/Chart.yaml | 2 +- stable/wordpress/README.md | 6 ++++-- stable/wordpress/templates/ingress.yaml | 9 +++++++++ stable/wordpress/values-production.yaml | 13 ++++++++----- stable/wordpress/values.yaml | 13 ++++++++----- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/stable/wordpress/Chart.yaml b/stable/wordpress/Chart.yaml index acf8806623..38f4ef9588 100755 --- a/stable/wordpress/Chart.yaml +++ b/stable/wordpress/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: wordpress -version: 7.3.11 +version: 7.4.0 appVersion: 5.2.3 description: Web publishing platform for building blogs and websites. icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png diff --git a/stable/wordpress/README.md b/stable/wordpress/README.md index a2f1aa2bb0..669cec1ed8 100644 --- a/stable/wordpress/README.md +++ b/stable/wordpress/README.md @@ -104,6 +104,7 @@ The following table lists the configurable parameters of the WordPress chart and | `readinessProbeHeaders` | Headers to use for readinessProbe | `nil` | | `ingress.enabled` | Enable ingress controller resource | `false` | | `ingress.certManager` | Add annotations for cert-manager | `false` | +| `ingress.hostname` | Default host for the ingress resource | `wordpress.local` | | `ingress.annotations` | Ingress annotations | `[]` | | `ingress.hosts[0].name` | Hostname to your Wordpress installation | `wordpress.local` | | `ingress.hosts[0].path` | Path within the url structure | `/` | @@ -270,8 +271,9 @@ To enable ingress integration, please set `ingress.enabled` to `true` ### Hosts Most likely you will only want to have one hostname that maps to this -WordPress installation, however, it is possible to have more than one -host. To facilitate this, the `ingress.hosts` object is an array. +WordPress installation. If that's your case, the property `ingress.hostname` +will set it. However, it is possible to have more than one host. To +facilitate this, the `ingress.hosts` object is can be specified as an array. For each item, please indicate a `name`, `tls`, `tlsSecret`, and any `annotations` that you may want the ingress controller to know about. diff --git a/stable/wordpress/templates/ingress.yaml b/stable/wordpress/templates/ingress.yaml index a9ec26ba9c..5939e9a9b6 100755 --- a/stable/wordpress/templates/ingress.yaml +++ b/stable/wordpress/templates/ingress.yaml @@ -17,6 +17,15 @@ metadata: {{- end }} spec: rules: + {{- if .Values.ingress.hostname }} + - host: {{ .Values.ingress.hostname }} + http: + paths: + - path: / + backend: + serviceName: "{{ template "wordpress.fullname" $ }}" + servicePort: http + {{- end }} {{- range .Values.ingress.hosts }} - host: {{ .name }} http: diff --git a/stable/wordpress/values-production.yaml b/stable/wordpress/values-production.yaml index eae9810e81..4b9b7c1013 100644 --- a/stable/wordpress/values-production.yaml +++ b/stable/wordpress/values-production.yaml @@ -255,6 +255,9 @@ ingress: ## Set this to true in order to add the corresponding annotations for cert-manager certManager: false + ## When the ingress is enabled, a host pointing to this will be created + hostname: wordpress.local + ## Ingress annotations done as key:value pairs ## For a full list of possible ingress annotations, please see ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md @@ -264,11 +267,11 @@ ingress: annotations: # kubernetes.io/ingress.class: nginx - ## The list of hostnames to be covered with this ingress record. - ## Most likely this will be just one host, but in the event more hosts are needed, this is an array - hosts: - - name: wordpress.local - path: / + ## The list of additional hostnames to be covered with this ingress record. + ## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array + ## hosts: + ## - name: wordpress.local + ## path: / ## The tls configuration for the ingress ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls diff --git a/stable/wordpress/values.yaml b/stable/wordpress/values.yaml index b5f440f2dc..3a164418de 100644 --- a/stable/wordpress/values.yaml +++ b/stable/wordpress/values.yaml @@ -255,6 +255,9 @@ ingress: ## Set this to true in order to add the corresponding annotations for cert-manager certManager: false + ## When the ingress is enabled, a host pointing to this will be created + hostname: wordpress.local + ## Ingress annotations done as key:value pairs ## For a full list of possible ingress annotations, please see ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md @@ -264,11 +267,11 @@ ingress: annotations: # kubernetes.io/ingress.class: nginx - ## The list of hostnames to be covered with this ingress record. - ## Most likely this will be just one host, but in the event more hosts are needed, this is an array - hosts: - - name: wordpress.local - path: / + ## The list of additional hostnames to be covered with this ingress record. + ## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array + ## hosts: + ## - name: wordpress.local + ## path: / ## The tls configuration for the ingress ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls