apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: metrics-server
  namespace: argocd
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  destination:
    namespace: kube-system
    server: 'https://kubernetes.default.svc'
  source:
    repoURL: 'https://kubernetes-sigs.github.io/metrics-server/'
    targetRevision: {{ .Values.metrics_server.version }}
    chart: metrics-server
    helm:
      values: |
        containerPort: 10250
        resources: 
          requests:
            cpu: 100m
            memory: 200Mi
        {{- if .Values.metrics_server.ignoreTLS }}
        args:
          - "--kubelet-insecure-tls"
        {{- end }}
  project: sys
  syncPolicy:
    managedNamespaceMetadata:
      labels:
        component: sys
    syncOptions:
      - CreateNamespace=true
      - ApplyOutOfSyncOnly=true
    {{- if .Values.metrics_server.autosync }}
    automated:
      prune: true
      # selfHeal: false
    {{- end }}
