diff --git a/stable/phpmyadmin/Chart.yaml b/stable/phpmyadmin/Chart.yaml index a24416249c..b3fd8d3454 100644 --- a/stable/phpmyadmin/Chart.yaml +++ b/stable/phpmyadmin/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: phpmyadmin -version: 4.2.12 +version: 4.3.0 appVersion: 5.0.1 description: phpMyAdmin is an mysql administration frontend keywords: diff --git a/stable/phpmyadmin/README.md b/stable/phpmyadmin/README.md index d31721506d..93d0d265ee 100644 --- a/stable/phpmyadmin/README.md +++ b/stable/phpmyadmin/README.md @@ -69,7 +69,8 @@ The following table lists the configurable parameters of the phpMyAdmin chart an | `db.ssl.verify` | Enable SSL certificate validation | `true` | | `ingress.enabled` | Enable ingress controller resource | `false` | | `ingress.certManager` | Add annotations for cert-manager | `false` | -| `ingress.annotations` | Ingress annotations | `{ingress.kubernetes.io/rewrite-target: /, nginx.ingress.kubernetes.io/rewrite-target: /}` | +| `ingress.rewriteTarget` | Add annotations to redirect traffic to `/` | `true` | +| `ingress.annotations` | Ingress annotations | `{}` | | `ingress.hosts[0].name` | Hostname to your PHPMyAdmin installation | `phpmyadmin.local` | | `ingress.hosts[0].path` | Path within the url structure | `/` | | `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | diff --git a/stable/phpmyadmin/templates/_helpers.tpl b/stable/phpmyadmin/templates/_helpers.tpl index ea6e506a3f..bd6ded0f56 100644 --- a/stable/phpmyadmin/templates/_helpers.tpl +++ b/stable/phpmyadmin/templates/_helpers.tpl @@ -128,6 +128,18 @@ imagePullSecrets: {{- end -}} {{- end -}} +{{/* +Renders a value that contains template. +Usage: +{{ include "phpmyadmin.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }} +*/}} +{{- define "phpmyadmin.tplValue" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} {{/* Compile all warnings into a single message, and call fail. diff --git a/stable/phpmyadmin/templates/ingress.yaml b/stable/phpmyadmin/templates/ingress.yaml index 2f9e2b7a6f..49b36d8fbe 100644 --- a/stable/phpmyadmin/templates/ingress.yaml +++ b/stable/phpmyadmin/templates/ingress.yaml @@ -12,8 +12,12 @@ metadata: {{- if .Values.ingress.certManager }} kubernetes.io/tls-acme: "true" {{- end }} - {{- range $key, $value := .Values.ingress.annotations }} - {{ $key }}: {{ $value | quote }} + {{- if .Values.ingress.rewriteTarget }} + ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/rewrite-target: / + {{- end }} + {{- if .Values.ingress.annotations }} + {{- include "phpmyadmin.tplValue" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }} {{- end }} spec: rules: diff --git a/stable/phpmyadmin/values.yaml b/stable/phpmyadmin/values.yaml index d2b01b9328..41c68be436 100644 --- a/stable/phpmyadmin/values.yaml +++ b/stable/phpmyadmin/values.yaml @@ -79,22 +79,25 @@ db: verify: true ingress: - ## Set to true to enable ingress record generation + ## Set this to true to enable ingress record generation ## enabled: false ## Set this to true in order to add the corresponding annotations for cert-manager + ## certManager: false - ## Ingress annotations done as key:value pairs - ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set - ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md + ## Set this to true in order to add the corresponding annotations to redirect traffic to / ## - annotations: - ingress.kubernetes.io/rewrite-target: / - nginx.ingress.kubernetes.io/rewrite-target: / - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" + rewriteTarget: true + + ## Additional Ingress annotations done as key:value pairs + ## Example: + ## annotations: + ## kubernetes.io/ingress.class: nginx + ## kubernetes.io/tls-acme: "true" + ## + # annotations ## 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