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

---
releases:
  - name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
    namespace: oauth2-proxy
    chart: charts/oauth2-proxy
    condition: oauth2_proxy.enabled
    values:
      - nameSuffix: -{{ $.Values.oauth2_proxy.name }}
      - {{ .Values.oauth2_proxy.config | toYaml | nindent 8 }}
    jsonPatches:
      - target:
          version: v1
          group: apps
          kind: Deployment
          namespace: oauth2-proxy
          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: oauth2-proxy
          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: oauth2-proxy
          name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
        data:
          {{ $.Values.oauth2_proxy.config | toYaml | nindent 12 }}
      - apiVersion: v1
        kind: Secret
        metadata:
          namespace: oauth2-proxy
          name: oauth2-proxy-{{ $.Values.oauth2_proxy.name }}
        data:
          {{ $.Values.oauth2_proxy.secret | toYaml | nindent 12 }}