{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if .Values.apiService.create -}}
apiVersion: {{ include "common.capabilities.apiService.apiVersion" . }}
kind: APIService
metadata:
  name: v1beta1.metrics.k8s.io
  labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
spec:
  service:
    name: {{ template "common.names.fullname" . }}
    namespace: {{ include "common.names.namespace" . | quote }}
  group: metrics.k8s.io
  version: v1beta1
  insecureSkipTLSVerify: {{ .Values.apiService.insecureSkipTLSVerify | default true }}
  {{- if .Values.apiService.caBundle }}
  caBundle: {{ .Values.apiService.caBundle }}
  {{- end }}
  groupPriorityMinimum: 100
  versionPriority: 100
{{- end -}}
