First Commit
This commit is contained in:
87
templates/redisinsight-istio.yaml
Normal file
87
templates/redisinsight-istio.yaml
Normal file
@@ -0,0 +1,87 @@
|
||||
{{- if and .Values.redisInsight.enabled .Values.redisInsight.ingress.enabled }}
|
||||
{{- if not .Values.redisInsight.ingress.host }}
|
||||
{{- fail "redisInsight.ingress.host is required when RedisInsight ingress is enabled" }}
|
||||
{{- end }}
|
||||
{{- if and .Values.redisInsight.ingress.tls.enabled (not .Values.redisInsight.ingress.tls.credentialName) }}
|
||||
{{- fail "redisInsight.ingress.tls.credentialName is required when TLS is enabled" }}
|
||||
{{- end }}
|
||||
{{- if and .Values.redisInsight.ingress.tls.certificate.create (not .Values.redisInsight.ingress.tls.enabled) }}
|
||||
{{- fail "redisInsight.ingress.tls.enabled must be true when certificate.create is true" }}
|
||||
{{- end }}
|
||||
{{- if and .Values.redisInsight.ingress.tls.certificate.create (not .Values.redisInsight.ingress.tls.certificate.issuerName) }}
|
||||
{{- fail "redisInsight.ingress.tls.certificate.issuerName is required when certificate.create is true" }}
|
||||
{{- end }}
|
||||
{{- if and .Values.redisInsight.ingress.tls.enabled .Values.redisInsight.ingress.tls.certificate.create }}
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ include "redis-cluster.redisInsightName" . }}-tls
|
||||
namespace: {{ default .Release.Namespace .Values.redisInsight.ingress.tls.certificate.secretNamespace }}
|
||||
labels:
|
||||
{{- include "redis-cluster.redisInsightLabels" . | nindent 4 }}
|
||||
spec:
|
||||
secretName: {{ .Values.redisInsight.ingress.tls.credentialName }}
|
||||
issuerRef:
|
||||
name: {{ .Values.redisInsight.ingress.tls.certificate.issuerName }}
|
||||
kind: {{ .Values.redisInsight.ingress.tls.certificate.issuerKind }}
|
||||
commonName: {{ .Values.redisInsight.ingress.host | quote }}
|
||||
dnsNames:
|
||||
- {{ .Values.redisInsight.ingress.host | quote }}
|
||||
---
|
||||
{{- end }}
|
||||
apiVersion: networking.istio.io/v1beta1
|
||||
kind: Gateway
|
||||
metadata:
|
||||
name: {{ include "redis-cluster.redisInsightName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "redis-cluster.redisInsightLabels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
{{- toYaml .Values.redisInsight.ingress.gatewaySelector | nindent 4 }}
|
||||
servers:
|
||||
- port:
|
||||
number: 80
|
||||
name: http
|
||||
protocol: HTTP
|
||||
hosts:
|
||||
- {{ .Values.redisInsight.ingress.host | quote }}
|
||||
{{- if .Values.redisInsight.ingress.tls.enabled }}
|
||||
tls:
|
||||
httpsRedirect: true
|
||||
{{- end }}
|
||||
{{- if .Values.redisInsight.ingress.tls.enabled }}
|
||||
- port:
|
||||
number: 443
|
||||
name: https
|
||||
protocol: HTTPS
|
||||
hosts:
|
||||
- {{ .Values.redisInsight.ingress.host | quote }}
|
||||
tls:
|
||||
mode: SIMPLE
|
||||
credentialName: {{ .Values.redisInsight.ingress.tls.credentialName }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: networking.istio.io/v1beta1
|
||||
kind: VirtualService
|
||||
metadata:
|
||||
name: {{ include "redis-cluster.redisInsightName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "redis-cluster.redisInsightLabels" . | nindent 4 }}
|
||||
spec:
|
||||
hosts:
|
||||
- {{ .Values.redisInsight.ingress.host | quote }}
|
||||
gateways:
|
||||
- {{ include "redis-cluster.redisInsightName" . }}
|
||||
http:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
timeout: {{ .Values.redisInsight.ingress.requestTimeout }}
|
||||
route:
|
||||
- destination:
|
||||
host: {{ include "redis-cluster.redisInsightName" . }}
|
||||
port:
|
||||
number: 80
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user