# _helpers.tpl
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "k8s-prometheus-adapter.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "k8s-prometheus-adapter.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "k8s-prometheus-adapter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "k8s-prometheus-adapter.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
    {{ default (include "k8s-prometheus-adapter.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
    {{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
 # custom-metrics-apiserver-auth-delegator-cluster-role-binding.yaml
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}:system:auth-delegator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:auth-delegator
subjects:
- kind: ServiceAccount
  name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
  namespace: {{ .Release.Namespace | quote }}
{{- end -}}
 # custom-metrics-apiserver-auth-reader-role-binding.yaml
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-auth-reader
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
  name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
  namespace: {{ .Release.Namespace | quote }}
{{- end -}}
 # custom-metrics-apiserver-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.fullname" . }}
spec:
  replicas: {{ .Values.replicas }}
  selector:
    matchLabels:
      app: {{ template "k8s-prometheus-adapter.name" . }}
      release: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ template "k8s-prometheus-adapter.name" . }}
        chart: {{ template "k8s-prometheus-adapter.chart" . }}
        release: {{ .Release.Name }}
        heritage: {{ .Release.Service }}
        {{- with .Values.podLabels }}
        {{- toYaml . | trim | nindent 8 }}
        {{- end }}
      name: {{ template "k8s-prometheus-adapter.name" . }}
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/custom-metrics-configmap.yaml") . | sha256sum }}
        {{- with .Values.podAnnotations }}
        {{- toYaml . | trim | nindent 8 }}
        {{- end }}
    spec:
      serviceAccountName: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
      {{- if .Values.hostNetwork.enabled }}
      hostNetwork: true
      {{- end }}
      containers:
      - name: {{ .Chart.Name }}
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        args:
        - /adapter
        - --secure-port={{ .Values.listenPort }}
        {{- if .Values.tls.enable }}
        - --tls-cert-file=/var/run/serving-cert/tls.crt
        - --tls-private-key-file=/var/run/serving-cert/tls.key
        {{- end }}
        - --cert-dir=/tmp/cert
        - --logtostderr=true
        - --prometheus-url={{ .Values.prometheus.url }}{{ if .Values.prometheus.port }}:{{ .Values.prometheus.port }}{{end}}{{ .Values.prometheus.path }}
        - --metrics-relist-interval={{ .Values.metricsRelistInterval }}
        - --v={{ .Values.logLevel }}
        - --config=/etc/adapter/config.yaml
        ports:
        - containerPort: {{ .Values.listenPort }}
          name: https
        livenessProbe:
          httpGet:
            path: /healthz
            port: https
            scheme: HTTPS
          initialDelaySeconds: 30
        readinessProbe:
          httpGet:
            path: /healthz
            port: https
            scheme: HTTPS
          initialDelaySeconds: 30
        {{- if .Values.resources }}
        resources:
          {{- toYaml .Values.resources | nindent 10 }}
        {{- end }}
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop: ["all"]
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          runAsUser: 10001
        volumeMounts:
        {{- if .Values.extraVolumeMounts }}
        {{ toYaml .Values.extraVolumeMounts | trim | nindent 8 }}
        {{ end }}
        - mountPath: /etc/adapter/
          name: config
          readOnly: true
        - mountPath: /tmp
          name: tmp
        {{- if .Values.tls.enable }}
        - mountPath: /var/run/serving-cert
          name: volume-serving-cert
          readOnly: true
        {{- end }}
      nodeSelector:
        {{- toYaml .Values.nodeSelector | nindent 8 }}
      affinity:
        {{- toYaml .Values.affinity | nindent 8 }}
      priorityClassName: {{ .Values.priorityClassName }}
      tolerations:
        {{- toYaml .Values.tolerations | nindent 8 }}
      {{- if .Values.image.pullSecrets }}
      imagePullSecrets:
        {{- range .Values.image.pullSecrets }}
        - name: {{ . }}
        {{- end }}
      {{- end }}
      volumes:
      {{- if .Values.extraVolumes  }}
      {{ toYaml .Values.extraVolumes | trim | nindent 6 }}
      {{ end }}
      - name: config
        configMap:
          name: {{ .Values.rules.existing | default (include "k8s-prometheus-adapter.fullname" . ) }}
      - name: tmp
        emptyDir: {}
      {{- if .Values.tls.enable }}
      - name: volume-serving-cert
        secret:
          secretName: {{ template "k8s-prometheus-adapter.fullname" . }}
      {{- end }}
 # custom-metrics-apiserver-resource-reader-cluster-role-binding.yaml
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-resource-reader
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "k8s-prometheus-adapter.name" . }}-resource-reader
subjects:
- kind: ServiceAccount
  name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
  namespace: {{ .Release.Namespace | quote }}
{{- end -}}
 # custom-metrics-apiserver-service-account.yaml
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
{{- end -}}
 # custom-metrics-apiserver-service.yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.fullname" . }}
