rancher-charts/charts/rancher-prometheus-adapter/2.12.101/templates/resource-metrics-apiservice...

33 lines
1.2 KiB
YAML
Raw Normal View History

2021-08-30 16:48:23 +00:00
{{- if .Values.rules.resource}}
{{- if .Capabilities.APIVersions.Has "apiregistration.k8s.io/v1" }}
apiVersion: apiregistration.k8s.io/v1
{{- else }}
apiVersion: apiregistration.k8s.io/v1beta1
{{- end }}
kind: APIService
metadata:
{{- if .Values.certManager.enabled }}
annotations:
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
{{- end }}
labels:
app: {{ template "k8s-prometheus-adapter.name" . }}
chart: {{ template "k8s-prometheus-adapter.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
name: v1beta1.metrics.k8s.io
spec:
service:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.tls.enable }}
caBundle: {{ b64enc .Values.tls.ca }}
{{- end }}
group: metrics.k8s.io
version: v1beta1
insecureSkipTLSVerify: {{ if or .Values.tls.enable .Values.certManager.enabled }}false{{ else }}true{{ end }}
groupPriorityMinimum: 100
versionPriority: 100
{{- end -}}