bases:
 - ../envs/environments.yaml.gotmpl

repositories:
  - name: metrics-server
    url: 'https://kubernetes-sigs.github.io/metrics-server/'

commonLabels:
  tier: system

releases:
- name: metrics-server
  namespace: kube-system
  chart: metrics-server/metrics-server
  version: 3.8.2
  condition: metrics_server.enabled
  values:
  - ../values/metrics-server/values/metrics-server.yaml.gotmpl
  - ../values/metrics-server/values/metrics-server-{{ .Environment.Name }}.yaml.gotmpl
  postRenderer: ../bin/kustomizer
  postRendererArgs:
  - ../values/metrics-server/kustomize/{{ .Environment.Name }}
  missingFileHandler: Info
- name: manifests
  namespace: kube-system
  chart: manifests
  condition: metrics_server.enabled
  missingFileHandler: Info
  values:
  - ../values/env.yaml
  - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml
  - ../values/metrics-server/env.yaml.gotmpl
  - ../values/metrics-server/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl
  hooks:
  - events: [ prepare, cleanup ]
    showlogs: true
    command: ../bin/helmify
    args:
    - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}'
    - '{{`{{ .Release.Chart }}`}}'
    - '{{`{{ .Environment.Name }}`}}'
    - ../values/metrics-server/manifests
    - manifests
