You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2023/03/06 11:56:46 UTC
[dubbo-admin] branch refactor-with-go updated: initial charts (#1015)
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch refactor-with-go
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git
The following commit(s) were added to refs/heads/refactor-with-go by this push:
new b9775b58 initial charts (#1015)
b9775b58 is described below
commit b9775b5890b68e241cff98da7b574de498730ad2
Author: mfordjody <11...@qq.com>
AuthorDate: Mon Mar 6 19:56:39 2023 +0800
initial charts (#1015)
---
.../charts/grafana/templates/_helpers.tpl | 219 ---
.../admin-stack/charts/nacos/templates/NOTES.txt | 0
.../admin-stack/charts/prometheus/.helmignore | 23 +
.../admin-stack/charts/prometheus/Chart.yaml | 28 +
.../prometheus/charts/alertmanager/.helmignore | 23 +
.../prometheus/charts/alertmanager/Chart.yaml | 30 +
.../charts/alertmanager/templates/_charts.tpl | 51 +
.../charts/alertmanager/templates/clusterrole.yaml | 36 +
.../alertmanager/templates/clusterrolebinding.yaml | 35 +
.../charts/alertmanager/templates/configmap.yaml | 34 +
.../charts/alertmanager/templates/deploy.yaml | 219 +++
.../charts/alertmanager/templates/ingress.yaml | 72 +
.../alertmanager/templates/networkpolicy.yaml | 35 +
.../charts/alertmanager/templates/pdb.yaml | 29 +
.../charts/alertmanager/templates/psp.yaml | 61 +
.../charts/alertmanager/templates/pvc.yaml | 52 +
.../charts/alertmanager/templates/role.yaml | 39 +
.../charts/alertmanager/templates/rolebinding.yaml | 38 +
.../charts/alertmanager/templates/service.yaml | 68 +
.../alertmanager/templates/serviceaccount.yaml | 26 +
.../charts/alertmanager/templates/sts.yaml | 196 +++
.../alertmanager/templates/svc-headless.yaml | 46 +
.../prometheus/charts/alertmanager/values.yaml | 457 ++++++
.../charts/kube-state-metrics/.helmignore | 23 +
.../charts/kube-state-metrics/Chart.yaml | 39 +
.../kube-state-metrics/templates/_charts.tpl | 82 ++
.../templates/clusterrolebinding.yaml | 35 +
.../kube-state-metrics/templates/deployment.yaml | 163 +++
.../templates/kubeconfig-secret.yaml | 27 +
.../charts/kube-state-metrics/templates/pdb.yaml | 29 +
.../templates/podsecuritypolicy.yaml | 54 +
.../templates/psp-clusterrole.yaml | 34 +
.../templates/psp-clusterrolebinding.yaml | 31 +
.../charts/kube-state-metrics/templates/role.yaml | 202 +++
.../kube-state-metrics/templates/rolebinding.yaml | 39 +
.../kube-state-metrics/templates/service.yaml | 50 +
.../templates/serviceaccount.yaml | 30 +
.../templates/servicemonitor.yaml | 81 ++
.../templates/stsdiscovery-role.yaml | 41 +
.../templates/stsdiscovery-rolebinding.yaml | 32 +
.../charts/kube-state-metrics/values.yaml | 239 ++++
.../prometheus/charts/node-exporter/.helmignore | 23 +
.../prometheus/charts/node-exporter/Chart.yaml | 31 +
.../charts/node-exporter/templates/_charts.tpl | 113 ++
.../charts/node-exporter/templates/daemonset.yaml | 240 ++++
.../charts/node-exporter/templates/endpoints.yaml | 33 +
.../node-exporter/templates/psp-clusterrole.yaml | 29 +
.../templates/psp-clusterrolebinding.yaml | 31 +
.../charts/node-exporter/templates/psp.yaml | 64 +
.../charts/node-exporter/templates/service.yaml | 38 +
.../node-exporter/templates/serviceaccount.yaml | 32 +
.../node-exporter/templates/servicemonitor.yaml | 68 +
.../templates/verticalpodautoscaler.yaml | 49 +
.../prometheus/charts/node-exporter/values.yaml | 410 ++++++
.../prometheus/charts/pushgateway/.helmignore | 23 +
.../prometheus/charts/pushgateway/Chart.yaml | 29 +
.../charts/pushgateway/templates/_charts.tpl | 167 +++
.../charts/pushgateway/templates/deployment.yaml | 45 +
.../charts/pushgateway/templates/ingress.yaml | 64 +
.../pushgateway/templates/networkpolicy.yaml | 40 +
.../charts/pushgateway/templates/pdb.yaml | 28 +
.../pushgateway/templates/pushgateway-pvc.yaml | 43 +
.../charts/pushgateway/templates/service.yaml | 55 +
.../pushgateway/templates/serviceaccount.yaml | 30 +
.../pushgateway/templates/servicemonitor.yaml | 64 +
.../charts/pushgateway/templates/statefulset.yaml | 66 +
.../prometheus/charts/pushgateway/values.yaml | 336 +++++
.../charts/prometheus/templates/_charts.tpl | 94 ++
.../charts/prometheus/templates/clusterrole.yaml | 63 +
.../prometheus/templates/clusterrolebinding.yaml | 31 +
.../charts/prometheus/templates/cm.yaml | 100 ++
.../charts/prometheus/templates/deploy.yaml | 331 +++++
.../charts/prometheus/templates/ingress.yaml | 74 +
.../charts/prometheus/templates/networkpolicy.yaml | 33 +
.../charts/prometheus/templates/pdb.yaml | 29 +
.../charts/prometheus/templates/psp.yaml | 66 +
.../charts/prometheus/templates/pvc.yaml | 54 +
.../charts/prometheus/templates/rolebinding.yaml | 34 +
.../charts/prometheus/templates/service.yaml | 75 +
.../prometheus/templates/serviceaccount.yaml | 28 +
.../charts/prometheus/templates/sts.yaml | 313 +++++
.../charts/prometheus/templates/svc-headless.yaml | 52 +
.../templates/verticalpodautoscaler.yaml | 39 +
.../admin-stack/charts/prometheus/values.yaml | 1481 ++++++++++++++++++++
.../charts/zookeeper/templates/NOTES.txt | 0
.../charts/zookeeper/templates/_helpers.tpl | 62 -
.../_helpers.tpl => templates/apps/_admin.tpl} | 78 +-
.../_pod.tpl => templates/apps/_grafana.tpl} | 214 ++-
.../templates/apps/_kube-state-metrics.tpl | 10 +
.../_helpers.tpl => templates/apps/_nacos.tpl} | 42 +-
.../admin-stack/templates/apps/_node-exporter.tpl | 43 +
.../admin-stack/templates/apps/_prometheus.tpl | 122 ++
.../admin-stack/templates/apps/_pushgateway.tpl | 39 +
.../admin-stack/templates/apps/_zookeeper.tpl | 85 ++
.../charts/admin-stack/templates/tpl/_helpers.tpl | 27 -
.../charts/admin-stack/templates/tpl/_ingress.tpl | 22 -
.../admin-stack/templates/tpl/_kubeversions.tpl | 33 -
.../charts/admin-stack/templates/tpl/_storages.tpl | 23 -
.../admin-stack/templates/tpl/_tplvalues.tpl | 13 -
.../charts/admin-stack/templates/tpl/_versions.tpl | 96 --
100 files changed, 8502 insertions(+), 503 deletions(-)
diff --git a/deploy/charts/admin-stack/charts/grafana/templates/_helpers.tpl b/deploy/charts/admin-stack/charts/grafana/templates/_helpers.tpl
deleted file mode 100644
index 03db1442..00000000
--- a/deploy/charts/admin-stack/charts/grafana/templates/_helpers.tpl
+++ /dev/null
@@ -1,219 +0,0 @@
-{{/* vim: set filetype=mustache: */}}
-{{/*
-Expand the name of the chart.
-*/}}
-{{- define "grafana.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 "grafana.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 "grafana.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
-{{- end }}
-
-
-{{/*
-Create the name of the service account
-*/}}
-{{- define "grafana.serviceAccountName" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (include "grafana.fullname" .) .Values.serviceAccount.name }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.name }}
-{{- end }}
-{{- end }}
-
-
-{{- define "grafana.serviceAccountNameTest" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (print (include "grafana.fullname" .) "-test") .Values.serviceAccount.nameTest }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.nameTest }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Allow the release namespace to be overridden for multi-namespace deployments in combined charts
-*/}}
-{{- define "grafana.namespace" -}}
-{{- if .Values.namespaceOverride }}
-{{- .Values.namespaceOverride }}
-{{- else }}
-{{- .Release.Namespace }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Common labels
-*/}}
-{{- define "grafana.labels" -}}
-helm.sh/chart: {{ include "grafana.chart" . }}
-{{ include "grafana.selectorLabels" . }}
-{{- if or .Chart.AppVersion .Values.image.tag }}
-app.kubernetes.io/version: {{ mustRegexReplaceAllLiteral "@sha.*" .Values.image.tag "" | default .Chart.AppVersion | quote }}
-{{- end }}
-app.kubernetes.io/managed-by: {{ .Release.Service }}
-{{- with .Values.extraLabels }}
-{{ toYaml . }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Selector labels
-*/}}
-{{- define "grafana.selectorLabels" -}}
-app.kubernetes.io/name: {{ include "grafana.name" . }}
-app.kubernetes.io/instance: {{ .Release.Name }}
-{{- end }}
-
-
-{{/*
-Common labels
-*/}}
-{{- define "grafana.imageRenderer.labels" -}}
-helm.sh/chart: {{ include "grafana.chart" . }}
-{{ include "grafana.imageRenderer.selectorLabels" . }}
-{{- if or .Chart.AppVersion .Values.image.tag }}
-app.kubernetes.io/version: {{ mustRegexReplaceAllLiteral "@sha.*" .Values.image.tag "" | default .Chart.AppVersion | quote }}
-{{- end }}
-app.kubernetes.io/managed-by: {{ .Release.Service }}
-{{- end }}
-
-
-{{/*
-Selector labels ImageRenderer
-*/}}
-{{- define "grafana.imageRenderer.selectorLabels" -}}
-app.kubernetes.io/name: {{ include "grafana.name" . }}-image-renderer
-app.kubernetes.io/instance: {{ .Release.Name }}
-{{- end }}
-
-
-{{/*
-Looks if there's an existing secret and reuse its password. If not it generates
-new password and use it.
-*/}}
-{{- define "grafana.password" -}}
-{{- $secret := (lookup "v1" "Secret" (include "grafana.namespace" .) (include "grafana.fullname" .) ) }}
-{{- if $secret }}
-{{- index $secret "data" "admin-password" }}
-{{- else }}
-{{- (randAlphaNum 40) | b64enc | quote }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return the appropriate apiVersion for rbac.
-*/}}
-{{- define "grafana.rbac.apiVersion" -}}
-{{- if $.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
-{{- print "rbac.authorization.k8s.io/v1" }}
-{{- else }}
-{{- print "rbac.authorization.k8s.io/v1beta1" }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return the appropriate apiVersion for ingress.
-*/}}
-{{- define "grafana.ingress.apiVersion" -}}
-{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }}
-{{- print "networking.k8s.io/v1" }}
-{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
-{{- print "networking.k8s.io/v1beta1" }}
-{{- else }}
-{{- print "extensions/v1beta1" }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return the appropriate apiVersion for Horizontal Pod Autoscaler.
-*/}}
-{{- define "grafana.hpa.apiVersion" -}}
-{{- if $.Capabilities.APIVersions.Has "autoscaling/v2/HorizontalPodAutoscaler" }}
-{{- print "autoscaling/v2" }}
-{{- else if $.Capabilities.APIVersions.Has "autoscaling/v2beta2/HorizontalPodAutoscaler" }}
-{{- print "autoscaling/v2beta2" }}
-{{- else }}
-{{- print "autoscaling/v2beta1" }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return the appropriate apiVersion for podDisruptionBudget.
-*/}}
-{{- define "grafana.podDisruptionBudget.apiVersion" -}}
-{{- if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
-{{- print "policy/v1" }}
-{{- else }}
-{{- print "policy/v1beta1" }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return if ingress is stable.
-*/}}
-{{- define "grafana.ingress.isStable" -}}
-{{- eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1" }}
-{{- end }}
-
-
-{{/*
-Return if ingress supports ingressClassName.
-*/}}
-{{- define "grafana.ingress.supportsIngressClassName" -}}
-{{- or (eq (include "grafana.ingress.isStable" .) "true") (and (eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
-{{- end }}
-
-
-{{/*
-Return if ingress supports pathType.
-*/}}
-{{- define "grafana.ingress.supportsPathType" -}}
-{{- or (eq (include "grafana.ingress.isStable" .) "true") (and (eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
-{{- end }}
-
-
-{{/*
-Formats imagePullSecrets. Input is (dict "root" . "imagePullSecrets" .{specific imagePullSecrets})
-*/}}
-{{- define "grafana.imagePullSecrets" -}}
-{{- $root := .root }}
-{{- range (concat .root.Values.global.imagePullSecrets .imagePullSecrets) }}
-{{- if eq (typeOf .) "map[string]interface {}" }}
-- {{ toYaml (dict "name" (tpl .name $root)) | trim }}
-{{- else }}
-- name: {{ tpl . $root }}
-{{- end }}
-{{- end }}
-{{- end }}
diff --git a/deploy/charts/admin-stack/charts/nacos/templates/NOTES.txt b/deploy/charts/admin-stack/charts/nacos/templates/NOTES.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/deploy/charts/admin-stack/charts/prometheus/.helmignore b/deploy/charts/admin-stack/charts/prometheus/.helmignore
new file mode 100644
index 00000000..8cade131
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.vscode
+.project
+.idea/
+*.tmproj
+OWNERS
diff --git a/deploy/charts/admin-stack/charts/prometheus/Chart.yaml b/deploy/charts/admin-stack/charts/prometheus/Chart.yaml
new file mode 100644
index 00000000..3da44652
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/Chart.yaml
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v2
+appVersion: v2.42.0
+name: prometheus
+description: Prometheus is a monitoring system and time series database.
+home: https://prometheus.io/
+kubeVersion: '>=1.16.0-0'
+maintainers:
+ - email: dev@dubbo.apache.org
+ name: dubbo
+sources:
+ - https://github.com/prometheus/prometheus
+type: application
+version: 19.6.1
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/.helmignore b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/.helmignore
new file mode 100644
index 00000000..8cade131
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.vscode
+.project
+.idea/
+*.tmproj
+OWNERS
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/Chart.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/Chart.yaml
new file mode 100644
index 00000000..c84a5282
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/Chart.yaml
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v2
+appVersion: v0.25.0
+description: The Alertmanager handles alerts sent by client applications such as the Prometheus server.
+home: https://prometheus.io
+keywords:
+ - monitoring
+kubeVersion: '>=1.16.0-0'
+maintainers:
+ - email: dev@dubbo.apache.org
+ name: dubbo
+name: alertmanager
+sources:
+ - https://github.com/prometheus/alertmanager
+type: application
+version: 0.24.1
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/_charts.tpl b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/_charts.tpl
new file mode 100644
index 00000000..84a4bc42
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/_charts.tpl
@@ -0,0 +1,51 @@
+{{- define "prometheus.alertmanager.fullname" -}}
+{{- if .Values.alertmanager.fullnameOverride -}}
+{{- .Values.alertmanager.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- if contains $name .Release.Name -}}
+{{- printf "%s-%s" .Release.Name .Values.alertmanager.name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s-%s" .Release.Name $name .Values.alertmanager.name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{- define "prometheus.alertmanager.matchLabels" -}}
+component: {{ .Values.alertmanager.name | quote }}
+{{ include "prometheus.common.matchLabels" . }}
+{{- end -}}
+
+{{/*
+Create the name of the service account to use for the alertmanager component
+*/}}
+{{- define "prometheus.serviceAccountName.alertmanager" -}}
+{{- if .Values.serviceAccounts.alertmanager.create -}}
+ {{ default (include "prometheus.alertmanager.fullname" .) .Values.serviceAccounts.alertmanager.name }}
+{{- else -}}
+ {{ default "default" .Values.serviceAccounts.alertmanager.name }}
+{{- end -}}
+{{- end -}}
+
+{{- define "prometheus.alertmanager.labels" -}}
+{{ include "prometheus.alertmanager.matchLabels" . }}
+{{ include "prometheus.common.metaLabels" . }}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for deployment.
+*/}}
+{{- define "prometheus.deployment.apiVersion" -}}
+{{- print "apps/v1" -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for rbac.
+*/}}
+{{- define "rbac.apiVersion" -}}
+{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
+{{- print "rbac.authorization.k8s.io/v1" -}}
+{{- else -}}
+{{- print "rbac.authorization.k8s.io/v1beta1" -}}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/clusterrole.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/clusterrole.yaml
new file mode 100644
index 00000000..1bcfb982
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/clusterrole.yaml
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.rbac.create .Values.alertmanager.useClusterRole (not .Values.alertmanager.useExistingRole) -}}
+apiVersion: {{ template "rbac.apiVersion" . }}
+kind: ClusterRole
+metadata:
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+rules:
+{{- if .Values.podSecurityPolicy.enabled }}
+ - apiGroups:
+ - extensions
+ resources:
+ - podsecuritypolicies
+ verbs:
+ - use
+ resourceNames:
+ - {{ template "prometheus.alertmanager.fullname" . }}
+{{- else }}
+ []
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/clusterrolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/clusterrolebinding.yaml
new file mode 100644
index 00000000..ed58f49d
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/clusterrolebinding.yaml
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.rbac.create .Values.alertmanager.useClusterRole -}}
+apiVersion: {{ template "rbac.apiVersion" . }}
+kind: ClusterRoleBinding
+metadata:
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ template "prometheus.serviceAccountName.alertmanager" . }}
+{{ include "prometheus.namespace" . | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+{{- if (not .Values.alertmanager.useExistingRole) }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{- else }}
+ name: {{ .Values.alertmanager.useExistingRole }}
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/configmap.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/configmap.yaml
new file mode 100644
index 00000000..db673c42
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/configmap.yaml
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled (and (empty .Values.alertmanager.configMapOverrideName) (empty .Values.alertmanager.configFromSecret)) -}}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+data:
+{{- $root := . -}}
+{{- range $key, $value := .Values.alertmanagerFiles }}
+ {{- if $key | regexMatch ".*\\.ya?ml$" }}
+ {{ $key }}: |
+{{ toYaml $value | default "{}" | indent 4 }}
+ {{- else }}
+ {{ $key }}: {{ toYaml $value | indent 4 }}
+ {{- end }}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/deploy.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/deploy.yaml
new file mode 100644
index 00000000..34514664
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/deploy.yaml
@@ -0,0 +1,219 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled (not .Values.alertmanager.statefulSet.enabled) -}}
+apiVersion: {{ template "prometheus.deployment.apiVersion" . }}
+kind: Deployment
+metadata:
+{{- if .Values.alertmanager.deploymentAnnotations }}
+ annotations:
+ {{ toYaml .Values.alertmanager.deploymentAnnotations | nindent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ selector:
+ matchLabels:
+ {{- include "prometheus.alertmanager.matchLabels" . | nindent 6 }}
+ replicas: {{ .Values.alertmanager.replicaCount }}
+ {{- if .Values.alertmanager.strategy }}
+ strategy:
+{{ toYaml .Values.alertmanager.strategy | trim | indent 4 }}
+ {{ if eq .Values.alertmanager.strategy.type "Recreate" }}rollingUpdate: null{{ end }}
+{{- end }}
+ template:
+ metadata:
+ {{- if .Values.alertmanager.podAnnotations }}
+ annotations:
+ {{ toYaml .Values.alertmanager.podAnnotations | nindent 8 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 8 }}
+ {{- if .Values.alertmanager.podLabels}}
+ {{ toYaml .Values.alertmanager.podLabels | nindent 8 }}
+ {{- end}}
+ spec:
+{{- if .Values.alertmanager.schedulerName }}
+ schedulerName: "{{ .Values.alertmanager.schedulerName }}"
+{{- end }}
+ serviceAccountName: {{ template "prometheus.serviceAccountName.alertmanager" . }}
+ {{- if .Values.alertmanager.extraInitContainers }}
+ initContainers:
+{{ toYaml .Values.alertmanager.extraInitContainers | indent 8 }}
+ {{- end }}
+{{- if .Values.alertmanager.priorityClassName }}
+ priorityClassName: "{{ .Values.alertmanager.priorityClassName }}"
+{{- end }}
+ containers:
+ - name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }}
+ image: "{{ .Values.alertmanager.image.repository }}:{{ .Values.alertmanager.image.tag }}"
+ imagePullPolicy: "{{ .Values.alertmanager.image.pullPolicy }}"
+ env:
+ {{- range $key, $value := .Values.alertmanager.extraEnv }}
+ - name: {{ $key }}
+ value: {{ $value }}
+ {{- end }}
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: status.podIP
+ args:
+ - --config.file=/etc/config/{{ .Values.alertmanager.configFileName }}
+ - --storage.path={{ .Values.alertmanager.persistentVolume.mountPath }}
+ {{- if .Values.alertmanager.service.enableMeshPeer }}
+ - --cluster.listen-address=0.0.0.0:6783
+ - --cluster.advertise-address=[$(POD_IP)]:6783
+ {{- else }}
+ - --cluster.listen-address=
+ {{- end }}
+ {{- range $key, $value := .Values.alertmanager.extraArgs }}
+ - --{{ $key }}={{ $value }}
+ {{- end }}
+ {{- if .Values.alertmanager.baseURL }}
+ - --web.external-url={{ .Values.alertmanager.baseURL }}
+ {{- end }}
+ {{- range .Values.alertmanager.clusterPeers }}
+ - --cluster.peer={{ . }}
+ {{- end }}
+
+ ports:
+ - containerPort: 9093
+ readinessProbe:
+ httpGet:
+ path: {{ .Values.alertmanager.prefixURL }}/-/ready
+ port: 9093
+ {{- if .Values.alertmanager.probeHeaders }}
+ httpHeaders:
+ {{- range .Values.alertmanager.probeHeaders }}
+ - name: {{ .name }}
+ value: {{ .value }}
+ {{- end }}
+ {{- end }}
+ initialDelaySeconds: 30
+ timeoutSeconds: 30
+ resources:
+{{ toYaml .Values.alertmanager.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ - name: storage-volume
+ mountPath: "{{ .Values.alertmanager.persistentVolume.mountPath }}"
+ subPath: "{{ .Values.alertmanager.persistentVolume.subPath }}"
+ {{- range .Values.alertmanager.extraSecretMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- range .Values.alertmanager.extraConfigmapMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+
+ {{- if .Values.configmapReload.alertmanager.enabled }}
+ - name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }}-{{ .Values.configmapReload.alertmanager.name }}
+ image: "{{ .Values.configmapReload.alertmanager.image.repository }}:{{ .Values.configmapReload.alertmanager.image.tag }}"
+ imagePullPolicy: "{{ .Values.configmapReload.alertmanager.image.pullPolicy }}"
+ args:
+ - --volume-dir=/etc/config
+ - --webhook-url=http://127.0.0.1:9093{{ .Values.alertmanager.prefixURL }}/-/reload
+ {{- range $key, $value := .Values.configmapReload.alertmanager.extraArgs }}
+ - --{{ $key }}={{ $value }}
+ {{- end }}
+ {{- range .Values.configmapReload.alertmanager.extraVolumeDirs }}
+ - --volume-dir={{ . }}
+ {{- end }}
+ resources:
+{{ toYaml .Values.configmapReload.alertmanager.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ readOnly: true
+ {{- range .Values.configmapReload.alertmanager.extraConfigmapMounts }}
+ - name: {{ $.Values.configmapReload.alertmanager.name }}-{{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.imagePullSecrets }}
+ imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+ {{- end }}
+ {{- if .Values.alertmanager.nodeSelector }}
+ nodeSelector:
+{{ toYaml .Values.alertmanager.nodeSelector | indent 8 }}
+ {{- end }}
+ {{- with .Values.alertmanager.dnsConfig }}
+ dnsConfig:
+{{ toYaml . | indent 8 }}
+ {{- end }}
+ {{- if .Values.alertmanager.securityContext }}
+ securityContext:
+{{ toYaml .Values.alertmanager.securityContext | indent 8 }}
+ {{- end }}
+ {{- if .Values.alertmanager.tolerations }}
+ tolerations:
+{{ toYaml .Values.alertmanager.tolerations | indent 8 }}
+ {{- end }}
+ {{- if .Values.alertmanager.affinity }}
+ affinity:
+{{ toYaml .Values.alertmanager.affinity | indent 8 }}
+ {{- end }}
+ volumes:
+ - name: config-volume
+ {{- if empty .Values.alertmanager.configFromSecret }}
+ configMap:
+ name: {{ if .Values.alertmanager.configMapOverrideName }}{{ .Release.Name }}-{{ .Values.alertmanager.configMapOverrideName }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }}
+ {{- else }}
+ secret:
+ secretName: {{ .Values.alertmanager.configFromSecret }}
+ {{- end }}
+ {{- range .Values.alertmanager.extraSecretMounts }}
+ - name: {{ .name }}
+ secret:
+ secretName: {{ .secretName }}
+ {{- with .optional }}
+ optional: {{ . }}
+ {{- end }}
+ {{- end }}
+ {{- range .Values.alertmanager.extraConfigmapMounts }}
+ - name: {{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- end }}
+ {{- range .Values.configmapReload.alertmanager.extraConfigmapMounts }}
+ - name: {{ $.Values.configmapReload.alertmanager.name }}-{{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- end }}
+ - name: storage-volume
+ {{- if .Values.alertmanager.persistentVolume.enabled }}
+ persistentVolumeClaim:
+ claimName: {{ if .Values.alertmanager.persistentVolume.existingClaim }}{{ .Values.alertmanager.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }}
+ {{- else }}
+ emptyDir:
+ {{- if .Values.alertmanager.emptyDir.sizeLimit }}
+ sizeLimit: {{ .Values.alertmanager.emptyDir.sizeLimit }}
+ {{- else }}
+ {}
+ {{- end -}}
+ {{- end -}}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/ingress.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/ingress.yaml
new file mode 100644
index 00000000..4ca45048
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/ingress.yaml
@@ -0,0 +1,72 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.alertmanager.ingress.enabled -}}
+{{- $ingressApiIsStable := eq (include "ingress.isStable" .) "true" -}}
+{{- $ingressSupportsIngressClassName := eq (include "ingress.supportsIngressClassName" .) "true" -}}
+{{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}}
+{{- $releaseName := .Release.Name -}}
+{{- $serviceName := include "prometheus.alertmanager.fullname" . }}
+{{- $servicePort := .Values.alertmanager.service.servicePort -}}
+{{- $ingressPath := .Values.alertmanager.ingress.path -}}
+{{- $ingressPathType := .Values.alertmanager.ingress.pathType -}}
+{{- $extraPaths := .Values.alertmanager.ingress.extraPaths -}}
+apiVersion: {{ template "ingress.apiVersion" . }}
+kind: Ingress
+metadata:
+{{- if .Values.alertmanager.ingress.annotations }}
+ annotations:
+{{ toYaml .Values.alertmanager.ingress.annotations | indent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+{{- range $key, $value := .Values.alertmanager.ingress.extraLabels }}
+ {{ $key }}: {{ $value }}
+{{- end }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ {{- if and $ingressSupportsIngressClassName .Values.alertmanager.ingress.ingressClassName }}
+ ingressClassName: {{ .Values.alertmanager.ingress.ingressClassName }}
+ {{- end }}
+ rules:
+ {{- range .Values.alertmanager.ingress.hosts }}
+ {{- $url := splitList "/" . }}
+ - host: {{ first $url }}
+ http:
+ paths:
+{{ if $extraPaths }}
+{{ toYaml $extraPaths | indent 10 }}
+{{- end }}
+ - path: {{ $ingressPath }}
+ {{- if $ingressSupportsPathType }}
+ pathType: {{ $ingressPathType }}
+ {{- end }}
+ backend:
+ {{- if $ingressApiIsStable }}
+ service:
+ name: {{ $serviceName }}
+ port:
+ number: {{ $servicePort }}
+ {{- else }}
+ serviceName: {{ $serviceName }}
+ servicePort: {{ $servicePort }}
+ {{- end }}
+ {{- end -}}
+{{- if .Values.alertmanager.ingress.tls }}
+ tls:
+{{ toYaml .Values.alertmanager.ingress.tls | indent 4 }}
+ {{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/networkpolicy.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/networkpolicy.yaml
new file mode 100644
index 00000000..b24a6a36
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/networkpolicy.yaml
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.networkPolicy.enabled -}}
+apiVersion: {{ template "prometheus.networkPolicy.apiVersion" . }}
+kind: NetworkPolicy
+metadata:
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+spec:
+ podSelector:
+ matchLabels:
+ {{- include "prometheus.alertmanager.matchLabels" . | nindent 6 }}
+ ingress:
+ - from:
+ - podSelector:
+ matchLabels:
+ {{- include "prometheus.server.matchLabels" . | nindent 12 }}
+ - ports:
+ - port: 9093
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/pdb.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/pdb.yaml
new file mode 100644
index 00000000..2b0ef88e
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/pdb.yaml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.alertmanager.podDisruptionBudget.enabled }}
+apiVersion: policy/v1beta1
+kind: PodDisruptionBudget
+metadata:
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+spec:
+ maxUnavailable: {{ .Values.alertmanager.podDisruptionBudget.maxUnavailable }}
+ selector:
+ matchLabels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 6 }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/psp.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/psp.yaml
new file mode 100644
index 00000000..bb0e4685
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/psp.yaml
@@ -0,0 +1,61 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.rbac.create .Values.podSecurityPolicy.enabled }}
+apiVersion: {{ template "prometheus.podSecurityPolicy.apiVersion" . }}
+kind: PodSecurityPolicy
+metadata:
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ annotations:
+{{- if .Values.alertmanager.podSecurityPolicy.annotations }}
+{{ toYaml .Values.alertmanager.podSecurityPolicy.annotations | indent 4 }}
+{{- end }}
+spec:
+ privileged: false
+ allowPrivilegeEscalation: false
+ requiredDropCapabilities:
+ - ALL
+ volumes:
+ - 'configMap'
+ - 'persistentVolumeClaim'
+ - 'emptyDir'
+ - 'secret'
+ allowedHostPaths:
+ - pathPrefix: /etc
+ readOnly: true
+ - pathPrefix: {{ .Values.alertmanager.persistentVolume.mountPath }}
+ hostNetwork: false
+ hostPID: false
+ hostIPC: false
+ runAsUser:
+ rule: 'RunAsAny'
+ seLinux:
+ rule: 'RunAsAny'
+ supplementalGroups:
+ rule: 'MustRunAs'
+ ranges:
+ # Forbid adding the root group.
+ - min: 1
+ max: 65535
+ fsGroup:
+ rule: 'MustRunAs'
+ ranges:
+ # Forbid adding the root group.
+ - min: 1
+ max: 65535
+ readOnlyRootFilesystem: true
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/pvc.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/pvc.yaml
new file mode 100644
index 00000000..ac2a8783
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/pvc.yaml
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if not .Values.alertmanager.statefulSet.enabled -}}
+{{- if and .Values.alertmanager.enabled .Values.alertmanager.persistentVolume.enabled -}}
+{{- if not .Values.alertmanager.persistentVolume.existingClaim -}}
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ {{- if .Values.alertmanager.persistentVolume.annotations }}
+ annotations:
+{{ toYaml .Values.alertmanager.persistentVolume.annotations | indent 4 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ accessModes:
+{{ toYaml .Values.alertmanager.persistentVolume.accessModes | indent 4 }}
+{{- if .Values.alertmanager.persistentVolume.storageClass }}
+{{- if (eq "-" .Values.alertmanager.persistentVolume.storageClass) }}
+ storageClassName: ""
+{{- else }}
+ storageClassName: "{{ .Values.alertmanager.persistentVolume.storageClass }}"
+{{- end }}
+{{- end }}
+{{- if .Values.alertmanager.persistentVolume.volumeBindingMode }}
+ volumeBindingMode: "{{ .Values.alertmanager.persistentVolume.volumeBindingMode }}"
+{{- end }}
+ resources:
+ requests:
+ storage: "{{ .Values.alertmanager.persistentVolume.size }}"
+{{- if .Values.alertmanager.persistentVolume.selector }}
+ selector:
+ {{- toYaml .Values.alertmanager.persistentVolume.selector | nindent 4 }}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/role.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/role.yaml
new file mode 100644
index 00000000..f48a1797
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/role.yaml
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.rbac.create (eq .Values.alertmanager.useClusterRole false) (not .Values.alertmanager.useExistingRole) -}}
+{{- range $.Values.alertmanager.namespaces }}
+apiVersion: {{ template "rbac.apiVersion" . }}
+kind: Role
+metadata:
+ labels:
+ {{- include "prometheus.alertmanager.labels" $ | nindent 4 }}
+ name: {{ template "prometheus.alertmanager.fullname" $ }}
+ namespace: {{ . }}
+rules:
+{{- if $.Values.podSecurityPolicy.enabled }}
+ - apiGroups:
+ - extensions
+ resources:
+ - podsecuritypolicies
+ verbs:
+ - use
+ resourceNames:
+ - {{ template "prometheus.alertmanager.fullname" $ }}
+{{- else }}
+ []
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/rolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/rolebinding.yaml
new file mode 100644
index 00000000..a1a92fc6
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/rolebinding.yaml
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.rbac.create (eq .Values.alertmanager.useClusterRole false) -}}
+{{ range $.Values.alertmanager.namespaces }}
+apiVersion: {{ template "rbac.apiVersion" . }}
+kind: RoleBinding
+metadata:
+ labels:
+ {{- include "prometheus.alertmanager.labels" $ | nindent 4 }}
+ name: {{ template "prometheus.alertmanager.fullname" $ }}
+ namespace: {{ . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ template "prometheus.serviceAccountName.alertmanager" $ }}
+{{ include "prometheus.namespace" $ | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+{{- if (not $.Values.alertmanager.useExistingRole) }}
+ name: {{ template "prometheus.alertmanager.fullname" $ }}
+{{- else }}
+ name: {{ $.Values.alertmanager.useExistingRole }}
+{{- end }}
+{{- end }}
+{{ end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/service.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/service.yaml
new file mode 100644
index 00000000..0003c715
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/service.yaml
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.alertmanager.enabled -}}
+apiVersion: v1
+kind: Service
+metadata:
+{{- if .Values.alertmanager.service.annotations }}
+ annotations:
+{{ toYaml .Values.alertmanager.service.annotations | indent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+{{- if .Values.alertmanager.service.labels }}
+{{ toYaml .Values.alertmanager.service.labels | indent 4 }}
+{{- end }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+{{- if .Values.alertmanager.service.clusterIP }}
+ clusterIP: {{ .Values.alertmanager.service.clusterIP }}
+{{- end }}
+{{- if .Values.alertmanager.service.externalIPs }}
+ externalIPs:
+{{ toYaml .Values.alertmanager.service.externalIPs | indent 4 }}
+{{- end }}
+{{- if .Values.alertmanager.service.loadBalancerIP }}
+ loadBalancerIP: {{ .Values.alertmanager.service.loadBalancerIP }}
+{{- end }}
+{{- if .Values.alertmanager.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges:
+ {{- range $cidr := .Values.alertmanager.service.loadBalancerSourceRanges }}
+ - {{ $cidr }}
+ {{- end }}
+{{- end }}
+ ports:
+ - name: http
+ port: {{ .Values.alertmanager.service.servicePort }}
+ protocol: TCP
+ targetPort: 9093
+ {{- if .Values.alertmanager.service.nodePort }}
+ nodePort: {{ .Values.alertmanager.service.nodePort }}
+ {{- end }}
+{{- if .Values.alertmanager.service.enableMeshPeer }}
+ - name: meshpeer
+ port: 6783
+ protocol: TCP
+ targetPort: 6783
+{{- end }}
+ selector:
+ {{- include "prometheus.alertmanager.matchLabels" . | nindent 4 }}
+{{- if .Values.alertmanager.service.sessionAffinity }}
+ sessionAffinity: {{ .Values.alertmanager.service.sessionAffinity }}
+{{- end }}
+ type: "{{ .Values.alertmanager.service.type }}"
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/serviceaccount.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/serviceaccount.yaml
new file mode 100644
index 00000000..c00ee9cd
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/serviceaccount.yaml
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.serviceAccounts.alertmanager.create -}}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ name: {{ template "prometheus.serviceAccountName.alertmanager" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+ annotations:
+{{ toYaml .Values.serviceAccounts.alertmanager.annotations | indent 4 }}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/sts.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/sts.yaml
new file mode 100644
index 00000000..7be73658
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/sts.yaml
@@ -0,0 +1,196 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.alertmanager.statefulSet.enabled -}}
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+{{- if .Values.alertmanager.statefulSet.annotations }}
+ annotations:
+ {{ toYaml .Values.alertmanager.statefulSet.annotations | nindent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+ {{- if .Values.alertmanager.statefulSet.labels}}
+ {{ toYaml .Values.alertmanager.statefulSet.labels | nindent 4 }}
+ {{- end}}
+ name: {{ template "prometheus.alertmanager.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ serviceName: {{ template "prometheus.alertmanager.fullname" . }}-headless
+ selector:
+ matchLabels:
+ {{- include "prometheus.alertmanager.matchLabels" . | nindent 6 }}
+ replicas: {{ .Values.alertmanager.replicaCount }}
+ podManagementPolicy: {{ .Values.alertmanager.statefulSet.podManagementPolicy }}
+ template:
+ metadata:
+ {{- if .Values.alertmanager.podAnnotations }}
+ annotations:
+ {{ toYaml .Values.alertmanager.podAnnotations | nindent 8 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 8 }}
+ {{- if .Values.alertmanager.podLabels}}
+ {{ toYaml .Values.alertmanager.podLabels | nindent 8 }}
+ {{- end}}
+ spec:
+{{- if .Values.alertmanager.affinity }}
+ affinity:
+{{ toYaml .Values.alertmanager.affinity | indent 8 }}
+{{- end }}
+{{- if .Values.alertmanager.schedulerName }}
+ schedulerName: "{{ .Values.alertmanager.schedulerName }}"
+{{- end }}
+ serviceAccountName: {{ template "prometheus.serviceAccountName.alertmanager" . }}
+{{- if .Values.alertmanager.priorityClassName }}
+ priorityClassName: "{{ .Values.alertmanager.priorityClassName }}"
+{{- end }}
+ containers:
+ - name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }}
+ image: "{{ .Values.alertmanager.image.repository }}:{{ .Values.alertmanager.image.tag }}"
+ imagePullPolicy: "{{ .Values.alertmanager.image.pullPolicy }}"
+ env:
+ {{- range $key, $value := .Values.alertmanager.extraEnv }}
+ - name: {{ $key }}
+ value: {{ $value }}
+ {{- end }}
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: status.podIP
+ args:
+ - --config.file=/etc/config/alertmanager.yml
+ - --storage.path={{ .Values.alertmanager.persistentVolume.mountPath }}
+ {{- if .Values.alertmanager.statefulSet.headless.enableMeshPeer }}
+ - --cluster.advertise-address=[$(POD_IP)]:6783
+ - --cluster.listen-address=0.0.0.0:6783
+ {{- range $n := until (.Values.alertmanager.replicaCount | int) }}
+ - --cluster.peer={{ template "prometheus.alertmanager.fullname" $ }}-{{ $n }}.{{ template "prometheus.alertmanager.fullname" $ }}-headless:6783
+ {{- end }}
+ {{- else }}
+ - --cluster.listen-address=
+ {{- end }}
+ {{- range $key, $value := .Values.alertmanager.extraArgs }}
+ - --{{ $key }}={{ $value }}
+ {{- end }}
+ {{- if .Values.alertmanager.baseURL }}
+ - --web.external-url={{ .Values.alertmanager.baseURL }}
+ {{- end }}
+
+ ports:
+ - containerPort: 9093
+ {{- if .Values.alertmanager.statefulSet.headless.enableMeshPeer }}
+ - containerPort: 6783
+ {{- end }}
+ readinessProbe:
+ httpGet:
+ path: {{ .Values.alertmanager.prefixURL }}/#/status
+ port: 9093
+ initialDelaySeconds: 30
+ timeoutSeconds: 30
+ resources:
+{{ toYaml .Values.alertmanager.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ - name: storage-volume
+ mountPath: "{{ .Values.alertmanager.persistentVolume.mountPath }}"
+ subPath: "{{ .Values.alertmanager.persistentVolume.subPath }}"
+ {{- range .Values.alertmanager.extraSecretMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- if .Values.configmapReload.alertmanager.enabled }}
+ - name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }}-{{ .Values.configmapReload.alertmanager.name }}
+ image: "{{ .Values.configmapReload.alertmanager.image.repository }}:{{ .Values.configmapReload.alertmanager.image.tag }}"
+ imagePullPolicy: "{{ .Values.configmapReload.alertmanager.image.pullPolicy }}"
+ args:
+ - --volume-dir=/etc/config
+ - --webhook-url=http://localhost:9093{{ .Values.alertmanager.prefixURL }}/-/reload
+ resources:
+{{ toYaml .Values.configmapReload.alertmanager.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ readOnly: true
+ {{- end }}
+ {{- if .Values.imagePullSecrets }}
+ imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+ {{- end }}
+ {{- if .Values.alertmanager.nodeSelector }}
+ nodeSelector:
+{{ toYaml .Values.alertmanager.nodeSelector | indent 8 }}
+ {{- end }}
+ {{- if .Values.alertmanager.securityContext }}
+ securityContext:
+{{ toYaml .Values.alertmanager.securityContext | indent 8 }}
+ {{- end }}
+ {{- if .Values.alertmanager.tolerations }}
+ tolerations:
+{{ toYaml .Values.alertmanager.tolerations | indent 8 }}
+ {{- end }}
+ volumes:
+ - name: config-volume
+ {{- if empty .Values.alertmanager.configFromSecret }}
+ configMap:
+ name: {{ if .Values.alertmanager.configMapOverrideName }}{{ .Release.Name }}-{{ .Values.alertmanager.configMapOverrideName }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }}
+ {{- else }}
+ secret:
+ secretName: {{ .Values.alertmanager.configFromSecret }}
+ {{- end }}
+ {{- range .Values.alertmanager.extraSecretMounts }}
+ - name: {{ .name }}
+ secret:
+ secretName: {{ .secretName }}
+ {{- with .optional }}
+ optional: {{ . }}
+ {{- end }}
+ {{- end }}
+{{- if .Values.alertmanager.persistentVolume.enabled }}
+ volumeClaimTemplates:
+ - metadata:
+ name: storage-volume
+ {{- if .Values.alertmanager.persistentVolume.annotations }}
+ annotations:
+{{ toYaml .Values.alertmanager.persistentVolume.annotations | indent 10 }}
+ {{- end }}
+ spec:
+ accessModes:
+{{ toYaml .Values.alertmanager.persistentVolume.accessModes | indent 10 }}
+ resources:
+ requests:
+ storage: "{{ .Values.alertmanager.persistentVolume.size }}"
+ {{- if .Values.server.persistentVolume.storageClass }}
+ {{- if (eq "-" .Values.server.persistentVolume.storageClass) }}
+ storageClassName: ""
+ {{- else }}
+ storageClassName: "{{ .Values.alertmanager.persistentVolume.storageClass }}"
+ {{- end }}
+ {{- end }}
+{{- else }}
+ - name: storage-volume
+ emptyDir:
+ {{- if .Values.alertmanager.emptyDir.sizeLimit }}
+ sizeLimit: {{ .Values.alertmanager.emptyDir.sizeLimit }}
+ {{- else }}
+ {}
+ {{- end -}}
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/svc-headless.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/svc-headless.yaml
new file mode 100644
index 00000000..cd81d5fa
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/templates/svc-headless.yaml
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.alertmanager.enabled .Values.alertmanager.statefulSet.enabled -}}
+apiVersion: v1
+kind: Service
+metadata:
+{{- if .Values.alertmanager.statefulSet.headless.annotations }}
+ annotations:
+{{ toYaml .Values.alertmanager.statefulSet.headless.annotations | indent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.alertmanager.labels" . | nindent 4 }}
+{{- if .Values.alertmanager.statefulSet.headless.labels }}
+{{ toYaml .Values.alertmanager.statefulSet.headless.labels | indent 4 }}
+{{- end }}
+ name: {{ template "prometheus.alertmanager.fullname" . }}-headless
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ clusterIP: None
+ ports:
+ - name: http
+ port: {{ .Values.alertmanager.statefulSet.headless.servicePort }}
+ protocol: TCP
+ targetPort: 9093
+{{- if .Values.alertmanager.statefulSet.headless.enableMeshPeer }}
+ - name: meshpeer
+ port: 6783
+ protocol: TCP
+ targetPort: 6783
+{{- end }}
+ selector:
+ {{- include "prometheus.alertmanager.matchLabels" . | nindent 4 }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/values.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/values.yaml
new file mode 100644
index 00000000..26e1204c
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/alertmanager/values.yaml
@@ -0,0 +1,457 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rbac:
+ create: true
+
+podSecurityPolicy:
+ enabled: false
+
+imagePullSecrets:
+# - name: "image-pull-secret"
+
+networkPolicy:
+ enabled: false
+
+configmapReload:
+ prometheus:
+ ## If false, the configmap-reload container will not be deployed
+ ##
+ enabled: true
+
+ ## configmap-reload container name
+ ##
+ name: configmap-reload
+
+ ## configmap-reload container image
+ ##
+ image:
+ repository: jimmidyson/configmap-reload
+ tag: v0.8.0
+ pullPolicy: IfNotPresent
+
+ ## Additional configmap-reload container arguments
+ ##
+ extraArgs: {}
+ ## Additional configmap-reload volume directories
+ ##
+ extraVolumeDirs: []
+
+
+ ## Additional configmap-reload mounts
+ ##
+ extraConfigmapMounts: []
+ # - name: prometheus-alerts
+ # mountPath: /etc/alerts.d
+ # subPath: ""
+ # configMap: prometheus-alerts
+ # readOnly: true
+
+
+ ## configmap-reload resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ alertmanager:
+ ## If false, the configmap-reload container will not be deployed
+ ##
+ enabled: true
+
+ ## configmap-reload container name
+ ##
+ name: configmap-reload
+
+ ## configmap-reload container image
+ ##
+ image:
+ repository: jimmidyson/configmap-reload
+ tag: v0.5.0
+ pullPolicy: IfNotPresent
+
+ ## Additional configmap-reload container arguments
+ ##
+ extraArgs: {}
+ ## Additional configmap-reload volume directories
+ ##
+ extraVolumeDirs: []
+
+
+ ## Additional configmap-reload mounts
+ ##
+ extraConfigmapMounts: []
+ # - name: prometheus-alerts
+ # mountPath: /etc/alerts.d
+ # subPath: ""
+ # configMap: prometheus-alerts
+ # readOnly: true
+
+
+ ## configmap-reload resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+
+## Define serviceAccount names for components. Defaults to component's fully qualified name.
+##
+serviceAccounts:
+ alertmanager:
+ create: true
+ name:
+ annotations: {}
+alertmanager:
+ ## If false, alertmanager will not be installed
+ ##
+ enabled: true
+
+ ## Use a ClusterRole (and ClusterRoleBinding)
+ ## - If set to false - we define a Role and RoleBinding in the defined namespaces ONLY
+ ## This makes alertmanager work - for users who do not have ClusterAdmin privs, but wants alertmanager to operate on their own namespaces, instead of clusterwide.
+ useClusterRole: true
+
+ ## Set to a rolename to use existing role - skipping role creating - but still doing serviceaccount and rolebinding to the rolename set here.
+ useExistingRole: false
+
+ ## alertmanager container name
+ ##
+ name: alertmanager
+
+ ## alertmanager container image
+ ##
+ image:
+ repository: quay.io/prometheus/alertmanager
+ tag: v0.23.0
+ pullPolicy: IfNotPresent
+
+ ## alertmanager priorityClassName
+ ##
+ priorityClassName: ""
+
+ ## Custom HTTP headers for Readiness Probe
+ ##
+ ## Useful for providing HTTP Basic Auth to healthchecks
+ probeHeaders: []
+
+ ## Additional alertmanager container arguments
+ ##
+ extraArgs: {}
+
+ ## Additional InitContainers to initialize the pod
+ ##
+ extraInitContainers: []
+
+ ## The URL prefix at which the container can be accessed. Useful in the case the '-web.external-url' includes a slug
+ ## so that the various internal URLs are still able to access as they are in the default case.
+ ## (Optional)
+ prefixURL: ""
+
+ ## External URL which can access alertmanager
+ baseURL: "http://localhost:9093"
+
+ ## Additional alertmanager container environment variable
+ ## For instance to add a http_proxy
+ ##
+ extraEnv: {}
+
+ ## Additional alertmanager Secret mounts
+ # Defines additional mounts with secrets. Secrets must be manually created in the namespace.
+ extraSecretMounts: []
+ # - name: secret-files
+ # mountPath: /etc/secrets
+ # subPath: ""
+ # secretName: alertmanager-secret-files
+ # readOnly: true
+
+ ## Additional alertmanager Configmap mounts
+ extraConfigmapMounts: []
+ # - name: template-files
+ # mountPath: /etc/config/templates.d
+ # configMap: alertmanager-template-files
+ # readOnly: true
+
+ ## ConfigMap override where fullname is {{.Release.Name}}-{{.Values.alertmanager.configMapOverrideName}}
+ ## Defining configMapOverrideName will cause templates/alertmanager-configmap.yaml
+ ## to NOT generate a ConfigMap resource
+ ##
+ configMapOverrideName: ""
+
+ ## The name of a secret in the same kubernetes namespace which contains the Alertmanager config
+ ## Defining configFromSecret will cause templates/alertmanager-configmap.yaml
+ ## to NOT generate a ConfigMap resource
+ ##
+ configFromSecret: ""
+
+ ## The configuration file name to be loaded to alertmanager
+ ## Must match the key within configuration loaded from ConfigMap/Secret
+ ##
+ configFileName: alertmanager.yml
+
+ ingress:
+ ## If true, alertmanager Ingress will be created
+ ##
+ enabled: false
+
+ # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
+ # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
+ # ingressClassName: nginx
+
+ ## alertmanager Ingress annotations
+ ##
+ annotations: {}
+ # kubernetes.io/ingress.class: nginx
+ # kubernetes.io/tls-acme: 'true'
+
+ ## alertmanager Ingress additional labels
+ ##
+ extraLabels: {}
+
+ ## alertmanager Ingress hostnames with optional path
+ ## Must be provided if Ingress is enabled
+ ##
+ hosts: []
+ # - alertmanager.domain.com
+ # - domain.com/alertmanager
+
+ path: /
+
+ # pathType is only for k8s >= 1.18
+ pathType: Prefix
+
+ ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services.
+ extraPaths: []
+ # - path: /*
+ # backend:
+ # serviceName: ssl-redirect
+ # servicePort: use-annotation
+
+ ## alertmanager Ingress TLS configuration
+ ## Secrets must be manually created in the namespace
+ ##
+ tls: []
+ # - secretName: prometheus-alerts-tls
+ # hosts:
+ # - alertmanager.domain.com
+
+ ## Alertmanager Deployment Strategy type
+ # strategy:
+ # type: Recreate
+
+ ## Node tolerations for alertmanager scheduling to nodes with taints
+ ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+ ##
+ tolerations: []
+ # - key: "key"
+ # operator: "Equal|Exists"
+ # value: "value"
+ # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
+
+ ## Node labels for alertmanager pod assignment
+ ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+
+ ## Pod affinity
+ ##
+ affinity: {}
+
+ ## PodDisruptionBudget settings
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
+ ##
+ podDisruptionBudget:
+ enabled: false
+ maxUnavailable: 1
+
+ ## Use an alternate scheduler, e.g. "stork".
+ ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
+ ##
+ # schedulerName:
+
+ persistentVolume:
+ ## If true, alertmanager will create/use a Persistent Volume Claim
+ ## If false, use emptyDir
+ ##
+ enabled: true
+
+ ## alertmanager data Persistent Volume access modes
+ ## Must match those of existing PV or dynamic provisioner
+ ## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
+ ##
+ accessModes:
+ - ReadWriteOnce
+
+ ## alertmanager data Persistent Volume Claim annotations
+ ##
+ annotations: {}
+
+ ## alertmanager data Persistent Volume existing claim name
+ ## Requires alertmanager.persistentVolume.enabled: true
+ ## If defined, PVC must be created manually before volume will be bound
+ existingClaim: ""
+
+ ## alertmanager data Persistent Volume mount root path
+ ##
+ mountPath: /data
+
+ ## alertmanager data Persistent Volume size
+ ##
+ size: 2Gi
+
+ ## alertmanager data Persistent Volume Storage Class
+ ## If defined, storageClassName: <storageClass>
+ ## If set to "-", storageClassName: "", which disables dynamic provisioning
+ ## If undefined (the default) or set to null, no storageClassName spec is
+ ## set, choosing the default provisioner. (gp2 on AWS, standard on
+ ## GKE, AWS & OpenStack)
+ ##
+ # storageClass: "-"
+
+ ## alertmanager data Persistent Volume Binding Mode
+ ## If defined, volumeBindingMode: <volumeBindingMode>
+ ## If undefined (the default) or set to null, no volumeBindingMode spec is
+ ## set, choosing the default mode.
+ ##
+ # volumeBindingMode: ""
+
+ ## Subdirectory of alertmanager data Persistent Volume to mount
+ ## Useful if the volume's root directory is not empty
+ ##
+ subPath: ""
+
+ ## Persistent Volume Claim Selector
+ ## Useful if Persistent Volumes have been provisioned in advance
+ ## Ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector
+ ##
+ # selector:
+ # matchLabels:
+ # release: "stable"
+ # matchExpressions:
+ # - { key: environment, operator: In, values: [ dev ] }
+
+ emptyDir:
+ ## alertmanager emptyDir volume size limit
+ ##
+ sizeLimit: ""
+
+ ## Annotations to be added to alertmanager pods
+ ##
+ podAnnotations: {}
+ ## Tell prometheus to use a specific set of alertmanager pods
+ ## instead of all alertmanager pods found in the same namespace
+ ## Useful if you deploy multiple releases within the same namespace
+ ##
+ ## prometheus.io/probe: alertmanager-teamA
+
+ ## Labels to be added to Prometheus AlertManager pods
+ ##
+ podLabels: {}
+
+ ## Specify if a Pod Security Policy for node-exporter must be created
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
+ ##
+ podSecurityPolicy:
+ annotations: {}
+ ## Specify pod annotations
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
+ ##
+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
+ # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
+ # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
+
+ ## Use a StatefulSet if replicaCount needs to be greater than 1 (see below)
+ ##
+ replicaCount: 1
+
+ ## Annotations to be added to deployment
+ ##
+ deploymentAnnotations: {}
+
+ statefulSet:
+ ## If true, use a statefulset instead of a deployment for pod management.
+ ## This allows to scale replicas to more than 1 pod
+ ##
+ enabled: false
+
+ annotations: {}
+ labels: {}
+ podManagementPolicy: OrderedReady
+
+ ## Alertmanager headless service to use for the statefulset
+ ##
+ headless:
+ annotations: {}
+ labels: {}
+
+ ## Enabling peer mesh service end points for enabling the HA alert manager
+ ## Ref: https://github.com/prometheus/alertmanager/blob/master/README.md
+ enableMeshPeer: false
+
+ servicePort: 80
+
+ ## alertmanager resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ # limits:
+ # cpu: 10m
+ # memory: 32Mi
+ # requests:
+ # cpu: 10m
+ # memory: 32Mi
+
+ # Custom DNS configuration to be added to alertmanager pods
+ dnsConfig: {}
+ # nameservers:
+ # - 1.2.3.4
+ # searches:
+ # - ns1.svc.cluster-domain.example
+ # - my.dns.search.suffix
+ # options:
+ # - name: ndots
+ # value: "2"
+ # - name: edns0
+
+ ## Security context to be added to alertmanager pods
+ ##
+ securityContext:
+ runAsUser: 65534
+ runAsNonRoot: true
+ runAsGroup: 65534
+ fsGroup: 65534
+
+ service:
+ annotations: {}
+ labels: {}
+ clusterIP: ""
+
+ ## Enabling peer mesh service end points for enabling the HA alert manager
+ ## Ref: https://github.com/prometheus/alertmanager/blob/master/README.md
+ # enableMeshPeer : true
+
+ ## List of IP addresses at which the alertmanager service is available
+ ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
+ ##
+ externalIPs: []
+
+ loadBalancerIP: ""
+ loadBalancerSourceRanges: []
+ servicePort: 80
+ # nodePort: 30000
+ sessionAffinity: None
+ type: ClusterIP
+
+ ## List of initial peers
+ ## Ref: https://github.com/prometheus/alertmanager/blob/main/README.md#high-availability
+ clusterPeers: []
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/.helmignore b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/.helmignore
new file mode 100644
index 00000000..0e8a0eb3
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/Chart.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/Chart.yaml
new file mode 100644
index 00000000..2958f29e
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/Chart.yaml
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v2
+name: kube-state-metrics
+description: A Helm chart for Kubernetes
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# This is the chart version. This version number should be incremented each time you make changes
+# to the chart and its templates, including the app version.
+# Versions are expected to follow Semantic Versioning (https://semver.org/)
+version: 0.1.0
+
+# This is the version number of the application being deployed. This version number should be
+# incremented each time you make changes to the application. Versions are not expected to
+# follow Semantic Versioning. They should reflect the version the application is using.
+# It is recommended to use it with quotes.
+appVersion: "1.16.0"
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/_charts.tpl b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/_charts.tpl
new file mode 100644
index 00000000..09dc7836
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/_charts.tpl
@@ -0,0 +1,82 @@
+{{/*
+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 "kube-state-metrics.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 -}}
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "kube-state-metrics.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "kube-state-metrics.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create -}}
+ {{ default (include "kube-state-metrics.fullname" .) .Values.serviceAccount.name }}
+{{- else -}}
+ {{ default "default" .Values.serviceAccount.name }}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Allow the release namespace to be overridden for multi-namespace deployments in combined charts
+*/}}
+{{- define "kube-state-metrics.namespace" -}}
+{{- if .Values.namespaceOverride -}}
+ {{- .Values.namespaceOverride -}}
+{{- else -}}
+ {{- .Release.Namespace -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "kube-state-metrics.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Generate basic labels
+*/}}
+{{- define "kube-state-metrics.labels" }}
+helm.sh/chart: {{ template "kube-state-metrics.chart" . }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+app.kubernetes.io/component: metrics
+app.kubernetes.io/part-of: {{ template "kube-state-metrics.name" . }}
+{{- include "kube-state-metrics.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+{{- if .Values.customLabels }}
+{{ toYaml .Values.customLabels }}
+{{- end }}
+{{- if .Values.releaseLabel }}
+release: {{ .Release.Name }}
+{{- end }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "kube-state-metrics.selectorLabels" }}
+app.kubernetes.io/name: {{ include "kube-state-metrics.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/clusterrolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/clusterrolebinding.yaml
new file mode 100644
index 00000000..b713fa24
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/clusterrolebinding.yaml
@@ -0,0 +1,35 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.rbac.create .Values.rbac.useClusterRole -}}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+ name: {{ template "kube-state-metrics.fullname" . }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+{{- if .Values.rbac.useExistingRole }}
+ name: {{ .Values.rbac.useExistingRole }}
+{{- else }}
+ name: {{ template "kube-state-metrics.fullname" . }}
+{{- end }}
+subjects:
+- kind: ServiceAccount
+ name: {{ template "kube-state-metrics.serviceAccountName" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/deployment.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/deployment.yaml
new file mode 100644
index 00000000..3a910cdb
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/deployment.yaml
@@ -0,0 +1,163 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1
+{{- if .Values.autosharding.enabled }}
+kind: StatefulSet
+{{- else }}
+kind: Deployment
+{{- end }}
+metadata:
+ name: {{ template "kube-state-metrics.fullname" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+spec:
+ selector:
+ matchLabels:
+ {{- include "kube-state-metrics.selectorLabels" . | indent 6 }}
+ replicas: {{ .Values.replicas }}
+ {{- if .Values.autosharding.enabled }}
+ serviceName: {{ template "kube-state-metrics.fullname" . }}
+ volumeClaimTemplates: []
+ {{- end }}
+ template:
+ metadata:
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 8 }}
+ {{- if .Values.podAnnotations }}
+ annotations:
+{{ toYaml .Values.podAnnotations | indent 8 }}
+ {{- end }}
+ spec:
+ hostNetwork: {{ .Values.hostNetwork }}
+ serviceAccountName: {{ template "kube-state-metrics.serviceAccountName" . }}
+ {{- if .Values.securityContext.enabled }}
+ securityContext:
+ fsGroup: {{ .Values.securityContext.fsGroup }}
+ runAsGroup: {{ .Values.securityContext.runAsGroup }}
+ runAsUser: {{ .Values.securityContext.runAsUser }}
+ {{- end }}
+ {{- if .Values.priorityClassName }}
+ priorityClassName: {{ .Values.priorityClassName }}
+ {{- end }}
+ containers:
+ - name: {{ .Chart.Name }}
+ {{- if .Values.autosharding.enabled }}
+ env:
+ - name: POD_NAME
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.name
+ - name: POD_NAMESPACE
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.namespace
+ {{- end }}
+ args:
+ {{- if .Values.extraArgs }}
+ {{- range .Values.extraArgs }}
+ - {{ . }}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.service.port }}
+ - --port={{ .Values.service.port | default 8080}}
+ {{- end }}
+ {{- if .Values.collectors }}
+ - --resources={{ .Values.collectors | join "," }}
+ {{- end }}
+ {{- if .Values.metricLabelsAllowlist }}
+ - --metric-labels-allowlist={{ .Values.metricLabelsAllowlist | join "," }}
+ {{- end }}
+ {{- if .Values.metricAnnotationsAllowList }}
+ - --metric-annotations-allowlist={{ .Values.metricAnnotationsAllowList | join "," }}
+ {{- end }}
+ {{- if .Values.metricAllowlist }}
+ - --metric-allowlist={{ .Values.metricAllowlist | join "," }}
+ {{- end }}
+ {{- if .Values.metricDenylist }}
+ - --metric-denylist={{ .Values.metricDenylist | join "," }}
+ {{- end }}
+ {{- if .Values.namespaces }}
+ - --namespaces={{ tpl (.Values.namespaces | join ",") $ }}
+ {{- end }}
+ {{- if .Values.autosharding.enabled }}
+ - --pod=$(POD_NAME)
+ - --pod-namespace=$(POD_NAMESPACE)
+ {{- end }}
+ {{- if .Values.kubeconfig.enabled }}
+ - --kubeconfig=/opt/k8s/.kube/config
+ {{- end }}
+ {{- if .Values.selfMonitor.telemetryHost }}
+ - --telemetry-host={{ .Values.selfMonitor.telemetryHost }}
+ {{- end }}
+ - --telemetry-port={{ .Values.selfMonitor.telemetryPort | default 8081 }}
+ {{- if .Values.kubeconfig.enabled }}
+ volumeMounts:
+ - name: kubeconfig
+ mountPath: /opt/k8s/.kube/
+ readOnly: true
+ {{- end }}
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ ports:
+ - containerPort: {{ .Values.service.port | default 8080}}
+ name: "http"
+ {{- if .Values.selfMonitor.enabled }}
+ - containerPort: {{ .Values.selfMonitor.telemetryPort | default 8081 }}
+ name: "metrics"
+ {{- end }}
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: {{ .Values.service.port | default 8080}}
+ initialDelaySeconds: 5
+ timeoutSeconds: 5
+ readinessProbe:
+ httpGet:
+ path: /
+ port: {{ .Values.service.port | default 8080}}
+ initialDelaySeconds: 5
+ timeoutSeconds: 5
+ {{- if .Values.resources }}
+ resources:
+{{ toYaml .Values.resources | indent 10 }}
+{{- end }}
+{{- if .Values.containerSecurityContext }}
+ securityContext:
+{{ toYaml .Values.containerSecurityContext | indent 10 }}
+{{- end }}
+{{- if .Values.imagePullSecrets }}
+ imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+ {{- end }}
+ {{- if .Values.affinity }}
+ affinity:
+{{ toYaml .Values.affinity | indent 8 }}
+ {{- end }}
+ {{- if .Values.nodeSelector }}
+ nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 8 }}
+ {{- end }}
+ {{- if .Values.tolerations }}
+ tolerations:
+{{ toYaml .Values.tolerations | indent 8 }}
+ {{- end }}
+ {{- if .Values.kubeconfig.enabled}}
+ volumes:
+ - name: kubeconfig
+ secret:
+ secretName: {{ template "kube-state-metrics.fullname" . }}-kubeconfig
+ {{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/kubeconfig-secret.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/kubeconfig-secret.yaml
new file mode 100644
index 00000000..0a61be9b
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/kubeconfig-secret.yaml
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.kubeconfig.enabled -}}
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ template "kube-state-metrics.fullname" . }}-kubeconfig
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+type: Opaque
+data:
+ config: '{{ .Values.kubeconfig.secret }}'
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/pdb.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/pdb.yaml
new file mode 100644
index 00000000..a08612c2
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/pdb.yaml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.podDisruptionBudget -}}
+apiVersion: policy/v1beta1
+kind: PodDisruptionBudget
+metadata:
+ name: {{ template "kube-state-metrics.fullname" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+spec:
+ selector:
+ matchLabels:
+ app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
+{{ toYaml .Values.podDisruptionBudget | indent 2 }}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/podsecuritypolicy.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/podsecuritypolicy.yaml
new file mode 100644
index 00000000..f07d8e62
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/podsecuritypolicy.yaml
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.podSecurityPolicy.enabled }}
+apiVersion: policy/v1beta1
+kind: PodSecurityPolicy
+metadata:
+ name: {{ template "kube-state-metrics.fullname" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+{{- if .Values.podSecurityPolicy.annotations }}
+ annotations:
+{{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }}
+{{- end }}
+spec:
+ privileged: false
+ volumes:
+ - 'secret'
+{{- if .Values.podSecurityPolicy.additionalVolumes }}
+{{ toYaml .Values.podSecurityPolicy.additionalVolumes | indent 4 }}
+{{- end }}
+ hostNetwork: false
+ hostIPC: false
+ hostPID: false
+ runAsUser:
+ rule: 'MustRunAsNonRoot'
+ seLinux:
+ rule: 'RunAsAny'
+ supplementalGroups:
+ rule: 'MustRunAs'
+ ranges:
+ # Forbid adding the root group.
+ - min: 1
+ max: 65535
+ fsGroup:
+ rule: 'MustRunAs'
+ ranges:
+ # Forbid adding the root group.
+ - min: 1
+ max: 65535
+ readOnlyRootFilesystem: false
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/psp-clusterrole.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/psp-clusterrole.yaml
new file mode 100644
index 00000000..53e33712
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/psp-clusterrole.yaml
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.create -}}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+ name: psp-{{ template "kube-state-metrics.fullname" . }}
+rules:
+{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }}
+{{- if semverCompare "> 1.15.0-0" $kubeTargetVersion }}
+- apiGroups: ['policy']
+{{- else }}
+- apiGroups: ['extensions']
+{{- end }}
+ resources: ['podsecuritypolicies']
+ verbs: ['use']
+ resourceNames:
+ - {{ template "kube-state-metrics.fullname" . }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml
new file mode 100644
index 00000000..e8b513c2
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/psp-clusterrolebinding.yaml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.create -}}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+ name: psp-{{ template "kube-state-metrics.fullname" . }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: psp-{{ template "kube-state-metrics.fullname" . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ template "kube-state-metrics.serviceAccountName" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/role.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/role.yaml
new file mode 100644
index 00000000..55e6554d
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/role.yaml
@@ -0,0 +1,202 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and (eq .Values.rbac.create true) (not .Values.rbac.useExistingRole) -}}
+{{- range (ternary (split "," .Values.namespaces) (list "") (eq $.Values.rbac.useClusterRole false)) }}
+---
+apiVersion: rbac.authorization.k8s.io/v1
+{{- if eq $.Values.rbac.useClusterRole false }}
+kind: Role
+{{- else }}
+kind: ClusterRole
+{{- end }}
+metadata:
+ labels:
+ {{- include "kube-state-metrics.labels" $ | indent 4 }}
+ name: {{ template "kube-state-metrics.fullname" $ }}
+{{- if eq $.Values.rbac.useClusterRole false }}
+ namespace: {{ . }}
+{{- end }}
+rules:
+{{ if has "certificatesigningrequests" $.Values.collectors }}
+- apiGroups: ["certificates.k8s.io"]
+ resources:
+ - certificatesigningrequests
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "configmaps" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - configmaps
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "cronjobs" $.Values.collectors }}
+- apiGroups: ["batch"]
+ resources:
+ - cronjobs
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "daemonsets" $.Values.collectors }}
+- apiGroups: ["extensions", "apps"]
+ resources:
+ - daemonsets
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "deployments" $.Values.collectors }}
+- apiGroups: ["extensions", "apps"]
+ resources:
+ - deployments
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "endpoints" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - endpoints
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "horizontalpodautoscalers" $.Values.collectors }}
+- apiGroups: ["autoscaling"]
+ resources:
+ - horizontalpodautoscalers
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "ingresses" $.Values.collectors }}
+- apiGroups: ["extensions", "networking.k8s.io"]
+ resources:
+ - ingresses
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "jobs" $.Values.collectors }}
+- apiGroups: ["batch"]
+ resources:
+ - jobs
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "limitranges" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - limitranges
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "mutatingwebhookconfigurations" $.Values.collectors }}
+- apiGroups: ["admissionregistration.k8s.io"]
+ resources:
+ - mutatingwebhookconfigurations
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "namespaces" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - namespaces
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "networkpolicies" $.Values.collectors }}
+- apiGroups: ["networking.k8s.io"]
+ resources:
+ - networkpolicies
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "nodes" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - nodes
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "persistentvolumeclaims" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - persistentvolumeclaims
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "persistentvolumes" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - persistentvolumes
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "poddisruptionbudgets" $.Values.collectors }}
+- apiGroups: ["policy"]
+ resources:
+ - poddisruptionbudgets
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "pods" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - pods
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "replicasets" $.Values.collectors }}
+- apiGroups: ["extensions", "apps"]
+ resources:
+ - replicasets
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "replicationcontrollers" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - replicationcontrollers
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "resourcequotas" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - resourcequotas
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "secrets" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - secrets
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "services" $.Values.collectors }}
+- apiGroups: [""]
+ resources:
+ - services
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "statefulsets" $.Values.collectors }}
+- apiGroups: ["apps"]
+ resources:
+ - statefulsets
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "storageclasses" $.Values.collectors }}
+- apiGroups: ["storage.k8s.io"]
+ resources:
+ - storageclasses
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "validatingwebhookconfigurations" $.Values.collectors }}
+- apiGroups: ["admissionregistration.k8s.io"]
+ resources:
+ - validatingwebhookconfigurations
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "volumeattachments" $.Values.collectors }}
+- apiGroups: ["storage.k8s.io"]
+ resources:
+ - volumeattachments
+ verbs: ["list", "watch"]
+{{ end -}}
+{{ if has "verticalpodautoscalers" $.Values.collectors }}
+- apiGroups: ["autoscaling.k8s.io"]
+ resources:
+ - verticalpodautoscalers
+ verbs: ["list", "watch"]
+{{ end -}}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/rolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/rolebinding.yaml
new file mode 100644
index 00000000..d986c603
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/rolebinding.yaml
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+ # contributor license agreements. See the NOTICE file distributed with
+ # this work for additional information regarding copyright ownership.
+ # The ASF licenses this file to You under the Apache License, Version 2.0
+ # (the "License"); you may not use this file except in compliance with
+ # the License. You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+
+{{- if and (eq .Values.rbac.create true) (eq .Values.rbac.useClusterRole false) -}}
+{{- range (split "," $.Values.namespaces) }}
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ labels:
+ {{- include "kube-state-metrics.labels" $ | indent 4 }}
+ name: {{ template "kube-state-metrics.fullname" $ }}
+ namespace: {{ . }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+{{- if (not $.Values.rbac.useExistingRole) }}
+ name: {{ template "kube-state-metrics.fullname" $ }}
+{{- else }}
+ name: {{ $.Values.rbac.useExistingRole }}
+{{- end }}
+subjects:
+- kind: ServiceAccount
+ name: {{ template "kube-state-metrics.serviceAccountName" $ }}
+ namespace: {{ template "kube-state-metrics.namespace" $ }}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/service.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/service.yaml
new file mode 100644
index 00000000..04de5166
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/service.yaml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ template "kube-state-metrics.fullname" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+ annotations:
+ {{- if .Values.prometheusScrape }}
+ prometheus.io/scrape: '{{ .Values.prometheusScrape }}'
+ {{- end }}
+ {{- if .Values.service.annotations }}
+ {{- toYaml .Values.service.annotations | nindent 4 }}
+ {{- end }}
+spec:
+ type: "{{ .Values.service.type }}"
+ ports:
+ - name: "http"
+ protocol: TCP
+ port: {{ .Values.service.port | default 8080}}
+ {{- if .Values.service.nodePort }}
+ nodePort: {{ .Values.service.nodePort }}
+ {{- end }}
+ targetPort: {{ .Values.service.port | default 8080}}
+ {{ if .Values.selfMonitor.enabled }}
+ - name: "metrics"
+ protocol: TCP
+ port: {{ .Values.selfMonitor.telemetryPort | default 8081 }}
+ targetPort: {{ .Values.selfMonitor.telemetryPort | default 8081 }}
+ {{ end }}
+{{- if .Values.service.loadBalancerIP }}
+ loadBalancerIP: "{{ .Values.service.loadBalancerIP }}"
+{{- end }}
+ selector:
+ {{- include "kube-state-metrics.selectorLabels" . | indent 4 }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/serviceaccount.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/serviceaccount.yaml
new file mode 100644
index 00000000..befc6fb3
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/serviceaccount.yaml
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.serviceAccount.create -}}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+ name: {{ template "kube-state-metrics.serviceAccountName" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+{{- if .Values.serviceAccount.annotations }}
+ annotations:
+{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
+{{- end }}
+imagePullSecrets:
+{{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/servicemonitor.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/servicemonitor.yaml
new file mode 100644
index 00000000..27fa92c0
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/servicemonitor.yaml
@@ -0,0 +1,81 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.prometheus.monitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ name: {{ template "kube-state-metrics.fullname" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+ {{- with .Values.prometheus.monitor.additionalLabels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ jobLabel: {{ default "app.kubernetes.io/name" .Values.prometheus.monitor.jobLabel }}
+ selector:
+ matchLabels:
+ {{- if .Values.prometheus.monitor.selectorOverride -}}
+ {{ toYaml .Values.prometheus.monitor.selectorOverride | nindent 6 }}
+ {{ else }}
+ {{- include "kube-state-metrics.selectorLabels" . | indent 6 }}
+ {{- end }}
+ endpoints:
+ - port: http
+ {{- if .Values.prometheus.monitor.interval }}
+ interval: {{ .Values.prometheus.monitor.interval }}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.scrapeTimeout }}
+ scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.proxyUrl }}
+ proxyUrl: {{ .Values.prometheus.monitor.proxyUrl}}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.honorLabels }}
+ honorLabels: true
+ {{- end }}
+ {{- if .Values.prometheus.monitor.metricRelabelings }}
+ metricRelabelings:
+ {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.relabelings }}
+ relabelings:
+ {{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}
+ {{- end }}
+ {{- if .Values.selfMonitor.enabled }}
+ - port: metrics
+ {{- if .Values.prometheus.monitor.interval }}
+ interval: {{ .Values.prometheus.monitor.interval }}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.scrapeTimeout }}
+ scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.proxyUrl }}
+ proxyUrl: {{ .Values.prometheus.monitor.proxyUrl}}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.honorLabels }}
+ honorLabels: true
+ {{- end }}
+ {{- if .Values.prometheus.monitor.metricRelabelings }}
+ metricRelabelings:
+ {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }}
+ {{- end }}
+ {{- if .Values.prometheus.monitor.relabelings }}
+ relabelings:
+ {{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/stsdiscovery-role.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/stsdiscovery-role.yaml
new file mode 100644
index 00000000..558f2942
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/stsdiscovery-role.yaml
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.autosharding.enabled .Values.rbac.create -}}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: stsdiscovery-{{ template "kube-state-metrics.fullname" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+rules:
+- apiGroups:
+ - ""
+ resources:
+ - pods
+ verbs:
+ - get
+- apiGroups:
+ - apps
+ resourceNames:
+ - {{ template "kube-state-metrics.fullname" . }}
+ resources:
+ - statefulsets
+ verbs:
+ - get
+ - list
+ - watch
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/stsdiscovery-rolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/stsdiscovery-rolebinding.yaml
new file mode 100644
index 00000000..5c81c7e5
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/templates/stsdiscovery-rolebinding.yaml
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.autosharding.enabled .Values.rbac.create -}}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: stsdiscovery-{{ template "kube-state-metrics.fullname" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+ labels:
+ {{- include "kube-state-metrics.labels" . | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: stsdiscovery-{{ template "kube-state-metrics.fullname" . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ template "kube-state-metrics.serviceAccountName" . }}
+ namespace: {{ template "kube-state-metrics.namespace" . }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/values.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/values.yaml
new file mode 100644
index 00000000..3538e350
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/kube-state-metrics/values.yaml
@@ -0,0 +1,239 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Default values for kube-state-metrics.
+prometheusScrape: true
+image:
+ repository: k8s.gcr.io/kube-state-metrics/kube-state-metrics
+ tag: v2.3.0
+ pullPolicy: IfNotPresent
+
+imagePullSecrets: []
+# - name: "image-pull-secret"
+
+# If set to true, this will deploy kube-state-metrics as a StatefulSet and the data
+# will be automatically sharded across <.Values.replicas> pods using the built-in
+# autodiscovery feature: https://github.com/kubernetes/kube-state-metrics#automated-sharding
+# This is an experimental feature and there are no stability guarantees.
+autosharding:
+ enabled: false
+
+replicas: 1
+
+# List of additional cli arguments to configure kube-state-metrics
+# for example: --enable-gzip-encoding, --log-file, etc.
+# all the possible args can be found here: https://github.com/kubernetes/kube-state-metrics/blob/master/docs/cli-arguments.md
+extraArgs: []
+
+service:
+ port: 8080
+ # Default to clusterIP for backward compatibility
+ type: ClusterIP
+ nodePort: 0
+ loadBalancerIP: ""
+ annotations: {}
+
+## Additional labels to add to all resources
+customLabels: {}
+# app: kube-state-metrics
+
+## set to true to add the release label so scraping of the servicemonitor with kube-prometheus-stack works out of the box
+releaseLabel: false
+
+hostNetwork: false
+
+rbac:
+ # If true, create & use RBAC resources
+ create: true
+
+ # Set to a rolename to use existing role - skipping role creating - but still doing serviceaccount and rolebinding to it, rolename set here.
+ # useExistingRole: your-existing-role
+
+ # If set to false - Run without Cluteradmin privs needed - ONLY works if namespace is also set (if useExistingRole is set this name is used as ClusterRole or Role to bind to)
+ useClusterRole: true
+
+serviceAccount:
+ # Specifies whether a ServiceAccount should be created, require rbac true
+ create: true
+ # The name of the ServiceAccount to use.
+ # If not set and create is true, a name is generated using the fullname template
+ name:
+ # Reference to one or more secrets to be used when pulling images
+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
+ imagePullSecrets: []
+ # ServiceAccount annotations.
+ # Use case: AWS EKS IAM roles for service accounts
+ # ref: https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html
+ annotations: {}
+
+prometheus:
+ monitor:
+ enabled: false
+ additionalLabels: {}
+ namespace: ""
+ jobLabel: ""
+ interval: ""
+ scrapeTimeout: ""
+ proxyUrl: ""
+ selectorOverride: {}
+ honorLabels: false
+ metricRelabelings: []
+ relabelings: []
+
+## Specify if a Pod Security Policy for kube-state-metrics must be created
+## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
+##
+podSecurityPolicy:
+ enabled: false
+ annotations: {}
+ ## Specify pod annotations
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
+ ##
+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
+ # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
+ # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
+
+ additionalVolumes: []
+
+securityContext:
+ enabled: true
+ runAsGroup: 65534
+ runAsUser: 65534
+ fsGroup: 65534
+
+## Specify security settings for a Container
+## Allows overrides and additional options compared to (Pod) securityContext
+## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
+containerSecurityContext: {}
+
+## Node labels for pod assignment
+## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+nodeSelector: {}
+
+## Affinity settings for pod assignment
+## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+affinity: {}
+
+## Tolerations for pod assignment
+## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
+tolerations: []
+
+# Annotations to be added to the pod
+podAnnotations: {}
+
+## Assign a PriorityClassName to pods if set
+# priorityClassName: ""
+
+# Ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
+podDisruptionBudget: {}
+
+# Comma-separated list of metrics to be exposed.
+# This list comprises of exact metric names and/or regex patterns.
+# The allowlist and denylist are mutually exclusive.
+metricAllowlist: []
+
+# Comma-separated list of metrics not to be enabled.
+# This list comprises of exact metric names and/or regex patterns.
+# The allowlist and denylist are mutually exclusive.
+metricDenylist: []
+
+# Comma-separated list of additional Kubernetes label keys that will be used in the resource's
+# labels metric. By default the metric contains only name and namespace labels.
+# To include additional labels, provide a list of resource names in their plural form and Kubernetes
+# label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'.
+# A single '*' can be provided per resource instead to allow any labels, but that has
+# severe performance implications (Example: '=pods=[*]').
+metricLabelsAllowlist: []
+# - namespaces=[k8s-label-1,k8s-label-n]
+
+# Comma-separated list of Kubernetes annotations keys that will be used in the resource'
+# labels metric. By default the metric contains only name and namespace labels.
+# To include additional annotations provide a list of resource names in their plural form and Kubernetes
+# annotation keys you would like to allow for them (Example: '=namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...)'.
+# A single '*' can be provided per resource instead to allow any annotations, but that has
+# severe performance implications (Example: '=pods=[*]').
+metricAnnotationsAllowList: []
+# - pods=[k8s-annotation-1,k8s-annotation-n]
+
+# Available collectors for kube-state-metrics.
+# By default, all available resources are enabled, comment out to disable.
+collectors:
+ - certificatesigningrequests
+ - configmaps
+ - cronjobs
+ - daemonsets
+ - deployments
+ - endpoints
+ - horizontalpodautoscalers
+ - ingresses
+ - jobs
+ - limitranges
+ - mutatingwebhookconfigurations
+ - namespaces
+ - networkpolicies
+ - nodes
+ - persistentvolumeclaims
+ - persistentvolumes
+ - poddisruptionbudgets
+ - pods
+ - replicasets
+ - replicationcontrollers
+ - resourcequotas
+ - secrets
+ - services
+ - statefulsets
+ - storageclasses
+ - validatingwebhookconfigurations
+ - volumeattachments
+ # - verticalpodautoscalers # not a default resource, see also: https://github.com/kubernetes/kube-state-metrics#enabling-verticalpodautoscalers
+
+# Enabling kubeconfig will pass the --kubeconfig argument to the container
+kubeconfig:
+ enabled: false
+ # base64 encoded kube-config file
+ secret:
+
+# Comma-separated list of namespaces to be enabled for collecting resources. By default all namespaces are collected.
+namespaces: ""
+
+## Override the deployment namespace
+##
+namespaceOverride: ""
+
+resources: {}
+ # We usually recommend not to specify default resources and to leave this as a conscious
+ # choice for the user. This also increases chances charts run on environments with little
+ # resources, such as Minikube. If you do want to specify resources, uncomment the following
+ # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
+ # limits:
+ # cpu: 100m
+ # memory: 64Mi
+ # requests:
+ # cpu: 10m
+# memory: 32Mi
+
+## Provide a k8s version to define apiGroups for podSecurityPolicy Cluster Role.
+## For example: kubeTargetVersionOverride: 1.14.9
+##
+kubeTargetVersionOverride: ""
+
+# Enable self metrics configuration for service and Service Monitor
+# Default values for telemetry configuration can be overridden
+selfMonitor:
+ enabled: false
+ # telemetryHost: 0.0.0.0
+ # telemetryPort: 8081
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/.helmignore b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/.helmignore
new file mode 100644
index 00000000..aaa0d115
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.vscode
+.project
+.idea/
+*.tmproj
+OWNERS
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/Chart.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/Chart.yaml
new file mode 100644
index 00000000..d15525c8
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/Chart.yaml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v2
+appVersion: 1.5.0
+description: A Helm chart for prometheus node-exporter
+home: https://github.com/prometheus/node_exporter/
+keywords:
+ - node-exporter
+ - prometheus
+ - exporter
+maintainers:
+ - email: dev@dubbo.apache.org
+ name: dubbo
+name: prometheus-node-exporter
+sources:
+ - https://github.com/prometheus/node_exporter/
+type: application
+version: 4.8.1
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/_charts.tpl b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/_charts.tpl
new file mode 100644
index 00000000..da3968a4
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/_charts.tpl
@@ -0,0 +1,113 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "prometheus-node-exporter.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 "prometheus-node-exporter.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 }}
+
+{{/*
+Allow the release namespace to be overridden for multi-namespace deployments in combined charts
+*/}}
+{{- define "prometheus-node-exporter.namespace" -}}
+{{- if .Values.namespaceOverride }}
+{{- .Values.namespaceOverride }}
+{{- else }}
+{{- .Release.Namespace }}
+{{- end }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "prometheus-node-exporter.labels" -}}
+helm.sh/chart: {{ include "prometheus-node-exporter.chart" . }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+app.kubernetes.io/component: metrics
+app.kubernetes.io/part-of: {{ include "prometheus-node-exporter.name" . }}
+{{ include "prometheus-node-exporter.selectorLabels" . }}
+{{- with .Chart.AppVersion }}
+app.kubernetes.io/version: {{ . | quote }}
+{{- end }}
+{{- with .Values.podLabels }}
+{{ toYaml . }}
+{{- end }}
+{{- if .Values.releaseLabel }}
+release: {{ .Release.Name }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "prometheus-node-exporter.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{- define "prometheus.nodeExporter.matchLabels" -}}
+component: {{ .Values.nodeExporter.name | quote }}
+{{ include "prometheus.common.matchLabels" . }}
+{{- end -}}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "prometheus-node-exporter.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "prometheus-node-exporter.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
+
+{{/*
+The image to use
+*/}}
+{{- define "prometheus-node-exporter.image" -}}
+{{- if .Values.nodeExporter.image.sha }}
+{{- printf "%s:%s@%s" .Values.nodeExporter.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.nodeExporter.image.tag) .Values.nodeExporter.image.sha }}
+{{- else }}
+{{- printf "%s:%s" .Values.nodeExporter.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.nodeExporter.image.tag) }}
+{{- end }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "prometheus-node-exporter.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "prometheus-node-exporter.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the namespace name of the service monitor
+*/}}
+{{- define "prometheus-node-exporter.monitor-namespace" -}}
+{{- if .Values.namespaceOverride }}
+{{- .Values.namespaceOverride }}
+{{- else }}
+{{- if .Values.prometheus.monitor.namespace }}
+{{- .Values.prometheus.monitor.namespace }}
+{{- else }}
+{{- .Release.Namespace }}
+{{- end }}
+{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/daemonset.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/daemonset.yaml
new file mode 100644
index 00000000..7f1bdd0b
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/daemonset.yaml
@@ -0,0 +1,240 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1
+kind: DaemonSet
+metadata:
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ namespace: {{ include "prometheus-node-exporter.namespace" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+ {{- with .Values.daemonsetAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ selector:
+ matchLabels:
+ {{- include "prometheus-node-exporter.selectorLabels" . | nindent 6 }}
+ {{- with .Values.updateStrategy }}
+ updateStrategy:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ template:
+ metadata:
+ {{- with .Values.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 8 }}
+ spec:
+ automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
+ {{- with .Values.securityContext }}
+ securityContext:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.priorityClassName }}
+ priorityClassName: {{ . }}
+ {{- end }}
+ {{- with .Values.extraInitContainers }}
+ initContainers:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ serviceAccountName: {{ include "prometheus-node-exporter.serviceAccountName" . }}
+ containers:
+ - name: node-exporter
+ image: {{ include "prometheus-node-exporter.image" . }}
+ imagePullPolicy: {{ .Values.nodeExporter.image.pullPolicy }}
+ args:
+ - --path.procfs=/host/proc
+ - --path.sysfs=/host/sys
+ {{- if .Values.hostRootFsMount.enabled }}
+ - --path.rootfs=/host/root
+ {{- end }}
+ - --web.listen-address=[$(HOST_IP)]:{{ .Values.service.port }}
+ {{- with .Values.extraArgs }}
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ {{- with .Values.containerSecurityContext }}
+ securityContext:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ env:
+ - name: HOST_IP
+ {{- if .Values.service.listenOnAllInterfaces }}
+ value: 0.0.0.0
+ {{- else }}
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: status.hostIP
+ {{- end }}
+ {{- range $key, $value := .Values.env }}
+ - name: {{ $key }}
+ value: {{ $value | quote }}
+ {{- end }}
+ ports:
+ - name: {{ .Values.service.portName }}
+ containerPort: {{ .Values.service.port }}
+ protocol: TCP
+ livenessProbe:
+ failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
+ httpGet:
+ httpHeaders:
+ {{- range $_, $header := .Values.livenessProbe.httpGet.httpHeaders }}
+ - name: {{ $header.name }}
+ value: {{ $header.value }}
+ {{- end }}
+ path: /
+ port: {{ .Values.service.port }}
+ scheme: {{ upper .Values.livenessProbe.httpGet.scheme }}
+ initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
+ periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
+ successThreshold: {{ .Values.livenessProbe.successThreshold }}
+ timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
+ readinessProbe:
+ failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
+ httpGet:
+ httpHeaders:
+ {{- range $_, $header := .Values.readinessProbe.httpGet.httpHeaders }}
+ - name: {{ $header.name }}
+ value: {{ $header.value }}
+ {{- end }}
+ path: /
+ port: {{ .Values.service.port }}
+ scheme: {{ upper .Values.readinessProbe.httpGet.scheme }}
+ initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
+ periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
+ successThreshold: {{ .Values.readinessProbe.successThreshold }}
+ timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
+ {{- with .Values.resources }}
+ resources:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ volumeMounts:
+ - name: proc
+ mountPath: /host/proc
+ readOnly: true
+ - name: sys
+ mountPath: /host/sys
+ readOnly: true
+ {{- if .Values.hostRootFsMount.enabled }}
+ - name: root
+ mountPath: /host/root
+ {{- with .Values.hostRootFsMount.mountPropagation }}
+ mountPropagation: {{ . }}
+ {{- end }}
+ readOnly: true
+ {{- end }}
+ {{- range $_, $mount := .Values.extraHostVolumeMounts }}
+ - name: {{ $mount.name }}
+ mountPath: {{ $mount.mountPath }}
+ readOnly: {{ $mount.readOnly }}
+ {{- with $mount.mountPropagation }}
+ mountPropagation: {{ . }}
+ {{- end }}
+ {{- end }}
+ {{- range $_, $mount := .Values.sidecarVolumeMount }}
+ - name: {{ $mount.name }}
+ mountPath: {{ $mount.mountPath }}
+ readOnly: true
+ {{- end }}
+ {{- range $_, $mount := .Values.configmaps }}
+ - name: {{ $mount.name }}
+ mountPath: {{ $mount.mountPath }}
+ {{- end }}
+ {{- range $_, $mount := .Values.secrets }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ {{- end }}
+ {{- with .Values.sidecars }}
+ {{- toYaml . | nindent 8 }}
+ {{- if or $.Values.sidecarVolumeMount $.Values.sidecarHostVolumeMounts }}
+ volumeMounts:
+ {{- range $_, $mount := $.Values.sidecarVolumeMount }}
+ - name: {{ $mount.name }}
+ mountPath: {{ $mount.mountPath }}
+ readOnly: {{ $mount.readOnly }}
+ {{- end }}
+ {{- range $_, $mount := $.Values.sidecarHostVolumeMounts }}
+ - name: {{ $mount.name }}
+ mountPath: {{ $mount.mountPath }}
+ readOnly: {{ $mount.readOnly }}
+ {{- if $mount.mountPropagation }}
+ mountPropagation: {{ $mount.mountPropagation }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
+ {{- with .Values.imagePullSecrets }}
+ imagePullSecrets:
+ {{ toYaml . | nindent 8 }}
+ {{- end }}
+ hostNetwork: {{ .Values.hostNetwork }}
+ hostPID: {{ .Values.hostPID }}
+ {{- with .Values.affinity }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.dnsConfig }}
+ dnsConfig:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ volumes:
+ - name: proc
+ hostPath:
+ path: /proc
+ - name: sys
+ hostPath:
+ path: /sys
+ {{- if .Values.hostRootFsMount.enabled }}
+ - name: root
+ hostPath:
+ path: /
+ {{- end }}
+ {{- range $_, $mount := .Values.extraHostVolumeMounts }}
+ - name: {{ $mount.name }}
+ hostPath:
+ path: {{ $mount.hostPath }}
+ {{- end }}
+ {{- range $_, $mount := .Values.sidecarVolumeMount }}
+ - name: {{ $mount.name }}
+ emptyDir:
+ medium: Memory
+ {{- end }}
+ {{- range $_, $mount := .Values.sidecarHostVolumeMounts }}
+ - name: {{ $mount.name }}
+ hostPath:
+ path: {{ $mount.hostPath }}
+ {{- end }}
+ {{- range $_, $mount := .Values.configmaps }}
+ - name: {{ $mount.name }}
+ configMap:
+ name: {{ $mount.name }}
+ {{- end }}
+ {{- range $_, $mount := .Values.secrets }}
+ - name: {{ $mount.name }}
+ secret:
+ secretName: {{ $mount.name }}
+ {{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/endpoints.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/endpoints.yaml
new file mode 100644
index 00000000..2082929e
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/endpoints.yaml
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.endpoints }}
+apiVersion: v1
+kind: Endpoints
+metadata:
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ namespace: {{ include "prometheus-node-exporter.namespace" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+subsets:
+ - addresses:
+ {{- range .Values.endpoints }}
+ - ip: {{ . }}
+ {{- end }}
+ ports:
+ - name: {{ .Values.service.portName }}
+ port: 9100
+ protocol: TCP
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp-clusterrole.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp-clusterrole.yaml
new file mode 100644
index 00000000..a7248a29
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp-clusterrole.yaml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.rbac.create .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
+kind: ClusterRole
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: psp-{{ include "prometheus-node-exporter.fullname" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+rules:
+- apiGroups: ['extensions']
+ resources: ['podsecuritypolicies']
+ verbs: ['use']
+ resourceNames:
+ - {{ include "prometheus-node-exporter.fullname" . }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp-clusterrolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp-clusterrolebinding.yaml
new file mode 100644
index 00000000..255ea476
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp-clusterrolebinding.yaml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.rbac.create .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: psp-{{ include "prometheus-node-exporter.fullname" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: psp-{{ include "prometheus-node-exporter.fullname" . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ namespace: {{ include "prometheus-node-exporter.namespace" . }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp.yaml
new file mode 100644
index 00000000..62310805
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/psp.yaml
@@ -0,0 +1,64 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.rbac.create .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
+apiVersion: policy/v1beta1
+kind: PodSecurityPolicy
+metadata:
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ namespace: {{ include "prometheus-node-exporter.namespace" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+ {{- with .Values.rbac.pspAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ privileged: false
+ # Allow core volume types.
+ volumes:
+ - 'configMap'
+ - 'emptyDir'
+ - 'projected'
+ - 'secret'
+ - 'downwardAPI'
+ - 'persistentVolumeClaim'
+ - 'hostPath'
+ hostNetwork: true
+ hostIPC: false
+ hostPID: true
+ hostPorts:
+ - min: 0
+ max: 65535
+ runAsUser:
+ # Permits the container to run with root privileges as well.
+ rule: 'RunAsAny'
+ seLinux:
+ # This policy assumes the nodes are using AppArmor rather than SELinux.
+ rule: 'RunAsAny'
+ supplementalGroups:
+ rule: 'MustRunAs'
+ ranges:
+ # Allow adding the root group.
+ - min: 0
+ max: 65535
+ fsGroup:
+ rule: 'MustRunAs'
+ ranges:
+ # Allow adding the root group.
+ - min: 0
+ max: 65535
+ readOnlyRootFilesystem: false
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/service.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/service.yaml
new file mode 100644
index 00000000..7efe5b81
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/service.yaml
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ namespace: {{ include "prometheus-node-exporter.namespace" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" $ | nindent 4 }}
+ {{- with .Values.service.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ type: {{ .Values.service.type }}
+ ports:
+ - port: {{ .Values.service.port }}
+ {{- if ( and (eq .Values.service.type "NodePort" ) (not (empty .Values.service.nodePort)) ) }}
+ nodePort: {{ .Values.service.nodePort }}
+ {{- end }}
+ targetPort: {{ .Values.service.targetPort }}
+ protocol: TCP
+ name: {{ .Values.service.portName }}
+ selector:
+ {{- include "prometheus-node-exporter.selectorLabels" . | nindent 4 }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/serviceaccount.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/serviceaccount.yaml
new file mode 100644
index 00000000..01b4bdb3
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/serviceaccount.yaml
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.rbac.create .Values.serviceAccount.create -}}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: {{ include "prometheus-node-exporter.serviceAccountName" . }}
+ namespace: {{ include "prometheus-node-exporter.namespace" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+ {{- with .Values.serviceAccount.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+{{- with .Values.imagePullSecrets }}
+imagePullSecrets:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/servicemonitor.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/servicemonitor.yaml
new file mode 100644
index 00000000..e0c7834a
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/servicemonitor.yaml
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.prometheus.monitor.enabled }}
+apiVersion: {{ .Values.prometheus.monitor.apiVersion | default "monitoring.coreos.com/v1" }}
+kind: ServiceMonitor
+metadata:
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ namespace: {{ include "prometheus-node-exporter.monitor-namespace" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+ {{- with .Values.prometheus.monitor.additionalLabels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ jobLabel: {{ default "app.kubernetes.io/name" .Values.prometheus.monitor.jobLabel }}
+ {{- include "servicemonitor.scrapeLimits" .Values.prometheus.monitor | nindent 2 }}
+ selector:
+ matchLabels:
+ {{- with .Values.prometheus.monitor.selectorOverride }}
+ {{- toYaml . | nindent 6 }}
+ {{- else }}
+ {{- include "prometheus-node-exporter.selectorLabels" . | nindent 6 }}
+ {{- end }}
+ endpoints:
+ - port: {{ .Values.service.portName }}
+ scheme: {{ .Values.prometheus.monitor.scheme }}
+ {{- with .Values.prometheus.monitor.basicAuth }}
+ basicAuth:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.prometheus.monitor.bearerTokenFile }}
+ bearerTokenFile: {{ . }}
+ {{- end }}
+ {{- with .Values.prometheus.monitor.tlsConfig }}
+ tlsConfig:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.prometheus.monitor.proxyUrl }}
+ proxyUrl: {{ . }}
+ {{- end }}
+ {{- with .Values.prometheus.monitor.interval }}
+ interval: {{ . }}
+ {{- end }}
+ {{- with .Values.prometheus.monitor.scrapeTimeout }}
+ scrapeTimeout: {{ . }}
+ {{- end }}
+ {{- with .Values.prometheus.monitor.relabelings }}
+ relabelings:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.prometheus.monitor.metricRelabelings }}
+ metricRelabelings:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/verticalpodautoscaler.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/verticalpodautoscaler.yaml
new file mode 100644
index 00000000..c379f4dc
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/templates/verticalpodautoscaler.yaml
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1") (.Values.verticalPodAutoscaler.enabled) }}
+apiVersion: autoscaling.k8s.io/v1
+kind: VerticalPodAutoscaler
+metadata:
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ namespace: {{ include "prometheus-node-exporter.namespace" . }}
+ labels:
+ {{- include "prometheus-node-exporter.labels" . | nindent 4 }}
+spec:
+ resourcePolicy:
+ containerPolicies:
+ - containerName: {{ include "prometheus-node-exporter.name" . }}
+ {{- with .Values.verticalPodAutoscaler.controlledResources }}
+ controlledResources: {{ . }}
+ {{- end }}
+ {{- with .Values.verticalPodAutoscaler.maxAllowed }}
+ maxAllowed:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.verticalPodAutoscaler.minAllowed }}
+ minAllowed:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ targetRef:
+ apiVersion: apps/v1
+ kind: DaemonSet
+ name: {{ include "prometheus-node-exporter.fullname" . }}
+ {{- if .Values.verticalPodAutoscaler.updatePolicy }}
+ updatePolicy:
+ {{- with .Values.verticalPodAutoscaler.updatePolicy.updateMode }}
+ updateMode: {{ . }}
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/values.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/values.yaml
new file mode 100644
index 00000000..07168b6d
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/node-exporter/values.yaml
@@ -0,0 +1,410 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rbac:
+ create: true
+
+podSecurityPolicy:
+ enabled: false
+
+imagePullSecrets:
+# - name: "image-pull-secret"
+
+service:
+ type: ClusterIP
+ port: 9100
+ targetPort: 9100
+ nodePort:
+ portName: metrics
+ listenOnAllInterfaces: true
+ annotations:
+ prometheus.io/scrape: "true"
+
+# for deployments that have node_exporter deployed outside of the cluster, list
+# their addresses here
+endpoints: []
+
+# Expose the service to the host network
+hostNetwork: true
+
+# Share the host process ID namespace
+hostPID: true
+
+# Mount the node's root file system (/) at /host/root in the container
+hostRootFsMount:
+ enabled: true
+ # Defines how new mounts in existing mounts on the node or in the container
+ # are propagated to the container or node, respectively. Possible values are
+ # None, HostToContainer, and Bidirectional. If this field is omitted, then
+ # None is used. More information on:
+ # https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation
+ mountPropagation: HostToContainer
+
+## Assign a group of affinity scheduling rules
+##
+affinity: {}
+# nodeAffinity:
+# requiredDuringSchedulingIgnoredDuringExecution:
+# nodeSelectorTerms:
+# - matchFields:
+# - key: metadata.name
+# operator: In
+# values:
+# - target-host-name
+
+# Annotations to be added to node exporter pods
+podAnnotations:
+ # Fix for very slow GKE cluster upgrades
+ cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
+
+# Extra labels to be added to node exporter pods
+podLabels: {}
+
+# Annotations to be added to node exporter daemonset
+daemonsetAnnotations: {}
+
+## set to true to add the release label so scraping of the servicemonitor with kube-prometheus-stack works out of the box
+releaseLabel: false
+
+# Custom DNS configuration to be added to prometheus-node-exporter pods
+dnsConfig: {}
+# nameservers:
+# - 1.2.3.4
+# searches:
+# - ns1.svc.cluster-domain.example
+# - my.dns.search.suffix
+# options:
+# - name: ndots
+# value: "2"
+# - name: edns0
+
+## Assign a nodeSelector if operating a hybrid cluster
+##
+nodeSelector: {}
+# beta.kubernetes.io/arch: amd64
+# beta.kubernetes.io/os: linux
+
+tolerations:
+ - effect: NoSchedule
+ operator: Exists
+
+## Assign a PriorityClassName to pods if set
+# priorityClassName: ""
+
+## Additional container arguments
+##
+extraArgs: []
+# - --collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v)d[a-z]|nvme\\d+n\\d+p)\\d+$
+# - --collector.textfile.directory=/run/prometheus
+
+## Additional mounts from the host to node-exporter container
+##
+extraHostVolumeMounts: []
+# - name: <mountName>
+# hostPath: <hostPath>
+# mountPath: <mountPath>
+# readOnly: true|false
+# mountPropagation: None|HostToContainer|Bidirectional
+
+## Additional configmaps to be mounted.
+##
+configmaps: []
+# - name: <configMapName>
+# mountPath: <mountPath>
+secrets: []
+# - name: <secretName>
+# mountPath: <mountPatch>
+## Override the deployment namespace
+##
+namespaceOverride: ""
+
+## Additional containers for export metrics to text file
+##
+sidecars: []
+## - name: nvidia-dcgm-exporter
+## image: nvidia/dcgm-exporter:1.4.3
+
+## Volume for sidecar containers
+##
+sidecarVolumeMount: []
+## - name: collector-textfiles
+## mountPath: /run/prometheus
+## readOnly: false
+
+## Additional mounts from the host to sidecar containers
+##
+sidecarHostVolumeMounts: []
+# - name: <mountName>
+# hostPath: <hostPath>
+# mountPath: <mountPath>
+# readOnly: true|false
+# mountPropagation: None|HostToContainer|Bidirectional
+
+## Additional InitContainers to initialize the pod
+##
+extraInitContainers: []
+
+## Liveness probe
+##
+livenessProbe:
+ failureThreshold: 3
+ httpGet:
+ httpHeaders: []
+ scheme: http
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 1
+
+## Readiness probe
+##
+readinessProbe:
+ failureThreshold: 3
+ httpGet:
+ httpHeaders: []
+ scheme: http
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 1
+
+# Enable vertical pod autoscaler support for prometheus-node-exporter
+verticalPodAutoscaler:
+ enabled: false
+ # List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
+ controlledResources: []
+
+ # Define the max allowed resources for the pod
+ maxAllowed: {}
+ # cpu: 200m
+ # memory: 100Mi
+ # Define the min allowed resources for the pod
+ minAllowed: {}
+ # cpu: 200m
+ # memory: 100Mi
+
+ # updatePolicy:
+ # Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
+ # are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
+ # updateMode: Auto
+
+## Define serviceAccount names for components. Defaults to component's fully qualified name.
+##
+serviceAccount:
+ create: true
+ name:
+ annotations: {}
+prometheus:
+ monitor:
+ enabled: false
+ additionalLabels: {}
+ namespace: ""
+
+ jobLabel: ""
+
+ scheme: http
+ basicAuth: {}
+ bearerTokenFile:
+ tlsConfig: {}
+
+ ## proxyUrl: URL of a proxy that should be used for scraping.
+ ##
+ proxyUrl: ""
+
+ ## Override serviceMonitor selector
+ ##
+ selectorOverride: {}
+
+ relabelings: []
+ metricRelabelings: []
+ interval: ""
+ scrapeTimeout: 10s
+ ## prometheus.monitor.apiVersion ApiVersion for the serviceMonitor Resource(defaults to "monitoring.coreos.com/v1")
+ apiVersion: ""
+
+ ## SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
+ ##
+ sampleLimit: 0
+
+ ## TargetLimit defines a limit on the number of scraped targets that will be accepted.
+ ##
+ targetLimit: 0
+
+ ## Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
+ ##
+ labelLimit: 0
+
+ ## Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
+ ##
+ labelNameLengthLimit: 0
+
+ ## Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
+ ##
+ labelValueLengthLimit: 0
+## applications
+nodeExporter:
+ ## If false, node-exporter will not be installed
+ ##
+ enabled: true
+
+ ## If true, node-exporter pods share the host network namespace
+ ##
+ hostNetwork: true
+
+ ## If true, node-exporter pods share the host PID namespace
+ ##
+ hostPID: true
+
+ ## If true, node-exporter pods mounts host / at /host/root
+ ##
+ hostRootfs: true
+
+ ## node-exporter container name
+ ##
+ name: node-exporter
+
+ ## node-exporter container image
+ ##
+ image:
+ repository: quay.io/prometheus/node-exporter
+ tag: v1.3.0
+ pullPolicy: IfNotPresent
+
+ ## Specify if a Pod Security Policy for node-exporter must be created
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
+ ##
+ podSecurityPolicy:
+ annotations: {}
+ ## Specify pod annotations
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
+ ##
+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
+ # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
+ # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
+
+ ## node-exporter priorityClassName
+ ##
+ priorityClassName: ""
+
+ ## Custom Update Strategy
+ ##
+ updateStrategy:
+ type: RollingUpdate
+
+ ## Additional node-exporter container arguments
+ ##
+ extraArgs: {}
+
+ ## Additional InitContainers to initialize the pod
+ ##
+ extraInitContainers: []
+
+ ## Additional node-exporter hostPath mounts
+ ##
+ extraHostPathMounts: []
+ # - name: textfile-dir
+ # mountPath: /srv/txt_collector
+ # hostPath: /var/lib/node-exporter
+ # readOnly: true
+ # mountPropagation: HostToContainer
+
+ extraConfigmapMounts: []
+ # - name: certs-configmap
+ # mountPath: /prometheus
+ # configMap: certs-configmap
+ # readOnly: true
+
+ ## Node tolerations for node-exporter scheduling to nodes with taints
+ ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+ ##
+ tolerations: []
+ # - key: "key"
+ # operator: "Equal|Exists"
+ # value: "value"
+ # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
+
+ ## Node labels for node-exporter pod assignment
+ ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+
+ ## Annotations to be added to node-exporter pods
+ ##
+ podAnnotations: {}
+
+ ## Labels to be added to node-exporter pods
+ ##
+ pod:
+ labels: {}
+
+ ## PodDisruptionBudget settings
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
+ ##
+ podDisruptionBudget:
+ enabled: false
+ maxUnavailable: 1
+
+ ## node-exporter resource limits & requests
+ ## Ref: https://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ # limits:
+ # cpu: 200m
+ # memory: 50Mi
+ # requests:
+ # cpu: 100m
+ # memory: 30Mi
+
+ # Custom DNS configuration to be added to node-exporter pods
+ dnsConfig: {}
+ # nameservers:
+ # - 1.2.3.4
+ # searches:
+ # - ns1.svc.cluster-domain.example
+ # - my.dns.search.suffix
+ # options:
+ # - name: ndots
+ # value: "2"
+ # - name: edns0
+
+ ## Security context to be added to node-exporter pods
+ ##
+ securityContext:
+ fsGroup: 65534
+ runAsGroup: 65534
+ runAsNonRoot: true
+ runAsUser: 65534
+
+ service:
+ annotations:
+ prometheus.io/scrape: "true"
+ labels: {}
+
+ # Exposed as a headless service:
+ # https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
+ clusterIP: None
+
+ ## List of IP addresses at which the node-exporter service is available
+ ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
+ ##
+ externalIPs: []
+
+ hostPort: 9100
+ loadBalancerIP: ""
+ loadBalancerSourceRanges: []
+ servicePort: 9100
+ type: ClusterIP
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/.helmignore b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/.helmignore
new file mode 100644
index 00000000..aaa0d115
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.vscode
+.project
+.idea/
+*.tmproj
+OWNERS
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/Chart.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/Chart.yaml
new file mode 100644
index 00000000..4366c6a4
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/Chart.yaml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v2
+appVersion: v1.5.1
+description: A Helm chart for prometheus pushgateway
+home: https://github.com/prometheus/pushgateway
+keywords:
+ - pushgateway
+ - prometheus
+maintainers:
+ - email: dev@dubbo.apache.org
+ name: dubbo
+name: prometheus-pushgateway
+sources:
+ - https://github.com/prometheus/pushgateway
+version: 2.0.4
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/_charts.tpl b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/_charts.tpl
new file mode 100644
index 00000000..33999df2
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/_charts.tpl
@@ -0,0 +1,167 @@
+{{/*
+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 "prometheus-pushgateway.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 }}
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "prometheus-pushgateway.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "prometheus-pushgateway.chart" -}}
+{{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create default labels
+*/}}
+{{- define "prometheus-pushgateway.defaultLabels" -}}
+helm.sh/chart: {{ include "prometheus-pushgateway.chart" . }}
+{{ include "prometheus-pushgateway.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- with .Values.podLabels }}
+{{ toYaml . }}
+{{- end }}
+{{- end }}
+
+{{- define "prometheus.pushgateway.matchLabels" -}}
+component: {{ .Values.pushgateway.name | quote }}
+{{ include "prometheus.common.matchLabels" . }}
+{{- end -}}
+
+{{/*
+Selector labels
+*/}}
+{{- define "prometheus-pushgateway.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "prometheus-pushgateway.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "prometheus-pushgateway.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "prometheus-pushgateway.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
+
+{{/*
+Returns pod spec
+*/}}
+{{- define "prometheus-pushgateway.podSpec" -}}
+serviceAccountName: {{ include "prometheus-pushgateway.serviceAccountName" . }}
+{{- with .Values.priorityClassName }}
+priorityClassName: {{ . | quote }}
+{{- end }}
+{{- with .Values.imagePullSecrets }}
+imagePullSecrets:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+{{- with .Values.extraInitContainers }}
+initContainers:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+containers:
+ {{- with .Values.extraContainers }}
+ {{- toYaml . | nindent 2 }}
+ {{- end }}
+ - name: pushgateway
+ image: "{{ .Values.pushgateway.image.repository }}:{{ .Values.pushgateway.image.tag | default .Chart.AppVersion }}"
+ imagePullPolicy: {{ .Values.pushgateway.image.pullPolicy }}
+ {{- with .Values.extraVars }}
+ env:
+ {{- toYaml . | nindent 6 }}
+ {{- end }}
+ {{- with .Values.extraArgs }}
+ args:
+ {{- toYaml . | nindent 6 }}
+ {{- end }}
+ ports:
+ - name: metrics
+ containerPort: 9091
+ protocol: TCP
+ {{- if .Values.liveness.enabled }}
+ livenessProbe:
+ {{- toYaml .Values.liveness.probe | nindent 6 }}
+ {{- end }}
+ {{- if .Values.readiness.enabled }}
+ readinessProbe:
+ {{- toYaml .Values.readiness.probe | nindent 6 }}
+ {{- end }}
+ {{- with .Values.resources }}
+ resources:
+ {{- toYaml . | nindent 6 }}
+ {{- end }}
+ {{- with .Values.containerSecurityContext }}
+ securityContext:
+ {{- toYaml . | nindent 6 }}
+ {{- end }}
+ volumeMounts:
+ - name: storage-volume
+ mountPath: "{{ .Values.pushgateway.persistentVolume.mountPath }}"
+ subPath: "{{ .Values.pushgateway.persistentVolume.subPath }}"
+ {{- with .Values.pushgateway.extraVolumeMounts }}
+ {{- toYaml . | nindent 6 }}
+ {{- end }}
+{{- with .Values.nodeSelector }}
+nodeSelector:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+{{- with .Values.tolerations }}
+tolerations:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+{{- with .Values.affinity }}
+affinity:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+{{- with .Values.topologySpreadConstraints }}
+topologySpreadConstraints:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+{{- with .Values.securityContext }}
+securityContext:
+ {{- toYaml . | nindent 2 }}
+{{- end }}
+volumes:
+ {{- $storageVolumeAsPVCTemplate := and .Values.runAsStatefulSet .Values.pushgateway.persistentVolume.enabled -}}
+ {{- if not $storageVolumeAsPVCTemplate }}
+ - name: storage-volume
+ {{- if .Values.pushgateway.persistentVolume.enabled }}
+ persistentVolumeClaim:
+ claimName: {{ if .Values.pushgateway.persistentVolume.existingClaim }}{{ .Values.pushgateway.persistentVolume.existingClaim }}{{- else }}{{ include "prometheus-pushgateway.fullname" . }}{{- end }}
+ {{- else }}
+ emptyDir: {}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.pushgateway.extraVolumes }}
+ {{- toYaml .Values.pushgateway.extraVolumes | nindent 2 }}
+ {{- else if $storageVolumeAsPVCTemplate }}
+ []
+ {{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/deployment.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/deployment.yaml
new file mode 100644
index 00000000..cbd0a7ad
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/deployment.yaml
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if not .Values.pushgateway.runAsStatefulSet }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ name: {{ include "prometheus-pushgateway.fullname" . }}
+spec:
+ replicas: {{ .Values.pushgateway.replicaCount }}
+ {{- with .Values.pushgateway.strategy }}
+ strategy:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ selector:
+ matchLabels:
+ {{- include "prometheus-pushgateway.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ {{- with .Values.pushgateway.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 8 }}
+ {{- with .Values.pushgateway.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ {{- include "prometheus-pushgateway.podSpec" . | nindent 6 }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/ingress.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/ingress.yaml
new file mode 100644
index 00000000..bacb57dc
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/ingress.yaml
@@ -0,0 +1,64 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.pushgateway.ingress.enabled }}
+{{- $serviceName := include "prometheus-pushgateway.fullname" . }}
+{{- $servicePort := .Values.pushgateway.service.port }}
+{{- $ingressPath := .Values.pushgateway.ingress.path }}
+{{- $ingressClassName := .Values.pushgateway.ingress.className }}
+{{- $ingressPathType := .Values.pushgateway.ingress.pathType }}
+{{- $extraPaths := .Values.pushgateway.ingress.extraPaths }}
+apiVersion: {{ include "prometheus-pushgateway.ingress.apiVersion" . }}
+kind: Ingress
+metadata:
+ {{- with .Values.pushgateway.ingress.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ name: {{ include "prometheus-pushgateway.fullname" . }}
+spec:
+ {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
+ ingressClassName: {{ $ingressClassName }}
+ {{- end }}
+ rules:
+ {{- range $host := .Values.pushgateway.ingress.hosts }}
+ - host: {{ $host }}
+ http:
+ paths:
+ {{- with $extraPaths }}
+ {{- toYaml . | nindent 10 }}
+ {{- end }}
+ - path: {{ $ingressPath }}
+ {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
+ pathType: {{ $ingressPathType }}
+ {{- end }}
+ backend:
+ {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
+ service:
+ name: {{ $serviceName }}
+ port:
+ number: {{ $servicePort }}
+ {{- else }}
+ serviceName: {{ $serviceName }}
+ servicePort: {{ $servicePort }}
+ {{- end }}
+ {{- end -}}
+ {{- with .Values.pushgateway.ingress.tls }}
+ tls:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/networkpolicy.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/networkpolicy.yaml
new file mode 100644
index 00000000..557ea658
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/networkpolicy.yaml
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.pushgateway.networkPolicy }}
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ {{- if .Values.pushgateway.networkPolicy.customSelectors }}
+ name: ingress-allow-customselector-{{ template "prometheus-pushgateway.name" . }}
+ {{- else if .Values.pushgateway.networkPolicy.allowAll }}
+ name: ingress-allow-all-{{ template "prometheus-pushgateway.name" . }}
+ {{- else -}}
+ {{- fail "One of `allowAll` or `customSelectors` must be specified." }}
+ {{- end }}
+spec:
+ podSelector:
+ matchLabels:
+ {{- include "prometheus-pushgateway.selectorLabels" . | nindent 6 }}
+ ingress:
+ - ports:
+ - port: {{ .Values.pushgateway.service.targetPort }}
+ {{- with .Values.pushgateway.networkPolicy.customSelectors }}
+ from:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/pdb.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/pdb.yaml
new file mode 100644
index 00000000..00ed4cde
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/pdb.yaml
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.podDisruptionBudget }}
+apiVersion: {{ include "prometheus-pushgateway.pdb.apiVersion" . }}
+kind: PodDisruptionBudget
+metadata:
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ name: {{ include "prometheus-pushgateway.fullname" . }}
+spec:
+ selector:
+ matchLabels:
+ {{- include "prometheus-pushgateway.selectorLabels" . | nindent 6 }}
+ {{- toYaml .Values.podDisruptionBudget | nindent 2 }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/pushgateway-pvc.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/pushgateway-pvc.yaml
new file mode 100644
index 00000000..92f0e3e2
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/pushgateway-pvc.yaml
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and (not .Values.runAsStatefulSet) .Values.pushgateway.persistentVolume.enabled (not .Values.persistentVolume.existingClaim) }}
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ {{- with .Values.pushgateway.persistentVolume.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ {{- with .Values.pushgateway.persistentVolumeLabels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ name: {{ include "prometheus-pushgateway.fullname" . }}
+spec:
+ accessModes:
+ {{- toYaml .Values.pushgateway.persistentVolume.accessModes | nindent 4 }}
+ {{- if .Values.pushgateway.persistentVolume.storageClass }}
+ {{- if (eq "-" .Values.pushgateway.persistentVolume.storageClass) }}
+ storageClassName: ""
+ {{- else }}
+ storageClassName: "{{ .Values.pushgateway.persistentVolume.storageClass }}"
+ {{- end }}
+ {{- end }}
+ resources:
+ requests:
+ storage: "{{ .Values.pushgateway.persistentVolume.size }}"
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/service.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/service.yaml
new file mode 100644
index 00000000..a676c67a
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/service.yaml
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- $stsNoHeadlessSvcTypes := list "LoadBalancer" "NodePort" -}}
+apiVersion: v1
+kind: Service
+metadata:
+ {{- with .Values.pushgateway.serviceAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ {{- with .Values.pushgateway.serviceLabels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ name: {{ include "prometheus-pushgateway.fullname" . }}
+spec:
+ {{- if .Values.pushgateway.service.clusterIP }}
+ clusterIP: {{ .Values.pushgateway.service.clusterIP }}
+ {{ else if and .Values.pushgateway.runAsStatefulSet (not (has .Values.pushgateway.service.type $stsNoHeadlessSvcTypes)) }}
+ clusterIP: None # Headless service
+ {{- end }}
+ type: {{ .Values.pushgateway.service.type }}
+ {{- with .Values.pushgateway.service.loadBalancerIP }}
+ loadBalancerIP: {{ . }}
+ {{- end }}
+ {{- if .Values.pushgateway.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges:
+ {{- range $cidr := .Values.pushgateway.service.loadBalancerSourceRanges }}
+ - {{ $cidr }}
+ {{- end }}
+ {{- end }}
+ ports:
+ - port: {{ .Values.pushgateway.service.port }}
+ targetPort: {{ .Values.pushgateway.service.targetPort }}
+ {{- if and (eq .Values.pushgateway.service.type "NodePort") .Values.pushgateway.service.nodePort }}
+ nodePort: {{ .Values.pushgateway.service.nodePort }}
+ {{- end }}
+ protocol: TCP
+ name: http
+ selector:
+ {{- include "prometheus-pushgateway.selectorLabels" . | nindent 4 }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/serviceaccount.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/serviceaccount.yaml
new file mode 100644
index 00000000..834a19dd
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/serviceaccount.yaml
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.serviceAccount.create }}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ {{- with .Values.serviceAccount.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ {{- with .Values.serviceAccountLabels }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ name: {{ include "prometheus-pushgateway.serviceAccountName" . }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/servicemonitor.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/servicemonitor.yaml
new file mode 100644
index 00000000..0a275b00
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/servicemonitor.yaml
@@ -0,0 +1,64 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.serviceMonitor.enabled }}
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ {{- if .Values.serviceMonitor.additionalLabels }}
+ {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }}
+ {{- end }}
+ name: {{ include "prometheus-pushgateway.fullname" . }}
+ {{- with .Values.serviceMonitor.namespace }}
+ namespace: {{ . }}
+ {{- end }}
+spec:
+ endpoints:
+ - port: http
+ {{- with .Values.serviceMonitor.interval }}
+ interval: {{ . }}
+ {{- end }}
+ {{- with .Values.serviceMonitor.scheme }}
+ scheme: {{ . }}
+ {{- end }}
+ {{- with .Values.serviceMonitor.bearerTokenFile }}
+ bearerTokenFile: {{ . }}
+ {{- end }}
+ {{- with .Values.serviceMonitor.tlsConfig }}
+ tlsConfig:
+ {{- toYaml .| nindent 6 }}
+ {{- end }}
+ {{- with .Values.serviceMonitor.scrapeTimeout }}
+ scrapeTimeout: {{ . }}
+ {{- end }}
+ path: /metrics
+ honorLabels: {{ .Values.serviceMonitor.honorLabels }}
+ {{- with .Values.serviceMonitor.metricRelabelings }}
+ metricRelabelings:
+ {{- tpl (toYaml . | nindent 6) . }}
+ {{- end }}
+ {{- with .Values.serviceMonitor.relabelings }}
+ relabelings:
+ {{- toYaml . | nindent 6 }}
+ {{- end }}
+ namespaceSelector:
+ matchNames:
+ - {{ .Release.Namespace }}
+ selector:
+ matchLabels:
+ {{- include "prometheus-pushgateway.selectorLabels" . | nindent 6 }}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/statefulset.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/statefulset.yaml
new file mode 100644
index 00000000..42a9d689
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/templates/statefulset.yaml
@@ -0,0 +1,66 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.pushgateway.runAsStatefulSet }}
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
+ name: {{ include "prometheus-pushgateway.fullname" . }}
+spec:
+ replicas: {{ .Values.pushgateway.replicaCount }}
+ serviceName: {{ include "prometheus-pushgateway.fullname" . }}
+ selector:
+ matchLabels:
+ {{- include "prometheus-pushgateway.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ {{- with .Values.pushgateway.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 8 }}
+ {{- with .Values.pushgateway.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ {{- include "prometheus-pushgateway.podSpec" . | nindent 6 }}
+ {{- if .Values.pushgateway.persistentVolume.enabled }}
+ volumeClaimTemplates:
+ - metadata:
+ {{- with .Values.pushgateway.persistentVolume.annotations }}
+ annotations:
+ {{- toYaml . | nindent 10 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus-pushgateway.defaultLabels" . | nindent 10 }}
+ name: storage-volume
+ spec:
+ accessModes:
+ {{ toYaml .Values.pushgateway.persistentVolume.accessModes }}
+ {{- if .Values.pushgateway.persistentVolume.storageClass }}
+ {{- if (eq "-" .Values.pushgateway.persistentVolume.storageClass) }}
+ storageClassName: ""
+ {{- else }}
+ storageClassName: "{{ .Values.pushgateway.persistentVolume.storageClass }}"
+ {{- end }}
+ {{- end }}
+ resources:
+ requests:
+ storage: "{{ .Values.pushgateway.persistentVolume.size }}"
+ {{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/values.yaml b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/values.yaml
new file mode 100644
index 00000000..88fe5e72
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/charts/pushgateway/values.yaml
@@ -0,0 +1,336 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rbac:
+ create: true
+
+podSecurityPolicy:
+ enabled: false
+
+imagePullSecrets:
+# - name: "image-pull-secret"
+
+# Enable this if you're using https://github.com/coreos/prometheus-operator
+serviceMonitor:
+ enabled: false
+ namespace: monitoring
+
+ # Fallback to the prometheus default unless specified
+ # interval: 10s
+
+ ## scheme: HTTP scheme to use for scraping. Can be used with `tlsConfig` for example if using istio mTLS.
+ # scheme: ""
+
+ ## tlsConfig: TLS configuration to use when scraping the endpoint. For example if using istio mTLS.
+ ## Of type: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#tlsconfig
+ # tlsConfig: {}
+
+ # bearerTokenFile:
+ # Fallback to the prometheus default unless specified
+ # scrapeTimeout: 30s
+
+ ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
+ ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
+ additionalLabels: {}
+
+ # Retain the job and instance labels of the metrics pushed to the Pushgateway
+ # [Scraping Pushgateway](https://github.com/prometheus/pushgateway#configure-the-pushgateway-as-a-target-to-scrape)
+ honorLabels: true
+
+ ## Metric relabel configs to apply to samples before ingestion.
+ ## [Metric Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs)
+ metricRelabelings: []
+ # - action: keep
+ # regex: 'kube_(daemonset|deployment|pod|namespace|node|statefulset).+'
+ # sourceLabels: [__name__]
+
+ ## Relabel configs to apply to samples before ingestion.
+ ## [Relabeling](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config)
+ relabelings: []
+ # - sourceLabels: [__meta_kubernetes_pod_node_name]
+ # separator: ;
+ # regex: ^(.*)$
+ # targetLabel: nodename
+ # replacement: $1
+ # action: replace
+
+liveness:
+ enabled: true
+ probe:
+ httpGet:
+ path: /-/ready
+ port: 9091
+ initialDelaySeconds: 10
+ timeoutSeconds: 10
+
+readiness:
+ enabled: true
+ probe:
+ httpGet:
+ path: /-/ready
+ port: 9091
+ initialDelaySeconds: 10
+ timeoutSeconds: 10
+
+## Define serviceAccount names for components. Defaults to component's fully qualified name.
+##
+serviceAccount:
+ create: true
+ name:
+ annotations: {}
+
+## applications
+pushgateway:
+ ## If false, pushgateway will not be installed
+ ##
+ enabled: true
+
+ ## Use an alternate scheduler, e.g. "stork".
+ ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
+ ##
+ # schedulerName:
+
+ ## pushgateway container name
+ ##
+ name: pushgateway
+
+ ## pushgateway container image
+ ##
+ image:
+ repository: prom/pushgateway
+ tag: v1.4.2
+ pullPolicy: IfNotPresent
+
+ ## pushgateway priorityClassName
+ ##
+ priorityClassName: ""
+
+ ## Additional pushgateway container arguments
+ ##
+ ## for example: persistence.file: /data/pushgateway.data
+ extraArgs: {}
+
+ ## Additional InitContainers to initialize the pod
+ ##
+ extraInitContainers: []
+
+ ingress:
+ ## If true, pushgateway Ingress will be created
+ ##
+ enabled: false
+
+ # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
+ # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
+ # ingressClassName: nginx
+
+ ## pushgateway Ingress annotations
+ ##
+ annotations: {}
+ # kubernetes.io/ingress.class: nginx
+ # kubernetes.io/tls-acme: 'true'
+
+ ## pushgateway Ingress hostnames with optional path
+ ## Must be provided if Ingress is enabled
+ ##
+ hosts: []
+ # - pushgateway.domain.com
+ # - domain.com/pushgateway
+
+ path: /
+
+ # pathType is only for k8s >= 1.18
+ pathType: Prefix
+
+ ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services.
+ extraPaths: []
+ # - path: /*
+ # backend:
+ # serviceName: ssl-redirect
+ # servicePort: use-annotation
+
+ ## pushgateway Ingress TLS configuration
+ ## Secrets must be manually created in the namespace
+ ##
+ tls: []
+ # - secretName: prometheus-alerts-tls
+ # hosts:
+ # - pushgateway.domain.com
+
+ ## Node tolerations for pushgateway scheduling to nodes with taints
+ ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+ ##
+ tolerations: []
+ # - key: "key"
+ # operator: "Equal|Exists"
+ # value: "value"
+ # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
+
+ ## Node labels for pushgateway pod assignment
+ ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+
+ ## Annotations to be added to pushgateway pods
+ ##
+ podAnnotations: {}
+
+ ## Labels to be added to pushgateway pods
+ ##
+ podLabels: {}
+
+ ## Specify if a Pod Security Policy for node-exporter must be created
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
+ ##
+ podSecurityPolicy:
+ annotations: {}
+ ## Specify pod annotations
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
+ ##
+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
+ # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
+ # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
+
+ replicaCount: 1
+
+ ## Annotations to be added to deployment
+ ##
+ deploymentAnnotations: {}
+
+ ## PodDisruptionBudget settings
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
+ ##
+ podDisruptionBudget:
+ enabled: false
+ maxUnavailable: 1
+
+ ## pushgateway resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ # limits:
+ # cpu: 10m
+ # memory: 32Mi
+ # requests:
+ # cpu: 10m
+ # memory: 32Mi
+
+ ## Vertical Pod Autoscaler config
+ ## Ref: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler
+ verticalAutoscaler:
+ ## If true a VPA object will be created for the controller
+ enabled: false
+ # updateMode: "Auto"
+ # containerPolicies:
+ # - containerName: 'prometheus-pushgateway'
+
+ # Custom DNS configuration to be added to push-gateway pods
+ dnsConfig: {}
+ # nameservers:
+ # - 1.2.3.4
+ # searches:
+ # - ns1.svc.cluster-domain.example
+ # - my.dns.search.suffix
+ # options:
+ # - name: ndots
+ # value: "2"
+ # - name: edns0
+
+ ## Security context to be added to push-gateway pods
+ ##
+ securityContext:
+ runAsUser: 65534
+ runAsNonRoot: true
+
+ service:
+ annotations:
+ prometheus.io/probe: pushgateway
+ labels: {}
+ clusterIP: ""
+
+ ## List of IP addresses at which the pushgateway service is available
+ ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
+ ##
+ externalIPs: []
+
+ loadBalancerIP: ""
+ loadBalancerSourceRanges: []
+ servicePort: 9091
+ type: ClusterIP
+
+ ## pushgateway Deployment Strategy type
+ # strategy:
+ # type: Recreate
+
+ persistentVolume:
+ ## If true, pushgateway will create/use a Persistent Volume Claim
+ ##
+ enabled: false
+
+ ## pushgateway data Persistent Volume access modes
+ ## Must match those of existing PV or dynamic provisioner
+ ## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
+ ##
+ accessModes:
+ - ReadWriteOnce
+
+ ## pushgateway data Persistent Volume Claim annotations
+ ##
+ annotations: {}
+
+ ## pushgateway data Persistent Volume existing claim name
+ ## Requires pushgateway.persistentVolume.enabled: true
+ ## If defined, PVC must be created manually before volume will be bound
+ existingClaim: ""
+
+ ## pushgateway data Persistent Volume mount root path
+ ##
+ mountPath: /data
+
+ ## pushgateway data Persistent Volume size
+ ##
+ size: 2Gi
+
+ ## pushgateway data Persistent Volume Storage Class
+ ## If defined, storageClassName: <storageClass>
+ ## If set to "-", storageClassName: "", which disables dynamic provisioning
+ ## If undefined (the default) or set to null, no storageClassName spec is
+ ## set, choosing the default provisioner. (gp2 on AWS, standard on
+ ## GKE, AWS & OpenStack)
+ ##
+ # storageClass: "-"
+
+ ## pushgateway data Persistent Volume Binding Mode
+ ## If defined, volumeBindingMode: <volumeBindingMode>
+ ## If undefined (the default) or set to null, no volumeBindingMode spec is
+ ## set, choosing the default mode.
+ ##
+ # volumeBindingMode: ""
+
+ ## Subdirectory of pushgateway data Persistent Volume to mount
+ ## Useful if the volume's root directory is not empty
+ ##
+ subPath: ""
+
+ networkPolicy: {}
+ # allowAll: true
+ # customSelectors:
+ # - namespaceSelector:
+ # matchLabels:
+ # type: admin
+ # - podSelector:
+ # matchLabels:
+ # app: myapp
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/_charts.tpl b/deploy/charts/admin-stack/charts/prometheus/templates/_charts.tpl
new file mode 100644
index 00000000..87f041a5
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/_charts.tpl
@@ -0,0 +1,94 @@
+{{/*
+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).
+*/}}
+{{- define "prometheus.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 -}}
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "prometheus.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "prometheus.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+{{- define "prometheus.server.labels" -}}
+{{ include "prometheus.server.matchLabels" . }}
+{{ include "prometheus.common.metaLabels" . }}
+{{- end -}}
+
+{{- define "prometheus.server.matchLabels" -}}
+component: {{ .Values.server.name | quote }}
+{{ include "prometheus.common.matchLabels" . }}
+{{- end -}}
+
+{{/*
+Create unified labels for prometheus components
+*/}}
+{{- define "prometheus.common.matchLabels" -}}
+app: {{ template "prometheus.name" . }}
+release: {{ .Release.Name }}
+{{- end -}}
+
+{{- define "prometheus.common.metaLabels" -}}
+chart: {{ template "prometheus.chart" . }}
+heritage: {{ .Release.Service }}
+{{- end -}}
+
+{{/*
+Define the prometheus.namespace template if set with forceNamespace or .Release.Namespace is set
+*/}}
+{{- define "prometheus.namespace" -}}
+{{- if .Values.forceNamespace -}}
+{{ printf "namespace: %s" .Values.forceNamespace }}
+{{- else -}}
+{{ printf "namespace: %s" .Release.Namespace }}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create a fully qualified Prometheus server name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+*/}}
+{{- define "prometheus.server.fullname" -}}
+{{- if .Values.server.fullnameOverride -}}
+{{- .Values.server.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- if contains $name .Release.Name -}}
+{{- printf "%s-%s" .Release.Name .Values.server.name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s-%s" .Release.Name $name .Values.server.name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create the name of the service account to use for the server component
+*/}}
+{{- define "prometheus.serviceAccountName.server" -}}
+{{- if .Values.serviceAccounts.server.create -}}
+ {{ default (include "prometheus.server.fullname" .) .Values.serviceAccounts.server.name }}
+{{- else -}}
+ {{ default "default" .Values.serviceAccounts.server.name }}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/clusterrole.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/clusterrole.yaml
new file mode 100644
index 00000000..b1c9bd24
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/clusterrole.yaml
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.server.enabled .Values.rbac.create (empty .Values.server.useExistingClusterRoleName) -}}
+apiVersion: {{ template "rbac.apiVersion" . }}
+kind: ClusterRole
+metadata:
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ name: {{ template "prometheus.server.fullname" . }}
+rules:
+{{- if .Values.podSecurityPolicy.enabled }}
+ - apiGroups:
+ - extensions
+ resources:
+ - podsecuritypolicies
+ verbs:
+ - use
+ resourceNames:
+ - {{ template "prometheus.server.fullname" . }}
+{{- end }}
+ - apiGroups:
+ - ""
+ resources:
+ - nodes
+ - nodes/proxy
+ - nodes/metrics
+ - services
+ - endpoints
+ - pods
+ - ingresses
+ - configmaps
+ verbs:
+ - get
+ - list
+ - watch
+ - apiGroups:
+ - "extensions"
+ - "networking.k8s.io"
+ resources:
+ - ingresses/status
+ - ingresses
+ verbs:
+ - get
+ - list
+ - watch
+ - nonResourceURLs:
+ - "/metrics"
+ verbs:
+ - get
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/clusterrolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/clusterrolebinding.yaml
new file mode 100644
index 00000000..ce048621
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/clusterrolebinding.yaml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.server.enabled .Values.rbac.create (empty .Values.server.namespaces) (empty .Values.server.useExistingClusterRoleName) -}}
+apiVersion: {{ template "rbac.apiVersion" . }}
+kind: ClusterRoleBinding
+metadata:
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ name: {{ template "prometheus.server.fullname" . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ template "prometheus.serviceAccountName.server" . }}
+{{ include "prometheus.namespace" . | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: {{ template "prometheus.server.fullname" . }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/cm.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/cm.yaml
new file mode 100644
index 00000000..0e7e93b9
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/cm.yaml
@@ -0,0 +1,100 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if (empty .Values.server.configMapOverrideName) -}}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+data:
+{{- $root := . -}}
+{{- range $key, $value := .Values.ruleFiles }}
+ {{ $key }}: {{- toYaml $value | indent 2 }}
+{{- end }}
+{{- range $key, $value := .Values.serverFiles }}
+ {{ $key }}: |
+{{- if eq $key "prometheus.yml" }}
+ global:
+{{ $root.Values.server.global | toYaml | trimSuffix "\n" | indent 6 }}
+{{- if $root.Values.server.remoteWrite }}
+ remote_write:
+{{ $root.Values.server.remoteWrite | toYaml | indent 4 }}
+{{- end }}
+{{- if $root.Values.server.remoteRead }}
+ remote_read:
+{{ $root.Values.server.remoteRead | toYaml | indent 4 }}
+{{- end }}
+{{- end }}
+{{- if eq $key "alerts" }}
+{{- if and (not (empty $value)) (empty $value.groups) }}
+ groups:
+{{- range $ruleKey, $ruleValue := $value }}
+ - name: {{ $ruleKey -}}.rules
+ rules:
+{{ $ruleValue | toYaml | trimSuffix "\n" | indent 6 }}
+{{- end }}
+{{- else }}
+{{ toYaml $value | indent 4 }}
+{{- end }}
+{{- else }}
+{{ toYaml $value | default "{}" | indent 4 }}
+{{- end }}
+{{- if eq $key "prometheus.yml" -}}
+{{- if $root.Values.extraScrapeConfigs }}
+{{ tpl $root.Values.extraScrapeConfigs $root | indent 4 }}
+{{- end -}}
+{{- if or ($root.Values.alertmanager.enabled) ($root.Values.server.alertmanagers) }}
+ alerting:
+{{- if $root.Values.alertRelabelConfigs }}
+{{ $root.Values.alertRelabelConfigs | toYaml | trimSuffix "\n" | indent 6 }}
+{{- end }}
+ alertmanagers:
+{{- if $root.Values.server.alertmanagers }}
+{{ toYaml $root.Values.server.alertmanagers | indent 8 }}
+{{- else }}
+ - kubernetes_sd_configs:
+ - role: pod
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+ {{- if $root.Values.alertmanager.prefixURL }}
+ path_prefix: {{ $root.Values.alertmanager.prefixURL }}
+ {{- end }}
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_namespace]
+ regex: {{ $root.Release.Namespace }}
+ action: keep
+ - source_labels: [__meta_kubernetes_pod_label_app]
+ regex: {{ template "prometheus.name" $root }}
+ action: keep
+ - source_labels: [__meta_kubernetes_pod_label_component]
+ regex: alertmanager
+ action: keep
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_probe]
+ regex: {{ index $root.Values.alertmanager.podAnnotations "prometheus.io/probe" | default ".*" }}
+ action: keep
+ - source_labels: [__meta_kubernetes_pod_container_port_number]
+ regex: "9093"
+ action: keep
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/deploy.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/deploy.yaml
new file mode 100644
index 00000000..a0c418ef
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/deploy.yaml
@@ -0,0 +1,331 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if not .Values.server.statefulSet.enabled -}}
+apiVersion: {{ template "prometheus.deployment.apiVersion" . }}
+kind: Deployment
+metadata:
+{{- if .Values.server.deploymentAnnotations }}
+ annotations:
+ {{ toYaml .Values.server.deploymentAnnotations | nindent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ selector:
+ matchLabels:
+ {{- include "prometheus.server.matchLabels" . | nindent 6 }}
+ replicas: {{ .Values.server.replicaCount }}
+ {{- if .Values.server.strategy }}
+ strategy:
+{{ toYaml .Values.server.strategy | trim | indent 4 }}
+ {{ if eq .Values.server.strategy.type "Recreate" }}rollingUpdate: null{{ end }}
+{{- end }}
+ template:
+ metadata:
+ {{- if .Values.server.podAnnotations }}
+ annotations:
+ {{ toYaml .Values.server.podAnnotations | nindent 8 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 8 }}
+ {{- if .Values.server.podLabels}}
+ {{ toYaml .Values.server.podLabels | nindent 8 }}
+ {{- end}}
+ spec:
+{{- if .Values.server.priorityClassName }}
+ priorityClassName: "{{ .Values.server.priorityClassName }}"
+{{- end }}
+{{- if .Values.server.schedulerName }}
+ schedulerName: "{{ .Values.server.schedulerName }}"
+{{- end }}
+{{- if semverCompare ">=1.13-0" .Capabilities.KubeVersion.GitVersion }}
+ {{- if or (.Values.server.enableServiceLinks) (eq (.Values.server.enableServiceLinks | toString) "<nil>") }}
+ enableServiceLinks: true
+ {{- else }}
+ enableServiceLinks: false
+ {{- end }}
+{{- end }}
+ serviceAccountName: {{ template "prometheus.serviceAccountName.server" . }}
+ {{- if .Values.server.extraInitContainers }}
+ initContainers:
+{{ toYaml .Values.server.extraInitContainers | indent 8 }}
+ {{- end }}
+ containers:
+ {{- if .Values.configmapReload.prometheus.enabled }}
+ - name: {{ template "prometheus.name" . }}-{{ .Values.server.name }}-{{ .Values.configmapReload.prometheus.name }}
+ image: "{{ .Values.configmapReload.prometheus.image.repository }}:{{ .Values.configmapReload.prometheus.image.tag }}"
+ imagePullPolicy: "{{ .Values.configmapReload.prometheus.image.pullPolicy }}"
+ args:
+ - --volume-dir=/etc/config
+ - --webhook-url=http://127.0.0.1:9090{{ .Values.server.prefixURL }}/-/reload
+ {{- range $key, $value := .Values.configmapReload.prometheus.extraArgs }}
+ - --{{ $key }}={{ $value }}
+ {{- end }}
+ {{- range .Values.configmapReload.prometheus.extraVolumeDirs }}
+ - --volume-dir={{ . }}
+ {{- end }}
+ resources:
+{{ toYaml .Values.configmapReload.prometheus.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ readOnly: true
+ {{- range .Values.configmapReload.prometheus.extraConfigmapMounts }}
+ - name: {{ $.Values.configmapReload.prometheus.name }}-{{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- end }}
+
+ - name: {{ template "prometheus.name" . }}-{{ .Values.server.name }}
+ image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
+ imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
+ {{- if .Values.server.env }}
+ env:
+{{ toYaml .Values.server.env | indent 12}}
+ {{- end }}
+ args:
+ {{- if .Values.server.defaultFlagsOverride }}
+ {{ toYaml .Values.server.defaultFlagsOverride | nindent 12}}
+ {{- else }}
+ {{- if .Values.server.retention }}
+ - --storage.tsdb.retention.time={{ .Values.server.retention }}
+ {{- end }}
+ - --config.file={{ .Values.server.configPath }}
+ {{- if .Values.server.storagePath }}
+ - --storage.tsdb.path={{ .Values.server.storagePath }}
+ {{- else }}
+ - --storage.tsdb.path={{ .Values.server.persistentVolume.mountPath }}
+ {{- end }}
+ - --web.console.libraries=/etc/prometheus/console_libraries
+ - --web.console.templates=/etc/prometheus/consoles
+ {{- range .Values.server.extraFlags }}
+ - --{{ . }}
+ {{- end }}
+ {{- range $key, $value := .Values.server.extraArgs }}
+ - --{{ $key }}={{ $value }}
+ {{- end }}
+ {{- if .Values.server.prefixURL }}
+ - --web.route-prefix={{ .Values.server.prefixURL }}
+ {{- end }}
+ {{- if .Values.server.baseURL }}
+ - --web.external-url={{ .Values.server.baseURL }}
+ {{- end }}
+ {{- end }}
+ ports:
+ - containerPort: 9090
+ {{- if .Values.server.hostPort }}
+ hostPort: {{ .Values.server.hostPort }}
+ {{- end }}
+ readinessProbe:
+ {{- if not .Values.server.tcpSocketProbeEnabled }}
+ httpGet:
+ path: {{ .Values.server.prefixURL }}/-/ready
+ port: 9090
+ scheme: {{ .Values.server.probeScheme }}
+ {{- if .Values.server.probeHeaders }}
+ httpHeaders:
+ {{- range .Values.server.probeHeaders}}
+ - name: {{ .name }}
+ value: {{ .value }}
+ {{- end }}
+ {{- end }}
+ {{- else }}
+ tcpSocket:
+ port: 9090
+ {{- end }}
+ initialDelaySeconds: {{ .Values.server.readinessProbeInitialDelay }}
+ periodSeconds: {{ .Values.server.readinessProbePeriodSeconds }}
+ timeoutSeconds: {{ .Values.server.readinessProbeTimeout }}
+ failureThreshold: {{ .Values.server.readinessProbeFailureThreshold }}
+ successThreshold: {{ .Values.server.readinessProbeSuccessThreshold }}
+ livenessProbe:
+ {{- if not .Values.server.tcpSocketProbeEnabled }}
+ httpGet:
+ path: {{ .Values.server.prefixURL }}/-/healthy
+ port: 9090
+ scheme: {{ .Values.server.probeScheme }}
+ {{- if .Values.server.probeHeaders }}
+ httpHeaders:
+ {{- range .Values.server.probeHeaders}}
+ - name: {{ .name }}
+ value: {{ .value }}
+ {{- end }}
+ {{- end }}
+ {{- else }}
+ tcpSocket:
+ port: 9090
+ {{- end }}
+ initialDelaySeconds: {{ .Values.server.livenessProbeInitialDelay }}
+ periodSeconds: {{ .Values.server.livenessProbePeriodSeconds }}
+ timeoutSeconds: {{ .Values.server.livenessProbeTimeout }}
+ failureThreshold: {{ .Values.server.livenessProbeFailureThreshold }}
+ successThreshold: {{ .Values.server.livenessProbeSuccessThreshold }}
+ {{- if .Values.server.startupProbe.enabled }}
+ startupProbe:
+ {{- if not .Values.server.tcpSocketProbeEnabled }}
+ httpGet:
+ path: {{ .Values.server.prefixURL }}/-/healthy
+ port: 9090
+ scheme: {{ .Values.server.probeScheme }}
+ {{- if .Values.server.probeHeaders }}
+ httpHeaders:
+ {{- range .Values.server.probeHeaders}}
+ - name: {{ .name }}
+ value: {{ .value }}
+ {{- end }}
+ {{- end }}
+ {{- else }}
+ tcpSocket:
+ port: 9090
+ {{- end }}
+ failureThreshold: {{ .Values.server.startupProbe.failureThreshold }}
+ periodSeconds: {{ .Values.server.startupProbe.periodSeconds }}
+ timeoutSeconds: {{ .Values.server.startupProbe.timeoutSeconds }}
+ {{- end }}
+ resources:
+{{ toYaml .Values.server.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ - name: storage-volume
+ mountPath: {{ .Values.server.persistentVolume.mountPath }}
+ subPath: "{{ .Values.server.persistentVolume.subPath }}"
+ {{- range .Values.server.extraHostPathMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- range .Values.server.extraConfigmapMounts }}
+ - name: {{ $.Values.server.name }}-{{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- range .Values.server.extraSecretMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- if .Values.server.extraVolumeMounts }}
+ {{ toYaml .Values.server.extraVolumeMounts | nindent 12 }}
+ {{- end }}
+ {{- if .Values.server.sidecarContainers }}
+ {{- range $name, $spec := .Values.server.sidecarContainers }}
+ - name: {{ $name }}
+ {{- if kindIs "string" $spec }}
+ {{- tpl $spec $ | nindent 10 }}
+ {{- else }}
+ {{- toYaml $spec | nindent 10 }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
+ hostNetwork: {{ .Values.server.hostNetwork }}
+ {{- if .Values.server.dnsPolicy }}
+ dnsPolicy: {{ .Values.server.dnsPolicy }}
+ {{- end }}
+ {{- if .Values.imagePullSecrets }}
+ imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.nodeSelector }}
+ nodeSelector:
+{{ toYaml .Values.server.nodeSelector | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.hostAliases }}
+ hostAliases:
+{{ toYaml .Values.server.hostAliases | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.dnsConfig }}
+ dnsConfig:
+{{ toYaml .Values.server.dnsConfig | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.securityContext }}
+ securityContext:
+{{ toYaml .Values.server.securityContext | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.tolerations }}
+ tolerations:
+{{ toYaml .Values.server.tolerations | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.affinity }}
+ affinity:
+{{ toYaml .Values.server.affinity | indent 8 }}
+ {{- end }}
+ terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
+ volumes:
+ - name: config-volume
+ {{- if empty .Values.server.configFromSecret }}
+ configMap:
+ name: {{ if .Values.server.configMapOverrideName }}{{ .Release.Name }}-{{ .Values.server.configMapOverrideName }}{{- else }}{{ template "prometheus.server.fullname" . }}{{- end }}
+ {{- else }}
+ secret:
+ secretName: {{ .Values.server.configFromSecret }}
+ {{- end }}
+ {{- range .Values.server.extraHostPathMounts }}
+ - name: {{ .name }}
+ hostPath:
+ path: {{ .hostPath }}
+ {{- end }}
+ {{- range .Values.configmapReload.prometheus.extraConfigmapMounts }}
+ - name: {{ $.Values.configmapReload.prometheus.name }}-{{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- end }}
+ {{- range .Values.server.extraConfigmapMounts }}
+ - name: {{ $.Values.server.name }}-{{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- end }}
+ {{- range .Values.server.extraSecretMounts }}
+ - name: {{ .name }}
+ secret:
+ secretName: {{ .secretName }}
+ {{- with .optional }}
+ optional: {{ . }}
+ {{- end }}
+ {{- end }}
+ {{- range .Values.configmapReload.prometheus.extraConfigmapMounts }}
+ - name: {{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- with .optional }}
+ optional: {{ . }}
+ {{- end }}
+ {{- end }}
+{{- if .Values.server.extraVolumes }}
+{{ toYaml .Values.server.extraVolumes | indent 8}}
+{{- end }}
+ - name: storage-volume
+ {{- if .Values.server.persistentVolume.enabled }}
+ persistentVolumeClaim:
+ claimName: {{ if .Values.server.persistentVolume.existingClaim }}{{ .Values.server.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus.server.fullname" . }}{{- end }}
+ {{- else }}
+ emptyDir:
+ {{- if .Values.server.emptyDir.sizeLimit }}
+ sizeLimit: {{ .Values.server.emptyDir.sizeLimit }}
+ {{- else }}
+ {}
+ {{- end -}}
+ {{- end -}}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/ingress.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/ingress.yaml
new file mode 100644
index 00000000..6b2dce13
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/ingress.yaml
@@ -0,0 +1,74 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if .Values.server.ingress.enabled -}}
+{{- $ingressApiIsStable := eq (include "ingress.isStable" .) "true" -}}
+{{- $ingressSupportsIngressClassName := eq (include "ingress.supportsIngressClassName" .) "true" -}}
+{{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}}
+{{- $releaseName := .Release.Name -}}
+{{- $serviceName := include "prometheus.server.fullname" . }}
+{{- $servicePort := .Values.server.service.servicePort -}}
+{{- $ingressPath := .Values.server.ingress.path -}}
+{{- $ingressPathType := .Values.server.ingress.pathType -}}
+{{- $extraPaths := .Values.server.ingress.extraPaths -}}
+apiVersion: {{ template "ingress.apiVersion" . }}
+kind: Ingress
+metadata:
+{{- if .Values.server.ingress.annotations }}
+ annotations:
+{{ toYaml .Values.server.ingress.annotations | indent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+{{- range $key, $value := .Values.server.ingress.extraLabels }}
+ {{ $key }}: {{ $value }}
+{{- end }}
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ {{- if and $ingressSupportsIngressClassName .Values.server.ingress.ingressClassName }}
+ ingressClassName: {{ .Values.server.ingress.ingressClassName }}
+ {{- end }}
+ rules:
+ {{- range .Values.server.ingress.hosts }}
+ {{- $url := splitList "/" . }}
+ - host: {{ first $url }}
+ http:
+ paths:
+{{ if $extraPaths }}
+{{ toYaml $extraPaths | indent 10 }}
+{{- end }}
+ - path: {{ $ingressPath }}
+ {{- if $ingressSupportsPathType }}
+ pathType: {{ $ingressPathType }}
+ {{- end }}
+ backend:
+ {{- if $ingressApiIsStable }}
+ service:
+ name: {{ $serviceName }}
+ port:
+ number: {{ $servicePort }}
+ {{- else }}
+ serviceName: {{ $serviceName }}
+ servicePort: {{ $servicePort }}
+ {{- end }}
+ {{- end -}}
+{{- if .Values.server.ingress.tls }}
+ tls:
+{{ toYaml .Values.server.ingress.tls | indent 4 }}
+ {{- end -}}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/networkpolicy.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/networkpolicy.yaml
new file mode 100644
index 00000000..d4617657
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/networkpolicy.yaml
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if .Values.networkPolicy.enabled }}
+apiVersion: {{ template "prometheus.networkPolicy.apiVersion" . }}
+kind: NetworkPolicy
+metadata:
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+spec:
+ podSelector:
+ matchLabels:
+ {{- include "prometheus.server.matchLabels" . | nindent 6 }}
+ ingress:
+ - ports:
+ - port: 9090
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/pdb.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/pdb.yaml
new file mode 100644
index 00000000..ea36fa27
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/pdb.yaml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.podDisruptionBudget.enabled }}
+apiVersion: policy/v1beta1
+kind: PodDisruptionBudget
+metadata:
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+spec:
+ maxUnavailable: {{ .Values.server.podDisruptionBudget.maxUnavailable }}
+ selector:
+ matchLabels:
+ {{- include "prometheus.server.labels" . | nindent 6 }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/psp.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/psp.yaml
new file mode 100644
index 00000000..16c56f48
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/psp.yaml
@@ -0,0 +1,66 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.server.enabled .Values.rbac.create .Values.podSecurityPolicy.enabled }}
+apiVersion: {{ template "prometheus.podSecurityPolicy.apiVersion" . }}
+kind: PodSecurityPolicy
+metadata:
+ name: {{ template "prometheus.server.fullname" . }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ annotations:
+{{- if .Values.server.podSecurityPolicy.annotations }}
+{{ toYaml .Values.server.podSecurityPolicy.annotations | indent 4 }}
+{{- end }}
+spec:
+ privileged: false
+ allowPrivilegeEscalation: false
+ allowedCapabilities:
+ - 'CHOWN'
+ volumes:
+ - 'configMap'
+ - 'persistentVolumeClaim'
+ - 'emptyDir'
+ - 'secret'
+ - 'hostPath'
+ allowedHostPaths:
+ - pathPrefix: /etc
+ readOnly: true
+ - pathPrefix: {{ .Values.server.persistentVolume.mountPath }}
+ {{- range .Values.server.extraHostPathMounts }}
+ - pathPrefix: {{ .hostPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ hostNetwork: false
+ hostPID: false
+ hostIPC: false
+ runAsUser:
+ rule: 'RunAsAny'
+ seLinux:
+ rule: 'RunAsAny'
+ supplementalGroups:
+ rule: 'MustRunAs'
+ ranges:
+ # Forbid adding the root group.
+ - min: 1
+ max: 65535
+ fsGroup:
+ rule: 'MustRunAs'
+ ranges:
+ # Forbid adding the root group.
+ - min: 1
+ max: 65535
+ readOnlyRootFilesystem: false
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/pvc.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/pvc.yaml
new file mode 100644
index 00000000..99ebd0e5
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/pvc.yaml
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if not .Values.server.statefulSet.enabled -}}
+{{- if .Values.server.persistentVolume.enabled -}}
+{{- if not .Values.server.persistentVolume.existingClaim -}}
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ {{- if .Values.server.persistentVolume.annotations }}
+ annotations:
+{{ toYaml .Values.server.persistentVolume.annotations | indent 4 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ accessModes:
+{{ toYaml .Values.server.persistentVolume.accessModes | indent 4 }}
+{{- if .Values.server.persistentVolume.storageClass }}
+{{- if (eq "-" .Values.server.persistentVolume.storageClass) }}
+ storageClassName: ""
+{{- else }}
+ storageClassName: "{{ .Values.server.persistentVolume.storageClass }}"
+{{- end }}
+{{- end }}
+{{- if .Values.server.persistentVolume.volumeBindingMode }}
+ volumeBindingMode: "{{ .Values.server.persistentVolume.volumeBindingMode }}"
+{{- end }}
+ resources:
+ requests:
+ storage: "{{ .Values.server.persistentVolume.size }}"
+{{- if .Values.server.persistentVolume.selector }}
+ selector:
+ {{- toYaml .Values.server.persistentVolume.selector | nindent 4 }}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/rolebinding.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/rolebinding.yaml
new file mode 100644
index 00000000..0d296e46
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/rolebinding.yaml
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+{{- if and .Values.server.enabled .Values.rbac.create .Values.server.useExistingClusterRoleName .Values.server.namespaces -}}
+{{ range $.Values.server.namespaces -}}
+---
+apiVersion: {{ template "rbac.apiVersion" $ }}
+kind: RoleBinding
+metadata:
+ labels:
+ {{- include "prometheus.server.labels" $ | nindent 4 }}
+ name: {{ template "prometheus.server.fullname" $ }}
+ namespace: {{ . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ template "prometheus.serviceAccountName.server" $ }}
+{{ include "prometheus.namespace" $ | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: {{ $.Values.server.useExistingClusterRoleName }}
+{{ end -}}
+{{ end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/service.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/service.yaml
new file mode 100644
index 00000000..ca5e9700
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/service.yaml
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+apiVersion: v1
+kind: Service
+metadata:
+{{- if .Values.server.service.annotations }}
+ annotations:
+{{ toYaml .Values.server.service.annotations | indent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+{{- if .Values.server.service.labels }}
+{{ toYaml .Values.server.service.labels | indent 4 }}
+{{- end }}
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+{{- if .Values.server.service.clusterIP }}
+ clusterIP: {{ .Values.server.service.clusterIP }}
+{{- end }}
+{{- if .Values.server.service.externalIPs }}
+ externalIPs:
+{{ toYaml .Values.server.service.externalIPs | indent 4 }}
+{{- end }}
+{{- if .Values.server.service.loadBalancerIP }}
+ loadBalancerIP: {{ .Values.server.service.loadBalancerIP }}
+{{- end }}
+{{- if .Values.server.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges:
+ {{- range $cidr := .Values.server.service.loadBalancerSourceRanges }}
+ - {{ $cidr }}
+ {{- end }}
+{{- end }}
+ ports:
+ - name: http
+ port: {{ .Values.server.service.servicePort }}
+ protocol: TCP
+ targetPort: 9090
+ {{- if .Values.server.service.nodePort }}
+ nodePort: {{ .Values.server.service.nodePort }}
+ {{- end }}
+ {{- if .Values.server.service.gRPC.enabled }}
+ - name: grpc
+ port: {{ .Values.server.service.gRPC.servicePort }}
+ protocol: TCP
+ targetPort: 10901
+ {{- if .Values.server.service.gRPC.nodePort }}
+ nodePort: {{ .Values.server.service.gRPC.nodePort }}
+ {{- end }}
+ {{- end }}
+ selector:
+ {{- if and .Values.server.statefulSet.enabled .Values.server.service.statefulsetReplica.enabled }}
+ statefulset.kubernetes.io/pod-name: {{ template "prometheus.server.fullname" . }}-{{ .Values.server.service.statefulsetReplica.replica }}
+ {{- else -}}
+ {{- include "prometheus.server.matchLabels" . | nindent 4 }}
+{{- if .Values.server.service.sessionAffinity }}
+ sessionAffinity: {{ .Values.server.service.sessionAffinity }}
+{{- end }}
+ {{- end }}
+ type: "{{ .Values.server.service.type }}"
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/serviceaccount.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/serviceaccount.yaml
new file mode 100644
index 00000000..5bf636d2
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/serviceaccount.yaml
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if .Values.serviceAccounts.server.create }}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ name: {{ template "prometheus.serviceAccountName.server" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+ annotations:
+{{ toYaml .Values.serviceAccounts.server.annotations | indent 4 }}
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/sts.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/sts.yaml
new file mode 100644
index 00000000..7afe2992
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/sts.yaml
@@ -0,0 +1,313 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if .Values.server.statefulSet.enabled -}}
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+{{- if .Values.server.statefulSet.annotations }}
+ annotations:
+ {{ toYaml .Values.server.statefulSet.annotations | nindent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ {{- if .Values.server.statefulSet.labels}}
+ {{ toYaml .Values.server.statefulSet.labels | nindent 4 }}
+ {{- end}}
+ name: {{ template "prometheus.server.fullname" . }}
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ serviceName: {{ template "prometheus.server.fullname" . }}-headless
+ selector:
+ matchLabels:
+ {{- include "prometheus.server.matchLabels" . | nindent 6 }}
+ replicas: {{ .Values.server.replicaCount }}
+ podManagementPolicy: {{ .Values.server.statefulSet.podManagementPolicy }}
+ template:
+ metadata:
+ {{- if .Values.server.podAnnotations }}
+ annotations:
+ {{ toYaml .Values.server.podAnnotations | nindent 8 }}
+ {{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 8 }}
+ {{- if .Values.server.podLabels}}
+ {{ toYaml .Values.server.podLabels | nindent 8 }}
+ {{- end}}
+ spec:
+{{- if .Values.server.priorityClassName }}
+ priorityClassName: "{{ .Values.server.priorityClassName }}"
+{{- end }}
+{{- if .Values.server.schedulerName }}
+ schedulerName: "{{ .Values.server.schedulerName }}"
+{{- end }}
+{{- if semverCompare ">=1.13-0" .Capabilities.KubeVersion.GitVersion }}
+ {{- if or (.Values.server.enableServiceLinks) (eq (.Values.server.enableServiceLinks | toString) "<nil>") }}
+ enableServiceLinks: true
+ {{- else }}
+ enableServiceLinks: false
+ {{- end }}
+{{- end }}
+ serviceAccountName: {{ template "prometheus.serviceAccountName.server" . }}
+ {{- if .Values.server.extraInitContainers }}
+ initContainers:
+{{ toYaml .Values.server.extraInitContainers | indent 8 }}
+ {{- end }}
+ containers:
+ {{- if .Values.configmapReload.prometheus.enabled }}
+ - name: {{ template "prometheus.name" . }}-{{ .Values.server.name }}-{{ .Values.configmapReload.prometheus.name }}
+ image: "{{ .Values.configmapReload.prometheus.image.repository }}:{{ .Values.configmapReload.prometheus.image.tag }}"
+ imagePullPolicy: "{{ .Values.configmapReload.prometheus.image.pullPolicy }}"
+ args:
+ - --volume-dir=/etc/config
+ - --webhook-url=http://127.0.0.1:9090{{ .Values.server.prefixURL }}/-/reload
+ {{- range $key, $value := .Values.configmapReload.prometheus.extraArgs }}
+ - --{{ $key }}={{ $value }}
+ {{- end }}
+ {{- range .Values.configmapReload.prometheus.extraVolumeDirs }}
+ - --volume-dir={{ . }}
+ {{- end }}
+ resources:
+{{ toYaml .Values.configmapReload.prometheus.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ readOnly: true
+ {{- range .Values.configmapReload.prometheus.extraConfigmapMounts }}
+ - name: {{ $.Values.configmapReload.prometheus.name }}-{{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- end }}
+
+ - name: {{ template "prometheus.name" . }}-{{ .Values.server.name }}
+ image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
+ imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
+ {{- if .Values.server.env }}
+ env:
+{{ toYaml .Values.server.env | indent 12}}
+ {{- end }}
+ args:
+ {{- if .Values.server.defaultFlagsOverride }}
+ {{ toYaml .Values.server.defaultFlagsOverride | nindent 12}}
+ {{- else }}
+ {{- if .Values.server.prefixURL }}
+ - --web.route-prefix={{ .Values.server.prefixURL }}
+ {{- end }}
+ {{- if .Values.server.retention }}
+ - --storage.tsdb.retention.time={{ .Values.server.retention }}
+ {{- end }}
+ - --config.file={{ .Values.server.configPath }}
+ {{- if .Values.server.storagePath }}
+ - --storage.tsdb.path={{ .Values.server.storagePath }}
+ {{- else }}
+ - --storage.tsdb.path={{ .Values.server.persistentVolume.mountPath }}
+ {{- end }}
+ - --web.console.libraries=/etc/prometheus/console_libraries
+ - --web.console.templates=/etc/prometheus/consoles
+ {{- range .Values.server.extraFlags }}
+ - --{{ . }}
+ {{- end }}
+ {{- range $key, $value := .Values.server.extraArgs }}
+ - --{{ $key }}={{ $value }}
+ {{- end }}
+ {{- if .Values.server.baseURL }}
+ - --web.external-url={{ .Values.server.baseURL }}
+ {{- end }}
+ {{- end }}
+ ports:
+ - containerPort: 9090
+ {{- if .Values.server.hostPort }}
+ hostPort: {{ .Values.server.hostPort }}
+ {{- end }}
+ readinessProbe:
+ {{- if not .Values.server.tcpSocketProbeEnabled }}
+ httpGet:
+ path: {{ .Values.server.prefixURL }}/-/ready
+ port: 9090
+ scheme: {{ .Values.server.probeScheme }}
+ {{- else }}
+ tcpSocket:
+ port: 9090
+ {{- end }}
+ initialDelaySeconds: {{ .Values.server.readinessProbeInitialDelay }}
+ periodSeconds: {{ .Values.server.readinessProbePeriodSeconds }}
+ timeoutSeconds: {{ .Values.server.readinessProbeTimeout }}
+ failureThreshold: {{ .Values.server.readinessProbeFailureThreshold }}
+ successThreshold: {{ .Values.server.readinessProbeSuccessThreshold }}
+ livenessProbe:
+ {{- if not .Values.server.tcpSocketProbeEnabled }}
+ httpGet:
+ path: {{ .Values.server.prefixURL }}/-/healthy
+ port: 9090
+ scheme: {{ .Values.server.probeScheme }}
+ {{- else }}
+ tcpSocket:
+ port: 9090
+ {{- end }}
+ initialDelaySeconds: {{ .Values.server.livenessProbeInitialDelay }}
+ periodSeconds: {{ .Values.server.livenessProbePeriodSeconds }}
+ timeoutSeconds: {{ .Values.server.livenessProbeTimeout }}
+ failureThreshold: {{ .Values.server.livenessProbeFailureThreshold }}
+ successThreshold: {{ .Values.server.livenessProbeSuccessThreshold }}
+ resources:
+{{ toYaml .Values.server.resources | indent 12 }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/config
+ - name: storage-volume
+ mountPath: {{ .Values.server.persistentVolume.mountPath }}
+ subPath: "{{ .Values.server.persistentVolume.subPath }}"
+ {{- range .Values.server.extraHostPathMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- range .Values.server.extraConfigmapMounts }}
+ - name: {{ $.Values.server.name }}-{{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- range .Values.server.extraSecretMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ subPath: {{ .subPath }}
+ readOnly: {{ .readOnly }}
+ {{- end }}
+ {{- if .Values.server.extraVolumeMounts }}
+ {{ toYaml .Values.server.extraVolumeMounts | nindent 12 }}
+ {{- end }}
+ {{- if .Values.server.sidecarContainers }}
+ {{- range $name, $spec := .Values.server.sidecarContainers }}
+ - name: {{ $name }}
+ {{- if kindIs "string" $spec }}
+ {{- tpl $spec $ | nindent 10 }}
+ {{- else }}
+ {{- toYaml $spec | nindent 10 }}
+ {{- end }}
+ {{- end }}
+ {{- end }}
+ hostNetwork: {{ .Values.server.hostNetwork }}
+ {{- if .Values.server.dnsPolicy }}
+ dnsPolicy: {{ .Values.server.dnsPolicy }}
+ {{- end }}
+ {{- if .Values.imagePullSecrets }}
+ imagePullSecrets:
+{{ toYaml .Values.imagePullSecrets | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.nodeSelector }}
+ nodeSelector:
+{{ toYaml .Values.server.nodeSelector | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.hostAliases }}
+ hostAliases:
+{{ toYaml .Values.server.hostAliases | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.dnsConfig }}
+ dnsConfig:
+{{ toYaml .Values.server.dnsConfig | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.securityContext }}
+ securityContext:
+{{ toYaml .Values.server.securityContext | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.tolerations }}
+ tolerations:
+{{ toYaml .Values.server.tolerations | indent 8 }}
+ {{- end }}
+ {{- if .Values.server.affinity }}
+ affinity:
+{{ toYaml .Values.server.affinity | indent 8 }}
+ {{- end }}
+ terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
+ volumes:
+ - name: config-volume
+ {{- if empty .Values.server.configFromSecret }}
+ configMap:
+ name: {{ if .Values.server.configMapOverrideName }}{{ .Release.Name }}-{{ .Values.server.configMapOverrideName }}{{- else }}{{ template "prometheus.server.fullname" . }}{{- end }}
+ {{- else }}
+ secret:
+ secretName: {{ .Values.server.configFromSecret }}
+ {{- end }}
+ {{- range .Values.server.extraHostPathMounts }}
+ - name: {{ .name }}
+ hostPath:
+ path: {{ .hostPath }}
+ {{- end }}
+ {{- range .Values.configmapReload.prometheus.extraConfigmapMounts }}
+ - name: {{ $.Values.configmapReload.prometheus.name }}-{{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- end }}
+ {{- range .Values.server.extraConfigmapMounts }}
+ - name: {{ $.Values.server.name }}-{{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- end }}
+ {{- range .Values.server.extraSecretMounts }}
+ - name: {{ .name }}
+ secret:
+ secretName: {{ .secretName }}
+ {{- with .optional }}
+ optional: {{ . }}
+ {{- end }}
+ {{- end }}
+ {{- range .Values.configmapReload.prometheus.extraConfigmapMounts }}
+ - name: {{ .name }}
+ configMap:
+ name: {{ .configMap }}
+ {{- with .optional }}
+ optional: {{ . }}
+ {{- end }}
+ {{- end }}
+{{- if .Values.server.extraVolumes }}
+{{ toYaml .Values.server.extraVolumes | indent 8}}
+{{- end }}
+{{- if .Values.server.persistentVolume.enabled }}
+ volumeClaimTemplates:
+ - metadata:
+ name: storage-volume
+ {{- if .Values.server.persistentVolume.annotations }}
+ annotations:
+{{ toYaml .Values.server.persistentVolume.annotations | indent 10 }}
+ {{- end }}
+ spec:
+ accessModes:
+{{ toYaml .Values.server.persistentVolume.accessModes | indent 10 }}
+ resources:
+ requests:
+ storage: "{{ .Values.server.persistentVolume.size }}"
+ {{- if .Values.server.persistentVolume.storageClass }}
+ {{- if (eq "-" .Values.server.persistentVolume.storageClass) }}
+ storageClassName: ""
+ {{- else }}
+ storageClassName: "{{ .Values.server.persistentVolume.storageClass }}"
+ {{- end }}
+ {{- end }}
+{{- else }}
+ - name: storage-volume
+ emptyDir:
+ {{- if .Values.server.emptyDir.sizeLimit }}
+ sizeLimit: {{ .Values.server.emptyDir.sizeLimit }}
+ {{- else }}
+ {}
+ {{- end -}}
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/svc-headless.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/svc-headless.yaml
new file mode 100644
index 00000000..340e74c9
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/svc-headless.yaml
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if .Values.server.statefulSet.enabled -}}
+apiVersion: v1
+kind: Service
+metadata:
+{{- if .Values.server.statefulSet.headless.annotations }}
+ annotations:
+{{ toYaml .Values.server.statefulSet.headless.annotations | indent 4 }}
+{{- end }}
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+{{- if .Values.server.statefulSet.headless.labels }}
+{{ toYaml .Values.server.statefulSet.headless.labels | indent 4 }}
+{{- end }}
+ name: {{ template "prometheus.server.fullname" . }}-headless
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ clusterIP: None
+ ports:
+ - name: http
+ port: {{ .Values.server.statefulSet.headless.servicePort }}
+ protocol: TCP
+ targetPort: 9090
+ {{- if .Values.server.statefulSet.headless.gRPC.enabled }}
+ - name: grpc
+ port: {{ .Values.server.statefulSet.headless.gRPC.servicePort }}
+ protocol: TCP
+ targetPort: 10901
+ {{- if .Values.server.statefulSet.headless.gRPC.nodePort }}
+ nodePort: {{ .Values.server.statefulSet.headless.gRPC.nodePort }}
+ {{- end }}
+ {{- end }}
+
+ selector:
+ {{- include "prometheus.server.matchLabels" . | nindent 4 }}
+{{- end -}}
+{{- end -}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/templates/verticalpodautoscaler.yaml b/deploy/charts/admin-stack/charts/prometheus/templates/verticalpodautoscaler.yaml
new file mode 100644
index 00000000..07e77b0c
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/templates/verticalpodautoscaler.yaml
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if .Values.server.enabled -}}
+{{- if .Values.server.verticalAutoscaler.enabled -}}
+apiVersion: autoscaling.k8s.io/v1beta2
+kind: VerticalPodAutoscaler
+metadata:
+ labels:
+ {{- include "prometheus.server.labels" . | nindent 4 }}
+ name: {{ template "prometheus.server.fullname" . }}-vpa
+{{ include "prometheus.namespace" . | indent 2 }}
+spec:
+ targetRef:
+ apiVersion: "apps/v1"
+{{- if .Values.server.statefulSet.enabled }}
+ kind: StatefulSet
+{{- else }}
+ kind: Deployment
+{{- end }}
+ name: {{ template "prometheus.server.fullname" . }}
+ updatePolicy:
+ updateMode: {{ .Values.server.verticalAutoscaler.updateMode | default "Off" | quote }}
+ resourcePolicy:
+ containerPolicies: {{ .Values.server.verticalAutoscaler.containerPolicies | default list | toYaml | trim | nindent 4 }}
+{{- end -}} {{/* if .Values.server.verticalAutoscaler.enabled */}}
+{{- end -}} {{/* .Values.server.enabled */}}
diff --git a/deploy/charts/admin-stack/charts/prometheus/values.yaml b/deploy/charts/admin-stack/charts/prometheus/values.yaml
new file mode 100644
index 00000000..c464efcf
--- /dev/null
+++ b/deploy/charts/admin-stack/charts/prometheus/values.yaml
@@ -0,0 +1,1481 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rbac:
+ create: true
+
+podSecurityPolicy:
+ enabled: false
+
+imagePullSecrets:
+# - name: "image-pull-secret"
+
+## Define serviceAccount names for components. Defaults to component's fully qualified name.
+##
+serviceAccounts:
+ server:
+ create: true
+ name:
+ annotations: {}
+## Monitors ConfigMap changes and POSTs to a URL
+## Ref: https://github.com/jimmidyson/configmap-reload
+##
+configmapReload:
+ prometheus:
+ ## If false, the configmap-reload container will not be deployed
+ ##
+ enabled: true
+
+ ## configmap-reload container name
+ ##
+ name: configmap-reload
+
+ ## configmap-reload container image
+ ##
+ image:
+ repository: jimmidyson/configmap-reload
+ tag: v0.8.0
+ pullPolicy: IfNotPresent
+
+ ## Additional configmap-reload container arguments
+ ##
+ extraArgs: {}
+ ## Additional configmap-reload volume directories
+ ##
+ extraVolumeDirs: []
+
+
+ ## Additional configmap-reload mounts
+ ##
+ extraConfigmapMounts: []
+ # - name: prometheus-alerts
+ # mountPath: /etc/alerts.d
+ # subPath: ""
+ # configMap: prometheus-alerts
+ # readOnly: true
+
+
+ ## configmap-reload resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ alertmanager:
+ ## If false, the configmap-reload container will not be deployed
+ ##
+ enabled: true
+
+ ## configmap-reload container name
+ ##
+ name: configmap-reload
+
+ ## configmap-reload container image
+ ##
+ image:
+ repository: jimmidyson/configmap-reload
+ tag: v0.5.0
+ pullPolicy: IfNotPresent
+
+ ## Additional configmap-reload container arguments
+ ##
+ extraArgs: {}
+ ## Additional configmap-reload volume directories
+ ##
+ extraVolumeDirs: []
+
+
+ ## Additional configmap-reload mounts
+ ##
+ extraConfigmapMounts: []
+ # - name: prometheus-alerts
+ # mountPath: /etc/alerts.d
+ # subPath: ""
+ # configMap: prometheus-alerts
+ # readOnly: true
+
+
+ ## configmap-reload resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+
+kubeStateMetrics:
+ ## If false, kube-state-metrics sub-chart will not be installed
+ ##
+ enabled: true
+
+## kube-state-metrics sub-chart configurable values
+## Please see https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics
+##
+# kube-state-metrics:
+
+nodeExporter:
+ ## If false, node-exporter will not be installed
+ ##
+ enabled: true
+
+ ## If true, node-exporter pods share the host network namespace
+ ##
+ hostNetwork: true
+
+ ## If true, node-exporter pods share the host PID namespace
+ ##
+ hostPID: true
+
+ ## If true, node-exporter pods mounts host / at /host/root
+ ##
+ hostRootfs: true
+
+ ## node-exporter container name
+ ##
+ name: node-exporter
+
+ ## node-exporter container image
+ ##
+ image:
+ repository: quay.io/prometheus/node-exporter
+ tag: v1.3.0
+ pullPolicy: IfNotPresent
+
+ ## Specify if a Pod Security Policy for node-exporter must be created
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
+ ##
+ podSecurityPolicy:
+ annotations: {}
+ ## Specify pod annotations
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
+ ##
+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
+ # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
+ # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
+
+ ## node-exporter priorityClassName
+ ##
+ priorityClassName: ""
+
+ ## Custom Update Strategy
+ ##
+ updateStrategy:
+ type: RollingUpdate
+
+ ## Additional node-exporter container arguments
+ ##
+ extraArgs: {}
+
+ ## Additional InitContainers to initialize the pod
+ ##
+ extraInitContainers: []
+
+ ## Additional node-exporter hostPath mounts
+ ##
+ extraHostPathMounts: []
+ # - name: textfile-dir
+ # mountPath: /srv/txt_collector
+ # hostPath: /var/lib/node-exporter
+ # readOnly: true
+ # mountPropagation: HostToContainer
+
+ extraConfigmapMounts: []
+ # - name: certs-configmap
+ # mountPath: /prometheus
+ # configMap: certs-configmap
+ # readOnly: true
+
+ ## Node tolerations for node-exporter scheduling to nodes with taints
+ ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+ ##
+ tolerations: []
+ # - key: "key"
+ # operator: "Equal|Exists"
+ # value: "value"
+ # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
+
+ ## Node labels for node-exporter pod assignment
+ ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+
+ ## Annotations to be added to node-exporter pods
+ ##
+ podAnnotations: {}
+
+ ## Labels to be added to node-exporter pods
+ ##
+ pod:
+ labels: {}
+
+ ## PodDisruptionBudget settings
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
+ ##
+ podDisruptionBudget:
+ enabled: false
+ maxUnavailable: 1
+
+ ## node-exporter resource limits & requests
+ ## Ref: https://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ # limits:
+ # cpu: 200m
+ # memory: 50Mi
+ # requests:
+ # cpu: 100m
+ # memory: 30Mi
+
+ # Custom DNS configuration to be added to node-exporter pods
+ dnsConfig: {}
+ # nameservers:
+ # - 1.2.3.4
+ # searches:
+ # - ns1.svc.cluster-domain.example
+ # - my.dns.search.suffix
+ # options:
+ # - name: ndots
+ # value: "2"
+ # - name: edns0
+
+ ## Security context to be added to node-exporter pods
+ ##
+ securityContext:
+ fsGroup: 65534
+ runAsGroup: 65534
+ runAsNonRoot: true
+ runAsUser: 65534
+
+ service:
+ annotations:
+ prometheus.io/scrape: "true"
+ labels: {}
+
+ # Exposed as a headless service:
+ # https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
+ clusterIP: None
+
+ ## List of IP addresses at which the node-exporter service is available
+ ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
+ ##
+ externalIPs: []
+
+ hostPort: 9100
+ loadBalancerIP: ""
+ loadBalancerSourceRanges: []
+ servicePort: 9100
+ type: ClusterIP
+
+server:
+ ## Prometheus server container name
+ ##
+ enabled: true
+
+ ## Use a ClusterRole (and ClusterRoleBinding)
+ ## - If set to false - we define a RoleBinding in the defined namespaces ONLY
+ ##
+ ## NB: because we need a Role with nonResourceURL's ("/metrics") - you must get someone with Cluster-admin privileges to define this role for you, before running with this setting enabled.
+ ## This makes prometheus work - for users who do not have ClusterAdmin privs, but wants prometheus to operate on their own namespaces, instead of clusterwide.
+ ##
+ ## You MUST also set namespaces to the ones you have access to and want monitored by Prometheus.
+ ##
+ # useExistingClusterRoleName: nameofclusterrole
+
+ ## namespaces to monitor (instead of monitoring all - clusterwide). Needed if you want to run without Cluster-admin privileges.
+ # namespaces:
+ # - yournamespace
+
+ name: server
+
+ # sidecarContainers - add more containers to prometheus server
+ # Key/Value where Key is the sidecar `- name: <Key>`
+ # Example:
+ # sidecarContainers:
+ # webserver:
+ # image: nginx
+ sidecarContainers: {}
+
+ # sidecarTemplateValues - context to be used in template for sidecarContainers
+ # Example:
+ # sidecarTemplateValues: *your-custom-globals
+ # sidecarContainers:
+ # webserver: |-
+ # {{ include "webserver-container-template" . }}
+ # Template for `webserver-container-template` might looks like this:
+ # image: "{{ .Values.server.sidecarTemplateValues.repository }}:{{ .Values.server.sidecarTemplateValues.tag }}"
+ # ...
+ #
+ sidecarTemplateValues: {}
+
+ ## Prometheus server container image
+ ##
+ image:
+ repository: quay.io/prometheus/prometheus
+ tag: v2.34.0
+ pullPolicy: IfNotPresent
+
+ ## prometheus server priorityClassName
+ ##
+ priorityClassName: ""
+
+ ## EnableServiceLinks indicates whether information about services should be injected
+ ## into pod's environment variables, matching the syntax of Docker links.
+ ## WARNING: the field is unsupported and will be skipped in K8s prior to v1.13.0.
+ ##
+ enableServiceLinks: true
+
+ ## The URL prefix at which the container can be accessed. Useful in the case the '-web.external-url' includes a slug
+ ## so that the various internal URLs are still able to access as they are in the default case.
+ ## (Optional)
+ prefixURL: ""
+
+ ## External URL which can access prometheus
+ ## Maybe same with Ingress host name
+ baseURL: ""
+
+ ## Additional server container environment variables
+ ##
+ ## You specify this manually like you would a raw deployment manifest.
+ ## This means you can bind in environment variables from secrets.
+ ##
+ ## e.g. static environment variable:
+ ## - name: DEMO_GREETING
+ ## value: "Hello from the environment"
+ ##
+ ## e.g. secret environment variable:
+ ## - name: USERNAME
+ ## valueFrom:
+ ## secretKeyRef:
+ ## name: mysecret
+ ## key: username
+ env: []
+
+ # List of flags to override default parameters, e.g:
+ # - --enable-feature=agent
+ # - --storage.agent.retention.max-time=30m
+ defaultFlagsOverride: []
+
+ extraFlags:
+ - web.enable-lifecycle
+ ## web.enable-admin-api flag controls access to the administrative HTTP API which includes functionality such as
+ ## deleting time series. This is disabled by default.
+ # - web.enable-admin-api
+ ##
+ ## storage.tsdb.no-lockfile flag controls BD locking
+ # - storage.tsdb.no-lockfile
+ ##
+ ## storage.tsdb.wal-compression flag enables compression of the write-ahead log (WAL)
+ # - storage.tsdb.wal-compression
+
+ ## Path to a configuration file on prometheus server container FS
+ configPath: /etc/config/prometheus.yml
+
+ ### The data directory used by prometheus to set --storage.tsdb.path
+ ### When empty server.persistentVolume.mountPath is used instead
+ storagePath: ""
+
+ global:
+ ## How frequently to scrape targets by default
+ ##
+ scrape_interval: 1m
+ ## How long until a scrape request times out
+ ##
+ scrape_timeout: 10s
+ ## How frequently to evaluate rules
+ ##
+ evaluation_interval: 1m
+ ## https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write
+ ##
+ remoteWrite: []
+ ## https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_read
+ ##
+ remoteRead: []
+
+ ## Custom HTTP headers for Liveness/Readiness/Startup Probe
+ ##
+ ## Useful for providing HTTP Basic Auth to healthchecks
+ probeHeaders: []
+
+ ## Additional Prometheus server container arguments
+ ##
+ extraArgs: {}
+
+ ## Additional InitContainers to initialize the pod
+ ##
+ extraInitContainers: []
+
+ ## Additional Prometheus server Volume mounts
+ ##
+ extraVolumeMounts: []
+
+ ## Additional Prometheus server Volumes
+ ##
+ extraVolumes: []
+
+ ## Additional Prometheus server hostPath mounts
+ ##
+ extraHostPathMounts: []
+ # - name: certs-dir
+ # mountPath: /etc/kubernetes/certs
+ # subPath: ""
+ # hostPath: /etc/kubernetes/certs
+ # readOnly: true
+
+ extraConfigmapMounts: []
+ # - name: certs-configmap
+ # mountPath: /prometheus
+ # subPath: ""
+ # configMap: certs-configmap
+ # readOnly: true
+
+ ## Additional Prometheus server Secret mounts
+ # Defines additional mounts with secrets. Secrets must be manually created in the namespace.
+ extraSecretMounts: []
+ # - name: secret-files
+ # mountPath: /etc/secrets
+ # subPath: ""
+ # secretName: prom-secret-files
+ # readOnly: true
+
+ ## ConfigMap override where fullname is {{.Release.Name}}-{{.Values.server.configMapOverrideName}}
+ ## Defining configMapOverrideName will cause templates/server-configmap.yaml
+ ## to NOT generate a ConfigMap resource
+ ##
+ configMapOverrideName: ""
+
+ ingress:
+ ## If true, Prometheus server Ingress will be created
+ ##
+ enabled: false
+
+ # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
+ # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
+ # ingressClassName: nginx
+
+ ## Prometheus server Ingress annotations
+ ##
+ annotations: {}
+ # kubernetes.io/ingress.class: nginx
+ # kubernetes.io/tls-acme: 'true'
+
+ ## Prometheus server Ingress additional labels
+ ##
+ extraLabels: {}
+
+ ## Prometheus server Ingress hostnames with optional path
+ ## Must be provided if Ingress is enabled
+ ##
+ hosts: []
+ # - prometheus.domain.com
+ # - domain.com/prometheus
+
+ path: /
+
+ # pathType is only for k8s >= 1.18
+ pathType: Prefix
+
+ ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services.
+ extraPaths: []
+ # - path: /*
+ # backend:
+ # serviceName: ssl-redirect
+ # servicePort: use-annotation
+
+ ## Prometheus server Ingress TLS configuration
+ ## Secrets must be manually created in the namespace
+ ##
+ tls: []
+ # - secretName: prometheus-server-tls
+ # hosts:
+ # - prometheus.domain.com
+
+ ## Server Deployment Strategy type
+ # strategy:
+ # type: Recreate
+
+ ## hostAliases allows adding entries to /etc/hosts inside the containers
+ hostAliases: []
+ # - ip: "127.0.0.1"
+ # hostnames:
+ # - "example.com"
+
+ ## Node tolerations for server scheduling to nodes with taints
+ ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+ ##
+ tolerations: []
+ # - key: "key"
+ # operator: "Equal|Exists"
+ # value: "value"
+ # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
+
+ ## Node labels for Prometheus server pod assignment
+ ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+
+ ## Pod affinity
+ ##
+ affinity: {}
+
+ ## PodDisruptionBudget settings
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
+ ##
+ podDisruptionBudget:
+ enabled: false
+ maxUnavailable: 1
+
+ ## Use an alternate scheduler, e.g. "stork".
+ ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
+ ##
+ # schedulerName:
+
+ persistentVolume:
+ ## If true, Prometheus server will create/use a Persistent Volume Claim
+ ## If false, use emptyDir
+ ##
+ enabled: true
+
+ ## Prometheus server data Persistent Volume access modes
+ ## Must match those of existing PV or dynamic provisioner
+ ## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
+ ##
+ accessModes:
+ - ReadWriteOnce
+
+ ## Prometheus server data Persistent Volume annotations
+ ##
+ annotations: {}
+
+ ## Prometheus server data Persistent Volume existing claim name
+ ## Requires server.persistentVolume.enabled: true
+ ## If defined, PVC must be created manually before volume will be bound
+ existingClaim: ""
+
+ ## Prometheus server data Persistent Volume mount root path
+ ##
+ mountPath: /data
+
+ ## Prometheus server data Persistent Volume size
+ ##
+ size: 8Gi
+
+ ## Prometheus server data Persistent Volume Storage Class
+ ## If defined, storageClassName: <storageClass>
+ ## If set to "-", storageClassName: "", which disables dynamic provisioning
+ ## If undefined (the default) or set to null, no storageClassName spec is
+ ## set, choosing the default provisioner. (gp2 on AWS, standard on
+ ## GKE, AWS & OpenStack)
+ ##
+ # storageClass: "-"
+
+ ## Prometheus server data Persistent Volume Binding Mode
+ ## If defined, volumeBindingMode: <volumeBindingMode>
+ ## If undefined (the default) or set to null, no volumeBindingMode spec is
+ ## set, choosing the default mode.
+ ##
+ # volumeBindingMode: ""
+
+ ## Subdirectory of Prometheus server data Persistent Volume to mount
+ ## Useful if the volume's root directory is not empty
+ ##
+ subPath: ""
+
+ ## Persistent Volume Claim Selector
+ ## Useful if Persistent Volumes have been provisioned in advance
+ ## Ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector
+ ##
+ # selector:
+ # matchLabels:
+ # release: "stable"
+ # matchExpressions:
+ # - { key: environment, operator: In, values: [ dev ] }
+
+ emptyDir:
+ ## Prometheus server emptyDir volume size limit
+ ##
+ sizeLimit: ""
+
+ ## Annotations to be added to Prometheus server pods
+ ##
+ podAnnotations: {}
+ # iam.amazonaws.com/role: prometheus
+
+ ## Labels to be added to Prometheus server pods
+ ##
+ podLabels: {}
+
+ ## Prometheus AlertManager configuration
+ ##
+ alertmanagers: []
+
+ ## Specify if a Pod Security Policy for node-exporter must be created
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
+ ##
+ podSecurityPolicy:
+ annotations: {}
+ ## Specify pod annotations
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
+ ##
+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
+ # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
+ # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
+
+ ## Use a StatefulSet if replicaCount needs to be greater than 1 (see below)
+ ##
+ replicaCount: 1
+
+ ## Annotations to be added to deployment
+ ##
+ deploymentAnnotations: {}
+
+ statefulSet:
+ ## If true, use a statefulset instead of a deployment for pod management.
+ ## This allows to scale replicas to more than 1 pod
+ ##
+ enabled: false
+
+ annotations: {}
+ labels: {}
+ podManagementPolicy: OrderedReady
+
+ ## Alertmanager headless service to use for the statefulset
+ ##
+ headless:
+ annotations: {}
+ labels: {}
+ servicePort: 80
+ ## Enable gRPC port on service to allow auto discovery with thanos-querier
+ gRPC:
+ enabled: false
+ servicePort: 10901
+ # nodePort: 10901
+
+ ## Prometheus server readiness and liveness probe initial delay and timeout
+ ## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
+ ##
+ tcpSocketProbeEnabled: false
+ probeScheme: HTTP
+ readinessProbeInitialDelay: 30
+ readinessProbePeriodSeconds: 5
+ readinessProbeTimeout: 4
+ readinessProbeFailureThreshold: 3
+ readinessProbeSuccessThreshold: 1
+ livenessProbeInitialDelay: 30
+ livenessProbePeriodSeconds: 15
+ livenessProbeTimeout: 10
+ livenessProbeFailureThreshold: 3
+ livenessProbeSuccessThreshold: 1
+ startupProbe:
+ enabled: false
+ periodSeconds: 5
+ failureThreshold: 30
+ timeoutSeconds: 10
+
+ ## Prometheus server resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ # limits:
+ # cpu: 500m
+ # memory: 512Mi
+ # requests:
+ # cpu: 500m
+ # memory: 512Mi
+
+ # Required for use in managed kubernetes clusters (such as AWS EKS) with custom CNI (such as calico),
+ # because control-plane managed by AWS cannot communicate with pods' IP CIDR and admission webhooks are not working
+ ##
+ hostNetwork: false
+
+ # When hostNetwork is enabled, you probably want to set this to ClusterFirstWithHostNet
+ dnsPolicy: ClusterFirst
+
+ # Use hostPort
+ # hostPort: 9090
+
+ ## Vertical Pod Autoscaler config
+ ## Ref: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler
+ verticalAutoscaler:
+ ## If true a VPA object will be created for the controller (either StatefulSet or Deployemnt, based on above configs)
+ enabled: false
+ # updateMode: "Auto"
+ # containerPolicies:
+ # - containerName: 'prometheus-server'
+
+ # Custom DNS configuration to be added to prometheus server pods
+ dnsConfig: {}
+ # nameservers:
+ # - 1.2.3.4
+ # searches:
+ # - ns1.svc.cluster-domain.example
+ # - my.dns.search.suffix
+ # options:
+ # - name: ndots
+ # value: "2"
+ # - name: edns0
+ ## Security context to be added to server pods
+ ##
+ securityContext:
+ runAsUser: 65534
+ runAsNonRoot: true
+ runAsGroup: 65534
+ fsGroup: 65534
+
+ service:
+ annotations: {}
+ labels: {}
+ clusterIP: ""
+
+ ## List of IP addresses at which the Prometheus server service is available
+ ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
+ ##
+ externalIPs: []
+
+ loadBalancerIP: ""
+ loadBalancerSourceRanges: []
+ servicePort: 80
+ sessionAffinity: None
+ type: ClusterIP
+
+ ## Enable gRPC port on service to allow auto discovery with thanos-querier
+ gRPC:
+ enabled: false
+ servicePort: 10901
+ # nodePort: 10901
+
+ ## If using a statefulSet (statefulSet.enabled=true), configure the
+ ## service to connect to a specific replica to have a consistent view
+ ## of the data.
+ statefulsetReplica:
+ enabled: false
+ replica: 0
+
+ ## Prometheus server pod termination grace period
+ ##
+ terminationGracePeriodSeconds: 300
+
+ ## Prometheus data retention period (default if not specified is 15 days)
+ ##
+ retention: "15d"
+
+pushgateway:
+ ## If false, pushgateway will not be installed
+ ##
+ enabled: true
+
+ ## Use an alternate scheduler, e.g. "stork".
+ ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
+ ##
+ # schedulerName:
+
+ ## pushgateway container name
+ ##
+ name: pushgateway
+
+ ## pushgateway container image
+ ##
+ image:
+ repository: prom/pushgateway
+ tag: v1.4.2
+ pullPolicy: IfNotPresent
+
+ ## pushgateway priorityClassName
+ ##
+ priorityClassName: ""
+
+ ## Additional pushgateway container arguments
+ ##
+ ## for example: persistence.file: /data/pushgateway.data
+ extraArgs: {}
+
+ ## Additional InitContainers to initialize the pod
+ ##
+ extraInitContainers: []
+
+ ingress:
+ ## If true, pushgateway Ingress will be created
+ ##
+ enabled: false
+
+ # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
+ # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
+ # ingressClassName: nginx
+
+ ## pushgateway Ingress annotations
+ ##
+ annotations: {}
+ # kubernetes.io/ingress.class: nginx
+ # kubernetes.io/tls-acme: 'true'
+
+ ## pushgateway Ingress hostnames with optional path
+ ## Must be provided if Ingress is enabled
+ ##
+ hosts: []
+ # - pushgateway.domain.com
+ # - domain.com/pushgateway
+
+ path: /
+
+ # pathType is only for k8s >= 1.18
+ pathType: Prefix
+
+ ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services.
+ extraPaths: []
+ # - path: /*
+ # backend:
+ # serviceName: ssl-redirect
+ # servicePort: use-annotation
+
+ ## pushgateway Ingress TLS configuration
+ ## Secrets must be manually created in the namespace
+ ##
+ tls: []
+ # - secretName: prometheus-alerts-tls
+ # hosts:
+ # - pushgateway.domain.com
+
+ ## Node tolerations for pushgateway scheduling to nodes with taints
+ ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+ ##
+ tolerations: []
+ # - key: "key"
+ # operator: "Equal|Exists"
+ # value: "value"
+ # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
+
+ ## Node labels for pushgateway pod assignment
+ ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
+ ##
+ nodeSelector: {}
+
+ ## Annotations to be added to pushgateway pods
+ ##
+ podAnnotations: {}
+
+ ## Labels to be added to pushgateway pods
+ ##
+ podLabels: {}
+
+ ## Specify if a Pod Security Policy for node-exporter must be created
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
+ ##
+ podSecurityPolicy:
+ annotations: {}
+ ## Specify pod annotations
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
+ ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
+ ##
+ # seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
+ # seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
+ # apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
+
+ replicaCount: 1
+
+ ## Annotations to be added to deployment
+ ##
+ deploymentAnnotations: {}
+
+ ## PodDisruptionBudget settings
+ ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
+ ##
+ podDisruptionBudget:
+ enabled: false
+ maxUnavailable: 1
+
+ ## pushgateway resource requests and limits
+ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
+ ##
+ resources: {}
+ # limits:
+ # cpu: 10m
+ # memory: 32Mi
+ # requests:
+ # cpu: 10m
+ # memory: 32Mi
+
+ ## Vertical Pod Autoscaler config
+ ## Ref: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler
+ verticalAutoscaler:
+ ## If true a VPA object will be created for the controller
+ enabled: false
+ # updateMode: "Auto"
+ # containerPolicies:
+ # - containerName: 'prometheus-pushgateway'
+
+ # Custom DNS configuration to be added to push-gateway pods
+ dnsConfig: {}
+ # nameservers:
+ # - 1.2.3.4
+ # searches:
+ # - ns1.svc.cluster-domain.example
+ # - my.dns.search.suffix
+ # options:
+ # - name: ndots
+ # value: "2"
+ # - name: edns0
+
+ ## Security context to be added to push-gateway pods
+ ##
+ securityContext:
+ runAsUser: 65534
+ runAsNonRoot: true
+
+ service:
+ annotations:
+ prometheus.io/probe: pushgateway
+ labels: {}
+ clusterIP: ""
+
+ ## List of IP addresses at which the pushgateway service is available
+ ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
+ ##
+ externalIPs: []
+
+ loadBalancerIP: ""
+ loadBalancerSourceRanges: []
+ servicePort: 9091
+ type: ClusterIP
+
+ ## pushgateway Deployment Strategy type
+ # strategy:
+ # type: Recreate
+
+ persistentVolume:
+ ## If true, pushgateway will create/use a Persistent Volume Claim
+ ##
+ enabled: false
+
+ ## pushgateway data Persistent Volume access modes
+ ## Must match those of existing PV or dynamic provisioner
+ ## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
+ ##
+ accessModes:
+ - ReadWriteOnce
+
+ ## pushgateway data Persistent Volume Claim annotations
+ ##
+ annotations: {}
+
+ ## pushgateway data Persistent Volume existing claim name
+ ## Requires pushgateway.persistentVolume.enabled: true
+ ## If defined, PVC must be created manually before volume will be bound
+ existingClaim: ""
+
+ ## pushgateway data Persistent Volume mount root path
+ ##
+ mountPath: /data
+
+ ## pushgateway data Persistent Volume size
+ ##
+ size: 2Gi
+
+ ## pushgateway data Persistent Volume Storage Class
+ ## If defined, storageClassName: <storageClass>
+ ## If set to "-", storageClassName: "", which disables dynamic provisioning
+ ## If undefined (the default) or set to null, no storageClassName spec is
+ ## set, choosing the default provisioner. (gp2 on AWS, standard on
+ ## GKE, AWS & OpenStack)
+ ##
+ # storageClass: "-"
+
+ ## pushgateway data Persistent Volume Binding Mode
+ ## If defined, volumeBindingMode: <volumeBindingMode>
+ ## If undefined (the default) or set to null, no volumeBindingMode spec is
+ ## set, choosing the default mode.
+ ##
+ # volumeBindingMode: ""
+
+ ## Subdirectory of pushgateway data Persistent Volume to mount
+ ## Useful if the volume's root directory is not empty
+ ##
+ subPath: ""
+
+
+## alertmanager ConfigMap entries
+##
+alertmanagerFiles:
+ alertmanager.yml:
+ global: {}
+ # slack_api_url: ''
+
+ receivers:
+ - name: default-receiver
+ # slack_configs:
+ # - channel: '@you'
+ # send_resolved: true
+
+ route:
+ group_wait: 10s
+ group_interval: 5m
+ receiver: default-receiver
+ repeat_interval: 3h
+
+## Prometheus server ConfigMap entries for rule files (allow prometheus labels interpolation)
+ruleFiles: {}
+
+## Prometheus server ConfigMap entries
+##
+serverFiles:
+
+ ## Alerts configuration
+ ## Ref: https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
+ alerting_rules.yml: {}
+ # groups:
+ # - name: Instances
+ # rules:
+ # - alert: InstanceDown
+ # expr: up == 0
+ # for: 5m
+ # labels:
+ # severity: page
+ # annotations:
+ # description: '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.'
+ # summary: 'Instance {{ $labels.instance }} down'
+ ## DEPRECATED DEFAULT VALUE, unless explicitly naming your files, please use alerting_rules.yml
+ alerts: {}
+
+ ## Records configuration
+ ## Ref: https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/
+ recording_rules.yml: {}
+ ## DEPRECATED DEFAULT VALUE, unless explicitly naming your files, please use recording_rules.yml
+ rules: {}
+
+ prometheus.yml:
+ rule_files:
+ - /etc/config/recording_rules.yml
+ - /etc/config/alerting_rules.yml
+ ## Below two files are DEPRECATED will be removed from this default values file
+ - /etc/config/rules
+ - /etc/config/alerts
+
+ scrape_configs:
+ - job_name: prometheus
+ static_configs:
+ - targets:
+ - localhost:9090
+
+ # A scrape configuration for running Prometheus on a Kubernetes cluster.
+ # This uses separate scrape configs for cluster components (i.e. API server, node)
+ # and services to allow each to use different authentication configs.
+ #
+ # Kubernetes labels will be added as Prometheus labels on metrics via the
+ # `labelmap` relabeling action.
+
+ # Scrape config for API servers.
+ #
+ # Kubernetes exposes API servers as endpoints to the default/kubernetes
+ # service so this uses `endpoints` role and uses relabelling to only keep
+ # the endpoints associated with the default/kubernetes service using the
+ # default named port `https`. This works for single API server deployments as
+ # well as HA API server deployments.
+ - job_name: 'kubernetes-apiservers'
+
+ kubernetes_sd_configs:
+ - role: endpoints
+
+ # Default to scraping over https. If required, just disable this or change to
+ # `http`.
+ scheme: https
+
+ # This TLS & bearer token file config is used to connect to the actual scrape
+ # endpoints for cluster components. This is separate to discovery auth
+ # configuration because discovery & scraping are two separate concerns in
+ # Prometheus. The discovery auth config is automatic if Prometheus runs inside
+ # the cluster. Otherwise, more config options have to be provided within the
+ # <kubernetes_sd_config>.
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ # If your node certificates are self-signed or use a different CA to the
+ # master CA, then disable certificate verification below. Note that
+ # certificate verification is an integral part of a secure infrastructure
+ # so this should only be disabled in a controlled environment. You can
+ # disable certificate verification by uncommenting the line below.
+ #
+ insecure_skip_verify: true
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+
+ # Keep only the default/kubernetes service endpoints for the https port. This
+ # will add targets for each API server which Kubernetes adds an endpoint to
+ # the default/kubernetes service.
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
+ action: keep
+ regex: default;kubernetes;https
+
+ - job_name: 'kubernetes-nodes'
+
+ # Default to scraping over https. If required, just disable this or change to
+ # `http`.
+ scheme: https
+
+ # This TLS & bearer token file config is used to connect to the actual scrape
+ # endpoints for cluster components. This is separate to discovery auth
+ # configuration because discovery & scraping are two separate concerns in
+ # Prometheus. The discovery auth config is automatic if Prometheus runs inside
+ # the cluster. Otherwise, more config options have to be provided within the
+ # <kubernetes_sd_config>.
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ # If your node certificates are self-signed or use a different CA to the
+ # master CA, then disable certificate verification below. Note that
+ # certificate verification is an integral part of a secure infrastructure
+ # so this should only be disabled in a controlled environment. You can
+ # disable certificate verification by uncommenting the line below.
+ #
+ insecure_skip_verify: true
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+
+ kubernetes_sd_configs:
+ - role: node
+
+ relabel_configs:
+ - action: labelmap
+ regex: __meta_kubernetes_node_label_(.+)
+ - target_label: __address__
+ replacement: kubernetes.default.svc:443
+ - source_labels: [__meta_kubernetes_node_name]
+ regex: (.+)
+ target_label: __metrics_path__
+ replacement: /api/v1/nodes/$1/proxy/metrics
+
+
+ - job_name: 'kubernetes-nodes-cadvisor'
+
+ # Default to scraping over https. If required, just disable this or change to
+ # `http`.
+ scheme: https
+
+ # This TLS & bearer token file config is used to connect to the actual scrape
+ # endpoints for cluster components. This is separate to discovery auth
+ # configuration because discovery & scraping are two separate concerns in
+ # Prometheus. The discovery auth config is automatic if Prometheus runs inside
+ # the cluster. Otherwise, more config options have to be provided within the
+ # <kubernetes_sd_config>.
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ # If your node certificates are self-signed or use a different CA to the
+ # master CA, then disable certificate verification below. Note that
+ # certificate verification is an integral part of a secure infrastructure
+ # so this should only be disabled in a controlled environment. You can
+ # disable certificate verification by uncommenting the line below.
+ #
+ insecure_skip_verify: true
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+
+ kubernetes_sd_configs:
+ - role: node
+
+ # This configuration will work only on kubelet 1.7.3+
+ # As the scrape endpoints for cAdvisor have changed
+ # if you are using older version you need to change the replacement to
+ # replacement: /api/v1/nodes/$1:4194/proxy/metrics
+ # more info here https://github.com/coreos/prometheus-operator/issues/633
+ relabel_configs:
+ - action: labelmap
+ regex: __meta_kubernetes_node_label_(.+)
+ - target_label: __address__
+ replacement: kubernetes.default.svc:443
+ - source_labels: [__meta_kubernetes_node_name]
+ regex: (.+)
+ target_label: __metrics_path__
+ replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
+
+ # Scrape config for service endpoints.
+ #
+ # The relabeling allows the actual service scrape endpoint to be configured
+ # via the following annotations:
+ #
+ # * `prometheus.io/scrape`: Only scrape services that have a value of
+ # `true`, except if `prometheus.io/scrape-slow` is set to `true` as well.
+ # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
+ # to set this to `https` & most likely set the `tls_config` of the scrape config.
+ # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
+ # * `prometheus.io/port`: If the metrics are exposed on a different port to the
+ # service then set this appropriately.
+ # * `prometheus.io/param_<parameter>`: If the metrics endpoint uses parameters
+ # then you can set any parameter
+ - job_name: 'kubernetes-service-endpoints'
+
+ kubernetes_sd_configs:
+ - role: endpoints
+
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
+ action: keep
+ regex: true
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape_slow]
+ action: drop
+ regex: true
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
+ action: replace
+ target_label: __scheme__
+ regex: (https?)
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
+ action: replace
+ target_label: __metrics_path__
+ regex: (.+)
+ - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
+ action: replace
+ target_label: __address__
+ regex: ([^:]+)(?::\d+)?;(\d+)
+ replacement: $1:$2
+ - action: labelmap
+ regex: __meta_kubernetes_service_annotation_prometheus_io_param_(.+)
+ replacement: __param_$1
+ - action: labelmap
+ regex: __meta_kubernetes_service_label_(.+)
+ - source_labels: [__meta_kubernetes_namespace]
+ action: replace
+ target_label: namespace
+ - source_labels: [__meta_kubernetes_service_name]
+ action: replace
+ target_label: service
+ - source_labels: [__meta_kubernetes_pod_node_name]
+ action: replace
+ target_label: node
+
+ # Scrape config for slow service endpoints; same as above, but with a larger
+ # timeout and a larger interval
+ #
+ # The relabeling allows the actual service scrape endpoint to be configured
+ # via the following annotations:
+ #
+ # * `prometheus.io/scrape-slow`: Only scrape services that have a value of `true`
+ # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
+ # to set this to `https` & most likely set the `tls_config` of the scrape config.
+ # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
+ # * `prometheus.io/port`: If the metrics are exposed on a different port to the
+ # service then set this appropriately.
+ # * `prometheus.io/param_<parameter>`: If the metrics endpoint uses parameters
+ # then you can set any parameter
+ - job_name: 'kubernetes-service-endpoints-slow'
+
+ scrape_interval: 5m
+ scrape_timeout: 30s
+
+ kubernetes_sd_configs:
+ - role: endpoints
+
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape_slow]
+ action: keep
+ regex: true
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
+ action: replace
+ target_label: __scheme__
+ regex: (https?)
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
+ action: replace
+ target_label: __metrics_path__
+ regex: (.+)
+ - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
+ action: replace
+ target_label: __address__
+ regex: ([^:]+)(?::\d+)?;(\d+)
+ replacement: $1:$2
+ - action: labelmap
+ regex: __meta_kubernetes_service_annotation_prometheus_io_param_(.+)
+ replacement: __param_$1
+ - action: labelmap
+ regex: __meta_kubernetes_service_label_(.+)
+ - source_labels: [__meta_kubernetes_namespace]
+ action: replace
+ target_label: namespace
+ - source_labels: [__meta_kubernetes_service_name]
+ action: replace
+ target_label: service
+ - source_labels: [__meta_kubernetes_pod_node_name]
+ action: replace
+ target_label: node
+
+ - job_name: 'prometheus-pushgateway'
+ honor_labels: true
+
+ kubernetes_sd_configs:
+ - role: service
+
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe]
+ action: keep
+ regex: pushgateway
+
+ # Example scrape config for probing services via the Blackbox Exporter.
+ #
+ # The relabeling allows the actual service scrape endpoint to be configured
+ # via the following annotations:
+ #
+ # * `prometheus.io/probe`: Only probe services that have a value of `true`
+ - job_name: 'kubernetes-services'
+
+ metrics_path: /probe
+ params:
+ module: [http_2xx]
+
+ kubernetes_sd_configs:
+ - role: service
+
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe]
+ action: keep
+ regex: true
+ - source_labels: [__address__]
+ target_label: __param_target
+ - target_label: __address__
+ replacement: blackbox
+ - source_labels: [__param_target]
+ target_label: instance
+ - action: labelmap
+ regex: __meta_kubernetes_service_label_(.+)
+ - source_labels: [__meta_kubernetes_namespace]
+ target_label: namespace
+ - source_labels: [__meta_kubernetes_service_name]
+ target_label: service
+
+ # Example scrape config for pods
+ #
+ # The relabeling allows the actual pod scrape endpoint to be configured via the
+ # following annotations:
+ #
+ # * `prometheus.io/scrape`: Only scrape pods that have a value of `true`,
+ # except if `prometheus.io/scrape-slow` is set to `true` as well.
+ # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
+ # to set this to `https` & most likely set the `tls_config` of the scrape config.
+ # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
+ # * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
+ - job_name: 'kubernetes-pods'
+
+ kubernetes_sd_configs:
+ - role: pod
+
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
+ action: keep
+ regex: true
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape_slow]
+ action: drop
+ regex: true
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
+ action: replace
+ regex: (https?)
+ target_label: __scheme__
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
+ action: replace
+ target_label: __metrics_path__
+ regex: (.+)
+ - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
+ action: replace
+ regex: ([^:]+)(?::\d+)?;(\d+)
+ replacement: $1:$2
+ target_label: __address__
+ - action: labelmap
+ regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
+ replacement: __param_$1
+ - action: labelmap
+ regex: __meta_kubernetes_pod_label_(.+)
+ - source_labels: [__meta_kubernetes_namespace]
+ action: replace
+ target_label: namespace
+ - source_labels: [__meta_kubernetes_pod_name]
+ action: replace
+ target_label: pod
+ - source_labels: [__meta_kubernetes_pod_phase]
+ regex: Pending|Succeeded|Failed|Completed
+ action: drop
+
+ # Example Scrape config for pods which should be scraped slower. An useful example
+ # would be stackriver-exporter which queries an API on every scrape of the pod
+ #
+ # The relabeling allows the actual pod scrape endpoint to be configured via the
+ # following annotations:
+ #
+ # * `prometheus.io/scrape-slow`: Only scrape pods that have a value of `true`
+ # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
+ # to set this to `https` & most likely set the `tls_config` of the scrape config.
+ # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
+ # * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
+ - job_name: 'kubernetes-pods-slow'
+
+ scrape_interval: 5m
+ scrape_timeout: 30s
+
+ kubernetes_sd_configs:
+ - role: pod
+
+ relabel_configs:
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape_slow]
+ action: keep
+ regex: true
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
+ action: replace
+ regex: (https?)
+ target_label: __scheme__
+ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
+ action: replace
+ target_label: __metrics_path__
+ regex: (.+)
+ - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
+ action: replace
+ regex: ([^:]+)(?::\d+)?;(\d+)
+ replacement: $1:$2
+ target_label: __address__
+ - action: labelmap
+ regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
+ replacement: __param_$1
+ - action: labelmap
+ regex: __meta_kubernetes_pod_label_(.+)
+ - source_labels: [__meta_kubernetes_namespace]
+ action: replace
+ target_label: namespace
+ - source_labels: [__meta_kubernetes_pod_name]
+ action: replace
+ target_label: pod
+ - source_labels: [__meta_kubernetes_pod_phase]
+ regex: Pending|Succeeded|Failed|Completed
+ action: drop
+
+# adds additional scrape configs to prometheus.yml
+# must be a string so you have to add a | after extraScrapeConfigs:
+# example adds prometheus-blackbox-exporter scrape config
+extraScrapeConfigs:
+# - job_name: 'prometheus-blackbox-exporter'
+# metrics_path: /probe
+# params:
+# module: [http_2xx]
+# static_configs:
+# - targets:
+# - https://example.com
+# relabel_configs:
+# - source_labels: [__address__]
+# target_label: __param_target
+# - source_labels: [__param_target]
+# target_label: instance
+# - target_label: __address__
+# replacement: prometheus-blackbox-exporter:9115
+
+# Adds option to add alert_relabel_configs to avoid duplicate alerts in alertmanager
+# useful in H/A prometheus with different external labels but the same alerts
+alertRelabelConfigs:
+# alert_relabel_configs:
+# - source_labels: [dc]
+# regex: (.+)\d+
+# target_label: dc
+
+networkPolicy:
+ ## Enable creation of NetworkPolicy resources.
+ ##
+ enabled: false
+
+# Force namespace of namespaced resources
+forceNamespace: null
diff --git a/deploy/charts/admin-stack/charts/zookeeper/templates/NOTES.txt b/deploy/charts/admin-stack/charts/zookeeper/templates/NOTES.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/deploy/charts/admin-stack/charts/zookeeper/templates/_helpers.tpl b/deploy/charts/admin-stack/charts/zookeeper/templates/_helpers.tpl
deleted file mode 100644
index 210ffd34..00000000
--- a/deploy/charts/admin-stack/charts/zookeeper/templates/_helpers.tpl
+++ /dev/null
@@ -1,62 +0,0 @@
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "zookeeper.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-
-
-{{/* vim: set filetype=mustache: */}}
-{{/*
-Expand the name of the chart.
-*/}}
-{{- define "zookeeper.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 "zookeeper.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 -}}
-
-
-{{/*
-Return ZooKeeper Namespace to use
-*/}}
-{{- define "zookeeper.namespace" -}}
-{{- if .Values.namespaceOverride -}}
- {{- .Values.namespaceOverride -}}
-{{- else -}}
- {{- .Release.Namespace -}}
-{{- end -}}
-{{- end -}}
-
-{{- define "zookeeper.labels" -}}
-app.kubernetes.io/name: {{ include "zookeeper.name" . }}
-helm.sh/chart: {{ include "zookeeper.chart" . }}
-app.kubernetes.io/instance: {{ .Release.Name }}
-app.kubernetes.io/managed-by: {{ .Release.Service }}
-{{- end -}}
-
-
-
-{{/*
-Labels to use on sts.spec.selector.matchLabels and svc.spec.selector
-*/}}
-{{- define "zookeeper.matchLabels" -}}
-app.kubernetes.io/name: {{ include "zookeeper.name" . }}
-{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/dubbo-admin/templates/_helpers.tpl b/deploy/charts/admin-stack/templates/apps/_admin.tpl
similarity index 52%
rename from deploy/charts/admin-stack/charts/dubbo-admin/templates/_helpers.tpl
rename to deploy/charts/admin-stack/templates/apps/_admin.tpl
index b7ea4c9e..4d020687 100644
--- a/deploy/charts/admin-stack/charts/dubbo-admin/templates/_helpers.tpl
+++ b/deploy/charts/admin-stack/templates/apps/_admin.tpl
@@ -5,7 +5,6 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
-
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
@@ -51,7 +50,6 @@ Allow the release namespace to be overridden for multi-namespace deployments in
{{- end }}
{{- end }}
-
{{/*
Labels to use on sts.spec.selector.matchLabels and svc.spec.selector
*/}}
@@ -59,13 +57,11 @@ Labels to use on sts.spec.selector.matchLabels and svc.spec.selector
app.kubernetes.io/name: {{ include "dubbo-admin.name" . }}
{{- end -}}
-
{{- define "dubbo-admin.selectorLabels" -}}
app.kubernetes.io/name: {{ include "dubbo-admin.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
-
{{/*
Create the name of the service account to use
*/}}
@@ -77,11 +73,81 @@ Create the name of the service account to use
{{- end }}
{{- end }}
-
{{- define "dubbo-admin.serviceAccountNameTest" -}}
{{- if .Values.serviceAccount.enabled }}
{{- default (print (include "dubbo-admin.fullname" .) "-test") .Values.serviceAccount.nameTest }}
{{- else }}
{{- default "default" .Values.serviceAccount.nameTest }}
{{- end }}
-{{- end }}
\ No newline at end of file
+{{- end }}
+
+{{/*
+Formats imagePullSecrets. Input is (dict "root" . "imagePullSecrets" .{specific imagePullSecrets})
+*/}}
+{{- define "dubbo-admin.imagePullSecrets" -}}
+{{- $root := .root }}
+{{- range (concat .root.Values.global.imagePullSecrets .imagePullSecrets) }}
+{{- if eq (typeOf .) "map[string]interface {}" }}
+- {{ toYaml (dict "name" (tpl .name $root)) | trim }}
+{{- else }}
+- name: {{ tpl . $root }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Return if ingress is stable.
+*/}}
+{{- define "dubbo-admin.ingress.isStable" -}}
+{{- eq (include "dubbo-admin.ingress.apiVersion" .) "networking.k8s.io/v1" }}
+{{- end }}
+
+{{/*
+Return if ingress supports ingressClassName.
+*/}}
+{{- define "dubbo-admin.ingress.supportsIngressClassName" -}}
+{{- or (eq (include "dubbo-admin.ingress.isStable" .) "true") (and (eq (include "dubbo-admin.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
+{{- end }}
+
+{{/*
+Return if ingress supports pathType.
+*/}}
+{{- define "dubbo-admin.ingress.supportsPathType" -}}
+{{- or (eq (include "dubbo-admin.ingress.isStable" .) "true") (and (eq (include "dubbo-admin.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
+{{- end }}
+
+{{/*
+Return the appropriate apiVersion for rbac.
+*/}}
+{{- define "dubbo-admin.rbac.apiVersion" -}}
+{{- if $.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
+{{- print "rbac.authorization.k8s.io/v1" }}
+{{- else }}
+{{- print "rbac.authorization.k8s.io/v1beta1" }}
+{{- end }}
+{{- end }}
+
+{{/*
+Return the appropriate apiVersion for ingress.
+*/}}
+{{- define "dubbo-admin.ingress.apiVersion" -}}
+{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }}
+{{- print "networking.k8s.io/v1" }}
+{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
+{{- print "networking.k8s.io/v1beta1" }}
+{{- else }}
+{{- print "extensions/v1beta1" }}
+{{- end }}
+{{- end }}
+
+{{/*
+Return the appropriate apiVersion for podDisruptionBudget.
+*/}}
+{{- define "dubbo-admin.podDisruptionBudget.apiVersion" -}}
+{{- if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
+{{- print "policy/v1" }}
+{{- else }}
+{{- print "policy/v1beta1" }}
+{{- end }}
+{{- end }}
+
diff --git a/deploy/charts/admin-stack/charts/grafana/templates/_pod.tpl b/deploy/charts/admin-stack/templates/apps/_grafana.tpl
similarity index 87%
rename from deploy/charts/admin-stack/charts/grafana/templates/_pod.tpl
rename to deploy/charts/admin-stack/templates/apps/_grafana.tpl
index 4c4755dc..bc934114 100644
--- a/deploy/charts/admin-stack/charts/grafana/templates/_pod.tpl
+++ b/deploy/charts/admin-stack/templates/apps/_grafana.tpl
@@ -1,3 +1,215 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "grafana.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 "grafana.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 "grafana.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create the name of the service account
+*/}}
+{{- define "grafana.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (include "grafana.fullname" .) .Values.serviceAccount.name }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.name }}
+{{- end }}
+{{- end }}
+
+{{- define "grafana.serviceAccountNameTest" -}}
+{{- if .Values.serviceAccount.create }}
+{{- default (print (include "grafana.fullname" .) "-test") .Values.serviceAccount.nameTest }}
+{{- else }}
+{{- default "default" .Values.serviceAccount.nameTest }}
+{{- end }}
+{{- end }}
+
+{{/*
+Allow the release namespace to be overridden for multi-namespace deployments in combined charts
+*/}}
+{{- define "grafana.namespace" -}}
+{{- if .Values.namespaceOverride }}
+{{- .Values.namespaceOverride }}
+{{- else }}
+{{- .Release.Namespace }}
+{{- end }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "grafana.labels" -}}
+helm.sh/chart: {{ include "grafana.chart" . }}
+{{ include "grafana.selectorLabels" . }}
+{{- if or .Chart.AppVersion .Values.image.tag }}
+app.kubernetes.io/version: {{ mustRegexReplaceAllLiteral "@sha.*" .Values.image.tag "" | default .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- with .Values.extraLabels }}
+{{ toYaml . }}
+{{- end }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "grafana.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "grafana.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "grafana.imageRenderer.labels" -}}
+helm.sh/chart: {{ include "grafana.chart" . }}
+{{ include "grafana.imageRenderer.selectorLabels" . }}
+{{- if or .Chart.AppVersion .Values.image.tag }}
+app.kubernetes.io/version: {{ mustRegexReplaceAllLiteral "@sha.*" .Values.image.tag "" | default .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+
+{{/*
+Selector labels ImageRenderer
+*/}}
+{{- define "grafana.imageRenderer.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "grafana.name" . }}-image-renderer
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+
+{{/*
+Looks if there's an existing secret and reuse its password. If not it generates
+new password and use it.
+*/}}
+{{- define "grafana.password" -}}
+{{- $secret := (lookup "v1" "Secret" (include "grafana.namespace" .) (include "grafana.fullname" .) ) }}
+{{- if $secret }}
+{{- index $secret "data" "admin-password" }}
+{{- else }}
+{{- (randAlphaNum 40) | b64enc | quote }}
+{{- end }}
+{{- end }}
+
+
+{{/*
+Return the appropriate apiVersion for rbac.
+*/}}
+{{- define "grafana.rbac.apiVersion" -}}
+{{- if $.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
+{{- print "rbac.authorization.k8s.io/v1" }}
+{{- else }}
+{{- print "rbac.authorization.k8s.io/v1beta1" }}
+{{- end }}
+{{- end }}
+
+
+{{/*
+Return the appropriate apiVersion for ingress.
+*/}}
+{{- define "grafana.ingress.apiVersion" -}}
+{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }}
+{{- print "networking.k8s.io/v1" }}
+{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
+{{- print "networking.k8s.io/v1beta1" }}
+{{- else }}
+{{- print "extensions/v1beta1" }}
+{{- end }}
+{{- end }}
+
+
+{{/*
+Return the appropriate apiVersion for Horizontal Pod Autoscaler.
+*/}}
+{{- define "grafana.hpa.apiVersion" -}}
+{{- if $.Capabilities.APIVersions.Has "autoscaling/v2/HorizontalPodAutoscaler" }}
+{{- print "autoscaling/v2" }}
+{{- else if $.Capabilities.APIVersions.Has "autoscaling/v2beta2/HorizontalPodAutoscaler" }}
+{{- print "autoscaling/v2beta2" }}
+{{- else }}
+{{- print "autoscaling/v2beta1" }}
+{{- end }}
+{{- end }}
+
+
+{{/*
+Return the appropriate apiVersion for podDisruptionBudget.
+*/}}
+{{- define "grafana.podDisruptionBudget.apiVersion" -}}
+{{- if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
+{{- print "policy/v1" }}
+{{- else }}
+{{- print "policy/v1beta1" }}
+{{- end }}
+{{- end }}
+
+
+{{/*
+Return if ingress is stable.
+*/}}
+{{- define "grafana.ingress.isStable" -}}
+{{- eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1" }}
+{{- end }}
+
+
+{{/*
+Return if ingress supports ingressClassName.
+*/}}
+{{- define "grafana.ingress.supportsIngressClassName" -}}
+{{- or (eq (include "grafana.ingress.isStable" .) "true") (and (eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
+{{- end }}
+
+
+{{/*
+Return if ingress supports pathType.
+*/}}
+{{- define "grafana.ingress.supportsPathType" -}}
+{{- or (eq (include "grafana.ingress.isStable" .) "true") (and (eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
+{{- end }}
+
+
+{{/*
+Formats imagePullSecrets. Input is (dict "root" . "imagePullSecrets" .{specific imagePullSecrets})
+*/}}
+{{- define "grafana.imagePullSecrets" -}}
+{{- $root := .root }}
+{{- range (concat .root.Values.global.imagePullSecrets .imagePullSecrets) }}
+{{- if eq (typeOf .) "map[string]interface {}" }}
+- {{ toYaml (dict "name" (tpl .name $root)) | trim }}
+{{- else }}
+- name: {{ tpl . $root }}
+{{- end }}
+{{- end }}
+{{- end }}
+
{{- define "grafana.pod" -}}
{{- $sts := list "sts" "StatefulSet" "statefulset" -}}
{{- $root := . -}}
@@ -1150,4 +1362,4 @@ volumes:
{{- with .Values.extraContainerVolumes }}
{{- tpl (toYaml .) $root | nindent 2 }}
{{- end }}
-{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/apps/_kube-state-metrics.tpl b/deploy/charts/admin-stack/templates/apps/_kube-state-metrics.tpl
new file mode 100644
index 00000000..1ecb303b
--- /dev/null
+++ b/deploy/charts/admin-stack/templates/apps/_kube-state-metrics.tpl
@@ -0,0 +1,10 @@
+{{/*
+Create the name of the service account to use
+*/}}
+{{- define "kube-state-metrics.serviceAccountName" -}}
+{{- if .Values.serviceAccount.create -}}
+ {{ default (include "kube-state-metrics.fullname" .) .Values.serviceAccount.name }}
+{{- else -}}
+ {{ default "default" .Values.serviceAccount.name }}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/charts/nacos/templates/_helpers.tpl b/deploy/charts/admin-stack/templates/apps/_nacos.tpl
similarity index 61%
rename from deploy/charts/admin-stack/charts/nacos/templates/_helpers.tpl
rename to deploy/charts/admin-stack/templates/apps/_nacos.tpl
index fd703f0a..d520feb7 100644
--- a/deploy/charts/admin-stack/charts/nacos/templates/_helpers.tpl
+++ b/deploy/charts/admin-stack/templates/apps/_nacos.tpl
@@ -58,4 +58,44 @@ Labels to use on sts.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "nacos.matchLabels" -}}
app.kubernetes.io/name: {{ include "nacos.name" . }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for networkpolicy.
+*/}}
+{{- define "nacos.networkPolicy.apiVersion" -}}
+{{- if semverCompare "<1.7-0" (include "nacos.kubeVersion" .) -}}
+{{- print "extensions/v1beta1" -}}
+{{- else -}}
+{{- print "networking.k8s.io/v1" -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for poddisruptionbudget.
+*/}}
+{{- define "nacos.policy.apiVersion" -}}
+{{- if semverCompare "<1.21-0" (include "nacos.kubeVersion" .) -}}
+{{- print "policy/v1beta1" -}}
+{{- else -}}
+{{- print "policy/v1" -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Return the target Kubernetes version
+*/}}
+{{- define "nacos.kubeVersion" -}}
+{{- if .Values.global }}
+ {{- if .Values.global.kubeVersion }}
+ {{- .Values.global.kubeVersion -}}
+ {{- else }}
+ {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
+ {{- end -}}
+{{- else }}
+{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
+{{- end -}}
+{{- end -}}
+{{/*
+Return the appropriate apiVersion for statefulset.
+*/}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/apps/_node-exporter.tpl b/deploy/charts/admin-stack/templates/apps/_node-exporter.tpl
new file mode 100644
index 00000000..f55b21a7
--- /dev/null
+++ b/deploy/charts/admin-stack/templates/apps/_node-exporter.tpl
@@ -0,0 +1,43 @@
+{{/*
+Common labels
+*/}}
+{{- define "prometheus-node-exporter.labels" -}}
+helm.sh/chart: {{ include "prometheus-node-exporter.chart" . }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+app.kubernetes.io/component: metrics
+app.kubernetes.io/part-of: {{ include "prometheus-node-exporter.name" . }}
+{{ include "prometheus-node-exporter.selectorLabels" . }}
+{{- with .Chart.AppVersion }}
+app.kubernetes.io/version: {{ . | quote }}
+{{- end }}
+{{- with .Values.podLabels }}
+{{ toYaml . }}
+{{- end }}
+{{- if .Values.releaseLabel }}
+release: {{ .Release.Name }}
+{{- end }}
+{{- end }}
+
+{{- define "prometheus.nodeExporter.labels" -}}
+{{ include "prometheus.nodeExporter.matchLabels" . }}
+{{ include "prometheus.common.metaLabels" . }}
+{{- end -}}
+
+{{/* Sets default scrape limits for servicemonitor */}}
+{{- define "servicemonitor.scrapeLimits" -}}
+{{- with .sampleLimit }}
+sampleLimit: {{ . }}
+{{- end }}
+{{- with .targetLimit }}
+targetLimit: {{ . }}
+{{- end }}
+{{- with .labelLimit }}
+labelLimit: {{ . }}
+{{- end }}
+{{- with .labelNameLengthLimit }}
+labelNameLengthLimit: {{ . }}
+{{- end }}
+{{- with .labelValueLengthLimit }}
+labelValueLengthLimit: {{ . }}
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/templates/apps/_prometheus.tpl b/deploy/charts/admin-stack/templates/apps/_prometheus.tpl
new file mode 100644
index 00000000..df826519
--- /dev/null
+++ b/deploy/charts/admin-stack/templates/apps/_prometheus.tpl
@@ -0,0 +1,122 @@
+{{/*
+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).
+*/}}
+{{- define "prometheus.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 -}}
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "prometheus.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "prometheus.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+
+{{- define "prometheus.server.labels" -}}
+{{ include "prometheus.server.matchLabels" . }}
+{{ include "prometheus.common.metaLabels" . }}
+{{- end -}}
+
+{{- define "prometheus.server.matchLabels" -}}
+component: {{ .Values.server.name | quote }}
+{{ include "prometheus.common.matchLabels" . }}
+{{- end -}}
+
+{{/*
+Create unified labels for prometheus components
+*/}}
+{{- define "prometheus.common.matchLabels" -}}
+app: {{ template "prometheus.name" . }}
+release: {{ .Release.Name }}
+{{- end -}}
+
+{{- define "prometheus.common.metaLabels" -}}
+chart: {{ template "prometheus.chart" . }}
+heritage: {{ .Release.Service }}
+{{- end -}}
+
+{{/*
+Define the prometheus.namespace template if set with forceNamespace or .Release.Namespace is set
+*/}}
+{{- define "prometheus.namespace" -}}
+{{- if .Values.forceNamespace -}}
+{{ printf "namespace: %s" .Values.forceNamespace }}
+{{- else -}}
+{{ printf "namespace: %s" .Release.Namespace }}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create a fully qualified Prometheus server name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+*/}}
+{{- define "prometheus.server.fullname" -}}
+{{- if .Values.server.fullnameOverride -}}
+{{- .Values.server.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- if contains $name .Release.Name -}}
+{{- printf "%s-%s" .Release.Name .Values.server.name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s-%s" .Release.Name $name .Values.server.name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create the name of the service account to use for the server component
+*/}}
+{{- define "prometheus.serviceAccountName.server" -}}
+{{- if .Values.serviceAccounts.server.create -}}
+ {{ default (include "prometheus.server.fullname" .) .Values.serviceAccounts.server.name }}
+{{- else -}}
+ {{ default "default" .Values.serviceAccounts.server.name }}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Get KubeVersion removing pre-release information.
+*/}}
+{{- define "prometheus.kubeVersion" -}}
+ {{- default .Capabilities.KubeVersion.Version (regexFind "v[0-9]+\\.[0-9]+\\.[0-9]+" .Capabilities.KubeVersion.Version) -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for daemonset.
+*/}}
+{{- define "prometheus.daemonset.apiVersion" -}}
+{{- print "apps/v1" -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for networkpolicy.
+*/}}
+{{- define "prometheus.networkPolicy.apiVersion" -}}
+{{- print "networking.k8s.io/v1" -}}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for podsecuritypolicy.
+*/}}
+{{- define "prometheus.podSecurityPolicy.apiVersion" -}}
+{{- print "policy/v1beta1" -}}
+{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/apps/_pushgateway.tpl b/deploy/charts/admin-stack/templates/apps/_pushgateway.tpl
new file mode 100644
index 00000000..b31ed217
--- /dev/null
+++ b/deploy/charts/admin-stack/templates/apps/_pushgateway.tpl
@@ -0,0 +1,39 @@
+{{- define "prometheus.pushgateway.labels" -}}
+{{ include "prometheus.pushgateway.matchLabels" . }}
+{{ include "prometheus.common.metaLabels" . }}
+{{- end -}}
+
+{{/*
+Return the appropriate apiVersion for networkpolicy.
+*/}}
+{{- define "prometheus-pushgateway.networkPolicy.apiVersion" -}}
+{{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.GitVersion }}
+{{- print "extensions/v1beta1" }}
+{{- else if semverCompare "^1.7-0" .Capabilities.KubeVersion.GitVersion }}
+{{- print "networking.k8s.io/v1" }}
+{{- end }}
+{{- end }}
+
+{{/*
+Define PDB apiVersion
+*/}}
+{{- define "prometheus-pushgateway.pdb.apiVersion" -}}
+{{- if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
+{{- print "policy/v1" }}
+{{- else }}
+{{- print "policy/v1beta" }}
+{{- end }}
+{{- end }}
+
+{{/*
+Define Ingress apiVersion
+*/}}
+{{- define "prometheus-pushgateway.ingress.apiVersion" -}}
+{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
+{{- print "networking.k8s.io/v1" }}
+{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
+{{- print "networking.k8s.io/v1beta1" }}
+{{- else }}
+{{- print "extensions/v1beta1" }}
+{{- end }}
+{{- end }}
diff --git a/deploy/charts/admin-stack/templates/apps/_zookeeper.tpl b/deploy/charts/admin-stack/templates/apps/_zookeeper.tpl
new file mode 100644
index 00000000..36b2d789
--- /dev/null
+++ b/deploy/charts/admin-stack/templates/apps/_zookeeper.tpl
@@ -0,0 +1,85 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Return the proper Storage Class
+{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
+*/}}
+{{- define "zookeeper.storage.class" -}}
+
+{{- $storageClass := .persistence.storageClass -}}
+{{- if .global -}}
+ {{- if .global.storageClass -}}
+ {{- $storageClass = .global.storageClass -}}
+ {{- end -}}
+{{- end -}}
+
+{{- if $storageClass -}}
+ {{- if (eq "-" $storageClass) -}}
+ {{- printf "storageClassName: \"\"" -}}
+ {{- else }}
+ {{- printf "storageClassName: %s" $storageClass -}}
+ {{- end -}}
+{{- end -}}
+
+{{- end -}}
+
+{{/*
+Return the target Kubernetes version
+*/}}
+{{- define "zookeeper.kubeVersion" -}}
+{{- if .Values.global }}
+ {{- if .Values.global.kubeVersion }}
+ {{- .Values.global.kubeVersion -}}
+ {{- else }}
+ {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
+ {{- end -}}
+{{- else }}
+{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
+{{- end -}}
+{{- end -}}
+
+{{- define "zookeeper.statefulset.apiVersion" -}}
+{{- if semverCompare "<1.14-0" (include "zookeeper.kubeVersion" .) -}}
+{{- print "apps/v1beta1" -}}
+{{- else -}}
+{{- print "apps/v1" -}}
+{{- end -}}
+{{- end -}}
+
+
+{{/*
+Return the appropriate apiVersion for networkpolicy.
+*/}}
+{{- define "zookeeper.networkPolicy.apiVersion" -}}
+{{- if semverCompare "<1.7-0" (include "zookeeper.kubeVersion" .) -}}
+{{- print "extensions/v1beta1" -}}
+{{- else -}}
+{{- print "networking.k8s.io/v1" -}}
+{{- end -}}
+{{- end -}}
+
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Renders a value that contains template.
+Usage:
+{{ include "zookeeper.tplvalues" ( dict "value" .Values.path.to.the.Value "context" $) }}
+*/}}
+{{- define "zookeeper.tplvalues" -}}
+ {{- if typeIs "string" .value }}
+ {{- tpl .value .context }}
+ {{- else }}
+ {{- tpl (.value | toYaml) .context }}
+ {{- end }}
+{{- end -}}
+
+
+{{/*
+Return the appropriate apiVersion for poddisruptionbudget.
+*/}}
+{{- define "zookeeper.policy.apiVersion" -}}
+{{- if semverCompare "<1.21-0" (include "zookeeper.kubeVersion" .) -}}
+{{- print "policy/v1beta1" -}}
+{{- else -}}
+{{- print "policy/v1" -}}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/tpl/_helpers.tpl b/deploy/charts/admin-stack/templates/tpl/_helpers.tpl
deleted file mode 100644
index 9f30c939..00000000
--- a/deploy/charts/admin-stack/templates/tpl/_helpers.tpl
+++ /dev/null
@@ -1,27 +0,0 @@
-{{/*
-Formats imagePullSecrets. Input is (dict "root" . "imagePullSecrets" .{specific imagePullSecrets})
-*/}}
-{{- define "dubbo-admin.imagePullSecrets" -}}
-{{- $root := .root }}
-{{- range (concat .root.Values.global.imagePullSecrets .imagePullSecrets) }}
-{{- if eq (typeOf .) "map[string]interface {}" }}
-- {{ toYaml (dict "name" (tpl .name $root)) | trim }}
-{{- else }}
-- name: {{ tpl . $root }}
-{{- end }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return the ZooKeeper configuration ConfigMap name
-*/}}
-{{- define "zookeeper.configmapName" -}}
-{{- if .Values.existingConfigmap -}}
- {{- printf "%s" (tpl .Values.existingConfigmap $) -}}
-{{- else -}}
- {{- printf "%s" (include "zookeeper.fullname" .) -}}
-{{- end -}}
-{{- end -}}
-
-
diff --git a/deploy/charts/admin-stack/templates/tpl/_ingress.tpl b/deploy/charts/admin-stack/templates/tpl/_ingress.tpl
deleted file mode 100644
index 0e63964a..00000000
--- a/deploy/charts/admin-stack/templates/tpl/_ingress.tpl
+++ /dev/null
@@ -1,22 +0,0 @@
-{{/*
-Return if ingress is stable.
-*/}}
-{{- define "dubbo-admin.ingress.isStable" -}}
-{{- eq (include "dubbo-admin.ingress.apiVersion" .) "networking.k8s.io/v1" }}
-{{- end }}
-
-
-{{/*
-Return if ingress supports ingressClassName.
-*/}}
-{{- define "dubbo-admin.ingress.supportsIngressClassName" -}}
-{{- or (eq (include "dubbo-admin.ingress.isStable" .) "true") (and (eq (include "dubbo-admin.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
-{{- end }}
-
-
-{{/*
-Return if ingress supports pathType.
-*/}}
-{{- define "dubbo-admin.ingress.supportsPathType" -}}
-{{- or (eq (include "dubbo-admin.ingress.isStable" .) "true") (and (eq (include "dubbo-admin.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }}
-{{- end }}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/tpl/_kubeversions.tpl b/deploy/charts/admin-stack/templates/tpl/_kubeversions.tpl
deleted file mode 100644
index f403a0cd..00000000
--- a/deploy/charts/admin-stack/templates/tpl/_kubeversions.tpl
+++ /dev/null
@@ -1,33 +0,0 @@
-{{/*
-Return the target Kubernetes version
-*/}}
-{{- define "zookeeper.kubeVersion" -}}
-{{- if .Values.global }}
- {{- if .Values.global.kubeVersion }}
- {{- .Values.global.kubeVersion -}}
- {{- else }}
- {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
- {{- end -}}
-{{- else }}
-{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
-{{- end -}}
-{{- end -}}
-
-
-{{/*
-Return the target Kubernetes version
-*/}}
-{{- define "nacos.kubeVersion" -}}
-{{- if .Values.global }}
- {{- if .Values.global.kubeVersion }}
- {{- .Values.global.kubeVersion -}}
- {{- else }}
- {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
- {{- end -}}
-{{- else }}
-{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
-{{- end -}}
-{{- end -}}
-{{/*
-Return the appropriate apiVersion for statefulset.
-*/}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/tpl/_storages.tpl b/deploy/charts/admin-stack/templates/tpl/_storages.tpl
deleted file mode 100644
index b92c9cab..00000000
--- a/deploy/charts/admin-stack/templates/tpl/_storages.tpl
+++ /dev/null
@@ -1,23 +0,0 @@
-{{/* vim: set filetype=mustache: */}}
-{{/*
-Return the proper Storage Class
-{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }}
-*/}}
-{{- define "zookeeper.storage.class" -}}
-
-{{- $storageClass := .persistence.storageClass -}}
-{{- if .global -}}
- {{- if .global.storageClass -}}
- {{- $storageClass = .global.storageClass -}}
- {{- end -}}
-{{- end -}}
-
-{{- if $storageClass -}}
- {{- if (eq "-" $storageClass) -}}
- {{- printf "storageClassName: \"\"" -}}
- {{- else }}
- {{- printf "storageClassName: %s" $storageClass -}}
- {{- end -}}
-{{- end -}}
-
-{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/tpl/_tplvalues.tpl b/deploy/charts/admin-stack/templates/tpl/_tplvalues.tpl
deleted file mode 100644
index 2fec3629..00000000
--- a/deploy/charts/admin-stack/templates/tpl/_tplvalues.tpl
+++ /dev/null
@@ -1,13 +0,0 @@
-{{/* vim: set filetype=mustache: */}}
-{{/*
-Renders a value that contains template.
-Usage:
-{{ include "zookeeper.tplvalues" ( dict "value" .Values.path.to.the.Value "context" $) }}
-*/}}
-{{- define "zookeeper.tplvalues" -}}
- {{- if typeIs "string" .value }}
- {{- tpl .value .context }}
- {{- else }}
- {{- tpl (.value | toYaml) .context }}
- {{- end }}
-{{- end -}}
\ No newline at end of file
diff --git a/deploy/charts/admin-stack/templates/tpl/_versions.tpl b/deploy/charts/admin-stack/templates/tpl/_versions.tpl
deleted file mode 100644
index 82611a45..00000000
--- a/deploy/charts/admin-stack/templates/tpl/_versions.tpl
+++ /dev/null
@@ -1,96 +0,0 @@
-{{/*
-Return the appropriate apiVersion for rbac.
-*/}}
-{{- define "dubbo-admin.rbac.apiVersion" -}}
-{{- if $.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
-{{- print "rbac.authorization.k8s.io/v1" }}
-{{- else }}
-{{- print "rbac.authorization.k8s.io/v1beta1" }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return the appropriate apiVersion for ingress.
-*/}}
-{{- define "dubbo-admin.ingress.apiVersion" -}}
-{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }}
-{{- print "networking.k8s.io/v1" }}
-{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
-{{- print "networking.k8s.io/v1beta1" }}
-{{- else }}
-{{- print "extensions/v1beta1" }}
-{{- end }}
-{{- end }}
-
-
-{{/*
-Return the appropriate apiVersion for podDisruptionBudget.
-*/}}
-{{- define "dubbo-admin.podDisruptionBudget.apiVersion" -}}
-{{- if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
-{{- print "policy/v1" }}
-{{- else }}
-{{- print "policy/v1beta1" }}
-{{- end }}
-{{- end }}
-
-
-{{- define "zookeeper.statefulset.apiVersion" -}}
-{{- if semverCompare "<1.14-0" (include "zookeeper.kubeVersion" .) -}}
-{{- print "apps/v1beta1" -}}
-{{- else -}}
-{{- print "apps/v1" -}}
-{{- end -}}
-{{- end -}}
-
-
-{{/*
-Return the appropriate apiVersion for networkpolicy.
-*/}}
-{{- define "zookeeper.networkPolicy.apiVersion" -}}
-{{- if semverCompare "<1.7-0" (include "zookeeper.kubeVersion" .) -}}
-{{- print "extensions/v1beta1" -}}
-{{- else -}}
-{{- print "networking.k8s.io/v1" -}}
-{{- end -}}
-{{- end -}}
-
-
-{{/*
-Return the appropriate apiVersion for networkpolicy.
-*/}}
-{{- define "nacos.networkPolicy.apiVersion" -}}
-{{- if semverCompare "<1.7-0" (include "nacos.kubeVersion" .) -}}
-{{- print "extensions/v1beta1" -}}
-{{- else -}}
-{{- print "networking.k8s.io/v1" -}}
-{{- end -}}
-{{- end -}}
-
-
-{{/*
-Return the appropriate apiVersion for poddisruptionbudget.
-*/}}
-{{- define "zookeeper.policy.apiVersion" -}}
-{{- if semverCompare "<1.21-0" (include "zookeeper.kubeVersion" .) -}}
-{{- print "policy/v1beta1" -}}
-{{- else -}}
-{{- print "policy/v1" -}}
-{{- end -}}
-{{- end -}}
-
-
-{{/*
-Return the appropriate apiVersion for poddisruptionbudget.
-*/}}
-{{- define "nacos.policy.apiVersion" -}}
-{{- if semverCompare "<1.21-0" (include "nacos.kubeVersion" .) -}}
-{{- print "policy/v1beta1" -}}
-{{- else -}}
-{{- print "policy/v1" -}}
-{{- end -}}
-{{- end -}}
-
-
-