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

---
releases:
  - name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
    namespace: {{ $.Values.oauth2_proxy.namespace }}
    chart: charts/oauth2-proxy
    condition: oauth2_proxy.enabled
    values:
      - nameSuffix: -{{ $.Values.oauth2_proxy.name }}
        images:
          - name: oauth2-proxy
            newName: {{ $.Values.oauth2_proxy.image | quote }}
    jsonPatches:
      - target:
          version: v1
          group: apps
          kind: Deployment
          namespace: {{ $.Values.oauth2_proxy.namespace }}
          name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
        patch:
          - op: replace
            path: /metadata/labels/app
            value: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
          - op: replace
            path: /spec/selector/matchLabels/app
            value: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
          - op: replace
            path: /spec/template/metadata/labels/app
            value: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
      - target:
          version: v1
          kind: Service
          namespace: {{ $.Values.oauth2_proxy.namespace }}
          name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
        patch:
          - op: replace
            path: /spec/selector/app
            value: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
    strategicMergePatches:
      - apiVersion: v1
        kind: ConfigMap
        metadata:
          namespace: {{ $.Values.oauth2_proxy.namespace }}
          name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
        data:
          {{ $.Values.oauth2_proxy.config | toYaml | nindent 12 }}
      - apiVersion: v1
        kind: Secret
        metadata:
          namespace: {{ $.Values.oauth2_proxy.namespace }}
          name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
        stringData:
          {{ $.Values.oauth2_proxy.secret | toYaml | nindent 12 }}