helmfile.yaml 2.62 KB
bases:
  - ../common/environments.yaml

repositories:
  - name: istio
    url: https://istio-release.storage.googleapis.com/charts
  - name: bedag
    url: https://bedag.github.io/helm-charts/

---
helmfiles:
  - path: istio-base.helmfile.yaml
    values:
      - namespace: {{ .Values.namespace }}
        namePrefix: ""
        version: {{ .Values.version.istio }}
  - path: istiod.helmfile.yaml
    values:
      - namespace: {{ .Values.namespace }}
        namePrefix: ""
        version: {{ .Values.version.istio }}

releases:
  - name: {{ $.Values.namePrefix }}gateways
    namespace: {{ .Values.namespace }}
    chart: charts/gateway
    dependencies:
      {{- range $gateway_index, $gateway := .Values.gateways }}
      - chart: istio/gateway
        alias: gatewayd-{{ $gateway.name }}
        version: {{ $.Values.version.istio }}
      - chart: bedag/raw
        alias: gateway-{{ $gateway.name }}
        version: {{ $.Values.version.raw }}
      {{- end }}
    values:
      {{- range $gateway_index, $gateway := .Values.gateways }}
      - gatewayd-{{ $gateway.name }}:
          name: {{ $gateway.name }}
          service:
            type: LoadBalancer
            loadBalancerIP: {{ $gateway | get "loadBalancerIP" "" }}
          autoscaling:
            enabled: false
        gateway-{{ $gateway.name }}:
          resources:
            - apiVersion: cert-manager.io/v1
              kind: Certificate
              metadata:
                name: istio-cert-{{ $gateway.name }}
              spec:
                secretName: istio-cert-{{ $gateway.name }}
                dnsNames:
                - '*'
                issuerRef:
                  name: ca-issuer
                  # We can reference ClusterIssuers by changing the kind here.
                  # The default value is Issuer (i.e. a locally namespaced Issuer)
                  kind: ClusterIssuer
                  group: cert-manager.io

            - apiVersion: networking.istio.io/v1beta1
              kind: Gateway
              metadata:
                name: {{ $gateway.name }}
              spec:
                selector:
                  istio: {{ $gateway.name }}
                servers:
                - hosts:
                  - '*'
                  port:
                    name: http
                    number: 80
                    protocol: HTTP
                - hosts:
                  - '*'
                  port:
                    name: https
                    number: 443
                    protocol: HTTPS
                  tls:
                    credentialName: istio-cert-{{ $gateway.name }}
                    mode: SIMPLE

      {{- end }}