spec:
  ports:
  - port: {{ .Values.service.port }}
    protocol: TCP
    targetPort: https
  selector:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    release: {{ .Release.Name }}
  type: {{ .Values.service.type }}

 # custom-metrics-apiservice.yaml
{{- if or .Values.rules.default .Values.rules.custom }}
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: v1beta1.custom.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: custom.metrics.k8s.io
  version: v1beta1
  insecureSkipTLSVerify: {{ if .Values.tls.enable }}false{{ else }}true{{ end }}
  groupPriorityMinimum: 100
  versionPriority: 100
{{- end }}
 # custom-metrics-cluster-role.yaml
{{- if and .Values.rbac.create (or .Values.rules.default .Values.rules.custom) -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-server-resources
rules:
- apiGroups:
  - custom.metrics.k8s.io
  resources: ["*"]
  verbs: ["*"]
{{- end -}}
 # custom-metrics-configmap.yaml
{{- if not .Values.rules.existing -}}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "k8s-prometheus-adapter.fullname" . }}
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  config.yaml: |
{{- if or .Values.rules.default .Values.rules.custom }}
    rules:
{{- if .Values.rules.default }}
    - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}'
      seriesFilters: []
      resources:
        overrides:
          namespace:
            resource: namespace
          pod:
            resource: pod
      name:
        matches: ^container_(.*)_seconds_total$
        as: ""
      metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>,container!="POD"}[5m]))
        by (<<.GroupBy>>)
    - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}'
      seriesFilters:
      - isNot: ^container_.*_seconds_total$
      resources:
        overrides:
          namespace:
            resource: namespace
          pod:
            resource: pod
      name:
        matches: ^container_(.*)_total$
        as: ""
      metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>,container!="POD"}[5m]))
        by (<<.GroupBy>>)
    - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}'
      seriesFilters:
      - isNot: ^container_.*_total$
      resources:
        overrides:
          namespace:
            resource: namespace
          pod:
            resource: pod
      name:
        matches: ^container_(.*)$
        as: ""
      metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>,container!="POD"}) by (<<.GroupBy>>)
    - seriesQuery: '{namespace!="",__name__!~"^container_.*"}'
      seriesFilters:
      - isNot: .*_total$
      resources:
        template: <<.Resource>>
      name:
        matches: ""
        as: ""
      metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)
    - seriesQuery: '{namespace!="",__name__!~"^container_.*"}'
      seriesFilters:
      - isNot: .*_seconds_total
      resources:
        template: <<.Resource>>
      name:
        matches: ^(.*)_total$
        as: ""
      metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>}[5m])) by (<<.GroupBy>>)
    - seriesQuery: '{namespace!="",__name__!~"^container_.*"}'
      seriesFilters: []
      resources:
        template: <<.Resource>>
      name:
        matches: ^(.*)_seconds_total$
        as: ""
      metricsQuery: sum(rate(<<.Series>>{<<.LabelMatchers>>}[5m])) by (<<.GroupBy>>)
{{- end -}}
{{- if .Values.rules.custom }}
{{ toYaml .Values.rules.custom | indent 4 }}
{{- end -}}
{{- end -}}
{{- if .Values.rules.external }}
    externalRules:
{{ toYaml .Values.rules.external | indent 4 }}
{{- end -}}
{{- if .Values.rules.resource }}
    resourceRules:
{{ toYaml .Values.rules.resource | indent 6 }}
{{- end -}}
{{- end -}}
 # custom-metrics-resource-reader-cluster-role.yaml
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-resource-reader
rules:
- apiGroups:
  - ""
  resources:
  - namespaces
  - pods
  - services
  - configmaps
  verbs:
  - get
  - list
  - watch
{{- end -}}
 # external-metrics-apiservice.yaml
{{- if .Values.rules.external }}
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: v1beta1.external.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: external.metrics.k8s.io
  version: v1beta1
  insecureSkipTLSVerify: {{ if .Values.tls.enable }}false{{ else }}true{{ end }}
  groupPriorityMinimum: 100
  versionPriority: 100
{{- end -}}
 # external-metrics-cluster-role.yaml
{{- if and .Values.rbac.create .Values.rules.external -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-external-metrics
rules:
- apiGroups:
  - "external.metrics.k8s.io"
  resources:
  - "*"
  verbs:
  - list
  - get
  - watch
{{- end -}}
 # hpa-custom-metrics-cluster-role-binding.yaml
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-hpa-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "k8s-prometheus-adapter.name" . }}-server-resources
subjects:
- kind: ServiceAccount
  name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
  namespace: {{ .Release.Namespace | quote }}
{{- end -}}
 # hpa-external-metrics-cluster-role-binding.yaml
{{- if and .Values.rbac.create .Values.rules.external -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-hpa-controller-external-metrics
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "k8s-prometheus-adapter.name" . }}-external-metrics
subjects:
- kind: ServiceAccount
  name: horizontal-pod-autoscaler
  namespace: kube-system
{{- end -}}
 # resource-metrics-apiservice.yaml
{{- if .Values.rules.resource}}
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
  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 .Values.tls.enable }}false{{ else }}true{{ end }}
  groupPriorityMinimum: 100
  versionPriority: 100
{{- end -}}
 # resource-metrics-cluster-role-binding.yaml
{{- if and .Values.rbac.create .Values.rules.resource -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-hpa-controller-metrics
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "k8s-prometheus-adapter.name" . }}-metrics
subjects:
- kind: ServiceAccount
  name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
  namespace: {{ .Release.Namespace | quote }}
{{- end -}}
 # resource-metrics-cluster-role.yaml
{{- if and .Values.rbac.create .Values.rules.resource -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.name" . }}-metrics
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - nodes
  - nodes/stats
  verbs:
  - get
  - list
  - watch
{{- end -}}
 # secret.yaml
{{- if .Values.tls.enable -}}
apiVersion: v1
kind: Secret
metadata:
  labels:
    app: {{ template "k8s-prometheus-adapter.name" . }}
    chart: {{ template "k8s-prometheus-adapter.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "k8s-prometheus-adapter.fullname" . }}
type: kubernetes.io/tls
data:
  tls.crt: {{ b64enc .Values.tls.certificate }}
  tls.key: {{ b64enc .Values.tls.key }}
{{- end -}}

# Default values for k8s-prometheus-adapter..
affinity: {}

image:
  repository: directxman12/k8s-prometheus-adapter-amd64
  tag: v0.7.0
  pullPolicy: IfNotPresent

logLevel: 4

metricsRelistInterval: 1m

listenPort: 6443

nodeSelector: {}

priorityClassName: ""

# Url to access prometheus
prometheus:
  url: http://prometheus.default.svc
  port: 9090
  path: ""

replicas: 1

rbac:
  # Specifies whether RBAC resources should be created
  create: true

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name:

resources: {}
  # requests:
  #   cpu: 100m
  #   memory: 128Mi
  # limits:
  #   cpu: 100m
  #   memory: 128Mi

rules:
  default: true
  custom: []
# - seriesQuery: '{__name__=~"^some_metric_count$"}'
#   resources:
#     template: <<.Resource>>
#   name:
#     matches: ""
#     as: "my_custom_metric"
#   metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)
  # Mounts a configMap with pre-generated rules for use. Overrides the
  # default, custom, external and resource entries
  existing:
  external: []
# - seriesQuery: '{__name__=~"^some_metric_count$"}'
#   resources:
#     template: <<.Resource>>
#   name:
#     matches: ""
#     as: "my_external_metric"
#   metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)
  resource: {}
#   cpu:
#     containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>)
#     nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>)
#     resources:
#       overrides:
#         instance:
#           resource: node
#         namespace:
#           resource: namespace
#         pod:
#           resource: pod
#     containerLabel: container
#   memory:
#     containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>)
#     nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>)
#     resources:
#       overrides:
#         instance:
#           resource: node
#         namespace:
#           resource: namespace
#         pod:
#           resource: pod
#     containerLabel: container
#   window: 3m

service:
  annotations: {}
  port: 443
  type: ClusterIP

tls:
  enable: false
  ca: |-
    # Public CA file that signed the APIService
  key: |-
    # Private key of the APIService
  certificate: |-
    # Public key of the APIService

# Any extra volumes
extraVolumes: []
  # - name: example-name
  #   hostPath:
  #     path: /path/on/host
  #     type: DirectoryOrCreate
  # - name: ssl-certs
  #   hostPath:
  #     path: /etc/ssl/certs/ca-bundle.crt
  #     type: File

# Any extra volume mounts
extraVolumeMounts: []
  #   - name: example-name
  #     mountPath: /path/in/container
  #   - name: ssl-certs
  #     mountPath: /etc/ssl/certs/ca-certificates.crt
  #     readOnly: true

tolerations: []

# Labels added to the pod
podLabels: {}

# Annotations added to the pod
podAnnotations: {}

hostNetwork:
  # Specifies if prometheus-adapter should be started in hostNetwork mode.
  #
  # You would require this enabled if you use alternate overlay networking for pods and
  # API server unable to communicate with metrics-server. As an example, this is required
  # if you use Weave network on EKS
  enabled: false
