{{- define "istio-values" }}
istio-discovery:
  telemetry:
    enabled: {{ .Values.metrics.enabled }}
{{- if .Values.HighAvailableControlplane }}
  pilot:
    replicaCount: 2
global:
  defaultPodDisruptionBudget:
    enabled: true
{{- end }}
{{- end }}


{{- define "istio-argo" }}
  ignoreDifferences:
  - group: apiextensions.k8s.io
    kind: CustomResourceDefinition
    jsonPointers:
    - /metadata/labels
    - /spec/additionalPrinterColumns
  - group: admissionregistration.k8s.io
    kind: ValidatingWebhookConfiguration
    jsonPointers:
    - /webhooks/0/clientConfig/caBundle
    - /webhooks/0/failurePolicy
  - group: admissionregistration.k8s.io
    kind: MutatingWebhookConfiguration
    jsonPointers:
    - /webhooks/0/clientConfig/caBundle
    - /webhooks/1/clientConfig/caBundle
    - /webhooks/2/clientConfig/caBundle
    - /webhooks/3/clientConfig/caBundle

{{- end }}

{{ include "kubezero-app.app" . }}
