[bitnami/consul] Adding templating to ingress hostname to allow things like e.g. "some-nice-url-{{ .Release.Namespace }}.org" (#14057)

Signed-off-by: Markus Wagner <markus.wagner@vitagroup.ag>

Signed-off-by: Markus Wagner <markus.wagner@vitagroup.ag>
This commit is contained in:
Markus Wagner
2022-12-22 11:58:30 +01:00
committed by GitHub
parent 2a0303a6e6
commit 8dc6a5c71a
4 changed files with 8 additions and 8 deletions

View File

@@ -23,4 +23,4 @@ name: consul
sources:
- https://github.com/bitnami/containers/tree/main/bitnami/consul
- https://www.consul.io/
version: 10.9.7
version: 10.9.8

View File

@@ -35,8 +35,8 @@ In order to access to the Consul Web UI:
1. Get the Consul URL and associate its hostname to your cluster external IP:
export CLUSTER_IP=$(minikube ip) # On Minikube. Use: `kubectl cluster-info` on others K8s clusters
echo "Consul URL: http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}"
echo "$CLUSTER_IP {{ .Values.ingress.hostname }}" | sudo tee -a /etc/hosts
echo "Consul URL: http{{ if .Values.ingress.tls }}s{{ end }}://{{ tpl .Values.ingress.hostname . }}"
echo "$CLUSTER_IP {{ tpl .Values.ingress.hostname . }}" | sudo tee -a /etc/hosts
{{- else }}

View File

@@ -24,7 +24,7 @@ spec:
{{- end }}
rules:
{{- if .Values.ingress.hostname }}
- host: {{ .Values.ingress.hostname }}
- host: {{ tpl .Values.ingress.hostname . }}
http:
paths:
{{- if .Values.ingress.extraPaths }}
@@ -53,11 +53,11 @@ spec:
tls:
{{- if and .Values.ingress.tls (or .Values.ingress.existingSecret (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned) }}
- hosts:
- {{ .Values.ingress.hostname | quote }}
- {{ tpl .Values.ingress.hostname . | quote }}
{{- if .Values.ingress.existingSecret }}
secretName: {{ .Values.ingress.existingSecret }}
{{- else }}
secretName: {{ printf "%s-tls" .Values.ingress.hostname | trunc 63 | trimSuffix "-" }}
secretName: {{ printf "%s-tls" (tpl .Values.ingress.hostname .) | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- if .Values.ingress.extraTls }}

View File

@@ -21,11 +21,11 @@ data:
{{- end }}
{{- else if and .Values.ingress.tls .Values.ingress.selfSigned }}
{{- $ca := genCA "consul-ca" 365 }}
{{- $cert := genSignedCert .Values.ingress.hostname nil (list .Values.ingress.hostname) 365 $ca }}
{{- $cert := genSignedCert (tpl .Values.ingress.hostname .) nil (list (tpl .Values.ingress.hostname .)) 365 $ca }}
apiVersion: v1
kind: Secret
metadata:
name: {{ printf "%s-tls" .Values.ingress.hostname | trunc 63 | trimSuffix "-" }}
name: {{ printf "%s-tls" (tpl .Values.ingress.hostname .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}