charts/library/common/templates/_istio.yaml

64 lines
1.3 KiB
YAML

{{- define "common.istio" }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ .Values.common.fullname }}-cert
namespace: istio-system
spec:
secretName: {{ .Values.common.fullname }}-cert
commonName: {{ first .Values.common.domains }}
dnsNames:
{{- range $d := .Values.common.domains }}
- {{ $d }}
{{- end }}
issuerRef:
name: {{ .Values.common.domainIssuer }}
kind: ClusterIssuer
group: cert-manager.io
...
---
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: {{ .Values.common.fullname }}-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: https
protocol: HTTPS
tls:
mode: SIMPLE
credentialName: {{ .Values.common.fullname }}-cert
hosts:
{{- range $d := .Values.common.domains }}
- {{ $d }}
{{- end }}
...
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: {{ .Values.common.fullname }}-gateway
spec:
hosts:
{{- range $d := .Values.common.domains }}
- {{ $d }}
{{- end }}
gateways:
- {{ .Values.common.fullname }}-gateway
http:
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
host: {{ .Values.common.fullname }}
...
{{- end }}