From 70190d63dfdf5ef0b7ffbb6640114b09a41caa09 Mon Sep 17 00:00:00 2001 From: macmoritz <49832924+macmoritz@users.noreply.github.com> Date: Fri, 20 Jan 2023 12:49:56 +0100 Subject: [PATCH] [bitnami/wordpress] feature: add www subdomain to ingress.tls.hosts (#14400) * feature: add www subdomain to ingress.tls.hosts Signed-off-by: moritz * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers Signed-off-by: moritz * increase chart version; add auto enable tlsWwwPrefix if from-to-www-redirect Signed-off-by: moritz * Update Chart.yaml Signed-off-by: corico44 <42420333+corico44@users.noreply.github.com> Signed-off-by: moritz Signed-off-by: Bitnami Containers Signed-off-by: corico44 <42420333+corico44@users.noreply.github.com> Co-authored-by: moritz Co-authored-by: Bitnami Containers Co-authored-by: corico44 <42420333+corico44@users.noreply.github.com> --- bitnami/wordpress/Chart.yaml | 2 +- bitnami/wordpress/README.md | 1 + bitnami/wordpress/templates/ingress.yaml | 3 +++ bitnami/wordpress/values.yaml | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bitnami/wordpress/Chart.yaml b/bitnami/wordpress/Chart.yaml index c285beef77..b6ae1ced9a 100644 --- a/bitnami/wordpress/Chart.yaml +++ b/bitnami/wordpress/Chart.yaml @@ -35,4 +35,4 @@ name: wordpress sources: - https://github.com/bitnami/containers/tree/main/bitnami/wordpress - https://wordpress.org/ -version: 15.2.31 +version: 15.2.32 \ No newline at end of file diff --git a/bitnami/wordpress/README.md b/bitnami/wordpress/README.md index 199312bc30..eba0dbedb6 100644 --- a/bitnami/wordpress/README.md +++ b/bitnami/wordpress/README.md @@ -231,6 +231,7 @@ The command removes all the Kubernetes components associated with the chart and | `ingress.path` | Default path for the ingress record | `/` | | `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | | `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` | +| `ingress.tlsWwwPrefix` | Adds www subdomain to default cert | `false` | | `ingress.selfSigned` | Create a TLS secret for this ingress record using self-signed certificates generated by Helm | `false` | | `ingress.extraHosts` | An array with additional hostname(s) to be covered with the ingress record | `[]` | | `ingress.extraPaths` | An array with additional arbitrary paths that may need to be added to the ingress under the main host | `[]` | diff --git a/bitnami/wordpress/templates/ingress.yaml b/bitnami/wordpress/templates/ingress.yaml index fa1b8db2d2..7cb0a9add0 100755 --- a/bitnami/wordpress/templates/ingress.yaml +++ b/bitnami/wordpress/templates/ingress.yaml @@ -51,6 +51,9 @@ spec: {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned) }} - hosts: - {{ .Values.ingress.hostname | quote }} + {{- if or (.Values.ingress.tlsWwwPrefix) (eq (index .Values.ingress.annotations "nginx.ingress.kubernetes.io/from-to-www-redirect") "true" ) }} + - {{ print "www.%s" .Values.ingress.hostname }} + {{- end }} secretName: {{ printf "%s-tls" .Values.ingress.hostname }} {{- end }} {{- if .Values.ingress.extraTls }} diff --git a/bitnami/wordpress/values.yaml b/bitnami/wordpress/values.yaml index f6838259dd..d69fabb225 100644 --- a/bitnami/wordpress/values.yaml +++ b/bitnami/wordpress/values.yaml @@ -629,6 +629,10 @@ ingress: ## - Rely on Helm to create self-signed certificates by setting `ingress.selfSigned=true` ## tls: false + ## @param ingress.tlsWwwPrefix Adds www subdomain to default cert + ## Creates tls host with ingress.hostname: {{ print "www.%s" .Values.ingress.hostname }} + ## Is enabled if "nginx.ingress.kubernetes.io/from-to-www-redirect" is "true" + tlsWwwPrefix: false ## @param ingress.selfSigned Create a TLS secret for this ingress record using self-signed certificates generated by Helm ## selfSigned: false