[bitnami/prometheus-operator] new chart

This commit is contained in:
Sameer Naik
2019-10-17 13:11:40 +05:30
parent 24470b7524
commit f107276487
42 changed files with 14486 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
# 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
.project
.idea/
*.tmproj
.vscode/

View File

@@ -0,0 +1,19 @@
apiVersion: v1
appVersion: 0.33.0
description: The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of Prometheus instances.
name: prometheus-operator
version: 0.1.0
keywords:
- prometheus
- alertmanager
- operator
- monitoring
home: https://github.com/coreos/prometheus-operator/
icon: https://bitnami.com/assets/stacks/prometheus-operator/img/prometheus-operator-stack-220x234.png
sources:
- https://github.com/bitnami/bitnami-docker-prometheus-operator
- https://github.com/coreos/prometheus-operator/
maintainers:
- name: Bitnami
email: containers@bitnami.com
engine: gotpl

View File

@@ -0,0 +1,337 @@
# Prometheus Operator
[Prometheus Operator](https://github.com/coreos/prometheus-operator/) provides easy monitoring definitions for Kubernetes services and deployment and management of Prometheus instances.
## TL;DR
```bash
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install bitnami/prometheus-operator
```
## Introduction
This chart bootstraps [Prometheus Operator](https://github.com/bitnami/bitnami-docker-prometheus-operator) on [Kubernetes](http://kubernetes.io) using the [Helm](https://helm.sh) package manager.
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters.
## Prerequisites
- Kubernetes 1.12+
- Helm 2.11+ or Helm 3.0-beta3+
## Installing the Chart
Add the `bitnami` charts repo to Helm:
```bash
$ helm repo add bitnami https://charts.bitnami.com/bitnami
```
To install the chart with the release name `my-release`:
```bash
$ helm install --name my-release bitnami/prometheus-operator
```
The command deploys Prometheus Operator on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
> **Tip**: List all releases using `helm list`
## Uninstalling the Chart
To uninstall/delete the `my-release` release:
```bash
$ helm delete my-release
```
The command removes all the Kubernetes components associated with the chart and deletes the release. Use the flag `--purge` to delete all history too.
## Configuration
The following table lists the configurable parameters of the Prometheus Operator chart and their default values.
### Global Configuration
| Parameter | Description | Default |
|---------------------------|----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
| `global.imageRegistry` | Global Docker image registry | `nil` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `global.storageClass` | Global storage class for dynamic provisioning | `nil` |
| `global.labels` | Additional labels to apply to all resource | `{}` |
| `nameOverride` | String to partially override `prometheus-operator.name` template with a string (will prepend the release name) | `nil` |
| `fullnameOverride` | String to fully override `prometheus-operator.fullname` template with a string | `nil` |
| `rbac.create` | Wether to create & use RBAC resources or not | `true` |
| `rbac.apiVersion` | Version of the RBAC API | `v1beta1` |
| `rbac.pspEnabled` | PodSecurityPolicy | `true` |
### Prometheus Operator Configuration
| Parameter | Description | Default |
|-------------------------------------------------------|--------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| `operator.enabled` | Deploy Prometheus Operator to the cluster | `true` |
| `operator.image.registry` | Prometheus Operator image registry | `docker.io` |
| `operator.image.repository` | Prometheus Operator Image name | `bitnami/prometheus-operator` |
| `operator.image.tag` | Prometheus Operator Image tag | `{TAG_NAME}` |
| `operator.image.pullPolicy` | Prometheus Operator image pull policy | `IfNotPresent` |
| `operator.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `operator.serviceAccount.create` | Specify whether to create a ServiceAccount for Prometheus Operator | `true` |
| `operator.serviceAccount.name` | The name of the ServiceAccount to create | Generated using the `prometheus-operator.operator.fullname` template |
| `operator.schedulerName` | Name of the k8s scheduler (other than default) | `nil` |
| `operator.securityContext.enabled` | Enable security context | `true` |
| `operator.securityContext.fsGroup` | Group ID for the container filesystem | `1001` |
| `operator.securityContext.runAsUser` | User ID for the container | `1001` |
| `operator.service.type` | Kubernetes service type | `ClusterIP` |
| `operator.service.port` | Prometheus Operator service port | `8080` |
| `operator.service.clusterIP` | Specific cluster IP when service type is cluster IP. Use `None` for headless service | `nil` |
| `operator.service.nodePort` | Kubernetes Service nodePort | `nil` |
| `operator.service.loadBalancerIP` | `loadBalancerIP` if service type is `LoadBalancer` | `nil` |
| `operator.service.loadBalancerSourceRanges` | Address that are allowed when svc is `LoadBalancer` | `[]` |
| `operator.service.annotations` | Additional annotations for Prometheus Operator service | `{}` |
| `operator.serviceMonitor.interval` | Scrape interval (use by default, falling back to Prometheus' default) | `nil` |
| `operator.serviceMonitor.metricRelabelings` | Metric relabeling | `[]` |
| `operator.serviceMonitor.relabelings` | Relabel configs | `[]` |
| `operator.resources` | CPU/Memory resource requests/limits for node | `{}` |
| `operator.podAnnotations` | Pod annotations | `{}` |
| `operator.nodeAffinity` | Node Affinity (this value is evaluated as a template) | `{}` |
| `operator.podAntiAffinity` | Pod anti-affinity policy | `soft` |
| `operator.podAffinity` | Affinity, in addition to antiAffinity (this value is evaluated as a template) | `{}` |
| `operator.nodeSelector` | Node labels for pod assignment (this value is evaluated as a template) | `{}` |
| `operator.tolerations` | List of node taints to tolerate (this value is evaluated as a template) | `[]` |
| `operator.livenessProbe.enabled` | Turn on and off liveness probe | `true` |
| `operator.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `120` |
| `operator.livenessProbe.periodSeconds` | How often to perform the probe | `10` |
| `operator.livenessProbe.timeoutSeconds` | When the probe times out | `5` |
| `operator.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe | `6` |
| `operator.livenessProbe.successThreshold` | Minimum consecutive successes for the probe | `1` |
| `operator.readinessProbe.enabled` | Turn on and off readiness probe | `true` |
| `operator.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `30` |
| `operator.readinessProbe.periodSeconds` | How often to perform the probe | `10` |
| `operator.readinessProbe.timeoutSeconds` | When the probe times out | `5` |
| `operator.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe | `6` |
| `operator.readinessProbe.successThreshold` | Minimum consecutive successes for the probe | `1` |
| `operator.logLevel` | Log Level | `info` |
| `operator.logFormat` | Log Format | `logfmt` |
| `operator.kubeletService.enabled` | Whether to maintain a service for scraping kubelets | `true` |
| `operator.kubeletService.namespace` | Namespace to deploy the kubelet service | `kube-system` |
| `operator.configmapReload.image.registry` | ConfigMap Reload image registry | `docker.io` |
| `operator.configmapReload.image.repository` | ConfigMap Reload Image name | `bitnami/configmap-reload` |
| `operator.configmapReload.image.tag` | ConfigMap Reload Image tag | `{TAG_NAME}` |
| `operator.configmapReload.image.pullPolicy` | ConfigMap Reload image pull policy | `IfNotPresent` |
| `operator.configmapReload.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `operator.prometheusConfigReloader.image.registry` | Prometheus Config Reloader image registry | `docker.io` |
| `operator.prometheusConfigReloader.image.repository` | Prometheus Config Reloader Image name | `bitnami/configmap-reload` |
| `operator.prometheusConfigReloader.image.tag` | Prometheus Config Reloader Image tag | `{TAG_NAME}` |
| `operator.prometheusConfigReloader.image.pullPolicy` | Prometheus Config Reloader image pull policy | `IfNotPresent` |
| `operator.prometheusConfigReloader.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
### Prometheus Configuration
| Parameter | Description | Default |
|-----------------------------------------------|--------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| `prometheus.enabled` | Deploy Prometheus to the cluster | `true` |
| `prometheus.image.registry` | Prometheus image registry | `docker.io` |
| `prometheus.image.repository` | Prometheus Image name | `bitnami/prometheus` |
| `prometheus.image.tag` | Prometheus Image tag | `{TAG_NAME}` |
| `prometheus.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `prometheus.serviceAccount.create` | Specify whether to create a ServiceAccount for Prometheus | `true` |
| `prometheus.serviceAccount.name` | The name of the ServiceAccount to create | Generated using the `prometheus-operator.prometheus.fullname` template |
| `prometheus.securityContext.enabled` | Enable security context | `true` |
| `prometheus.securityContext.fsGroup` | Group ID for the container filesystem | `1001` |
| `prometheus.securityContext.runAsUser` | User ID for the container | `1001` |
| `prometheus.podDisruptionBudget.enabled` | Create a pod disruption budget for Prometheus | `true` |
| `prometheus.podDisruptionBudget.minAvailable` | Minimum number / percentage of pods that should remain scheduled | `1` |
| `prometheus.podDisruptionBudget.minAvailable` | Maximum number / percentage of pods that may be made unavailable | `nil` |
| `prometheus.service.type` | Kubernetes service type | `ClusterIP` |
| `prometheus.service.port` | Prometheus service port | `9090` |
| `prometheus.service.clusterIP` | Specific cluster IP when service type is cluster IP. Use `None` for headless service | `nil` |
| `prometheus.service.nodePort` | Kubernetes Service nodePort | `nil` |
| `prometheus.service.loadBalancerIP` | `loadBalancerIP` if service type is `LoadBalancer` | `nil` |
| `prometheus.service.loadBalancerSourceRanges` | Address that are allowed when svc is `LoadBalancer` | `[]` |
| `prometheus.service.annotations` | Additional annotations for Prometheus service | `{}` |
| `prometheus.serviceMonitor.interval` | Scrape interval (use by default, falling back to Prometheus' default) | `nil` |
| `prometheus.serviceMonitor.metricRelabelings` | Metric relabeling | `[]` |
| `prometheus.serviceMonitor.relabelings` | Relabel configs | `[]` |
| `prometheus.ingress.enabled` | Enable ingress controller resource | `false` |
| `prometheus.ingress.certManager` | Add annotations for cert-manager | `false` |
| `prometheus.ingress.annotations` | Ingress annotations | `[]` |
| `prometheus.ingress.hosts[0].name` | Hostname to your Prometheus installation | `prometheus.local` |
| `prometheus.ingress.hosts[0].path` | Path within the url structure | `/` |
| `prometheus.ingress.tls[0].hosts[0]` | TLS hosts | `prometheus.local` |
| `prometheus.ingress.tls[0].secretName` | TLS Secret (certificates) | `prometheus.local-tls` |
| `prometheus.resources` | CPU/Memory resource requests/limits for node | `{}` |
| `prometheus.nodeAffinity` | Node Affinity (this value is evaluated as a template) | `{}` |
| `prometheus.podAntiAffinity` | Pod anti-affinity policy | `soft` |
| `prometheus.podAffinity` | Affinity, in addition to antiAffinity (this value is evaluated as a template) | `{}` |
| `prometheus.nodeSelector` | Node labels for pod assignment (this value is evaluated as a template) | `{}` |
| `prometheus.tolerations` | List of node taints to tolerate (this value is evaluated as a template) | `[]` |
| `prometheus.replicaCount` | Number of Prometheus replicas desired | `1` |
| `prometheus.logLevel` | Log level for Prometheus | `info` |
| `prometheus.logFormat` | Log format for Prometheus | `logfmt` |
| `prometheus.podMetadata` | Standard objects metadata | `{}` |
| `prometheus.scrapeInterval` | Interval between consecutive scrapes | `` |
| `prometheus.evaluationInterval` | Interval between consecutive evaluations | `` |
| `prometheus.listenLocal` | ListenLocal makes the Prometheus server listen on loopback | `false` |
| `prometheus.enableAdminAPI` | Enable Prometheus adminitrative API | `false` |
| `prometheus.alertingEndpoints` | Alertmanagers to which alerts will be sent | `[]` |
| `prometheus.externalLabels` | External labels to add to any time series | `{}` |
| `prometheus.replicaExternalLabelName` | Name of the external label used to denote replica name | `` |
| `prometheus.replicaExternalLabelNameClear` | Clear external label used to denote replica name | `false` |
| `prometheus.prometheusExternalLabelName` | Name of the external label used to denote Prometheus instance name | `` |
| `prometheus.prometheusExternalLabelNameClear` | Clear external label used to denote Prometheus instance name | `false` |
| `prometheus.secrets` | Secrets that should be mounted into the Prometheus Pods | `[]` |
| `prometheus.configMaps` | ConfigMaps that should be mounted into the Prometheus Pods | `[]` |
| `prometheus.querySpec` | The query command line flags when starting Prometheus | `{}` |
| `prometheus.ruleNamespaceSelector` | Namespaces to be selected for PrometheusRules discovery | `{}` |
| `prometheus.ruleSelector` | PrometheusRules to be selected for target discovery | `{}` |
| `prometheus.serviceMonitorSelector` | If {}, select all ServiceMonitors | `{}` |
| `prometheus.serviceMonitorNamespaceSelector` | Namespaces to be selected for ServiceMonitor discovery | `{}` |
| `prometheus.retention` | Metrics retention days | `10d` |
| `prometheus.retentionSize` | Maximum size of metrics | `` |
| `prometheus.walCompression` | Enable compression of the write-ahead log using Snappy | `false` |
| `prometheus.paused` | If true, the Operator won't process any Prometheus configuration changes | `false` |
| `prometheus.remoteRead` | The remote_read spec configuration for Prometheus | `[]` |
| `prometheus.remoteWrite` | The remote_write spec configuration for Prometheus | `[]` |
| `prometheus.storageSpec` | Prometheus StorageSpec for persistent data | `{}` |
| `prometheus.priorityClassName` | Priority class assigned to the Pods | `` |
| `prometheus.containers` | Containers allows injecting additional containers | `[]` |
| `prometheus.additionalScrapeConfigsExternal` | Enable additional scrape configs that are managed externally to this chart | `false` |
### Alertmanager Configuration
| Parameter | Description | Default |
|-------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `alertmanager.enabled` | Deploy Alertmanager to the cluster | `true` |
| `alertmanager.image.registry` | Prometheus image registry | `docker.io` |
| `alertmanager.image.repository` | Prometheus Image name | `bitnami/alertmanager` |
| `alertmanager.image.tag` | Prometheus Image tag | `{TAG_NAME}` |
| `alertmanager.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `alertmanager.serviceAccount.create` | Specify whether to create a ServiceAccount for Alertmanager | `true` |
| `alertmanager.serviceAccount.name` | The name of the ServiceAccount to create | Generated using the `prometheus-operator.alertmanager.fullname` template |
| `alertmanager.securityContext.enabled` | Enable security context | `true` |
| `alertmanager.securityContext.fsGroup` | Group ID for the container filesystem | `1001` |
| `alertmanager.securityContext.runAsUser` | User ID for the container | `1001` |
| `alertmanager.podDisruptionBudget.enabled` | Create a pod disruption budget for Alertmanager | `true` |
| `alertmanager.podDisruptionBudget.minAvailable` | Minimum number / percentage of pods that should remain scheduled | `1` |
| `alertmanager.podDisruptionBudget.minAvailable` | Maximum number / percentage of pods that may be made unavailable | `nil` |
| `alertmanager.service.type` | Kubernetes service type | `ClusterIP` |
| `alertmanager.service.port` | Alertmanager service port | `9093` |
| `alertmanager.service.clusterIP` | Specific cluster IP when service type is cluster IP. Use `None` for headless service | `nil` |
| `alertmanager.service.nodePort` | Kubernetes Service nodePort | `nil` |
| `alertmanager.service.loadBalancerIP` | `loadBalancerIP` if service type is `LoadBalancer` | `nil` |
| `alertmanager.service.loadBalancerSourceRanges` | Address that are allowed when svc is `LoadBalancer` | `[]` |
| `alertmanager.service.annotations` | Additional annotations for Alertmanager service | `{}` |
| `alertmanager.serviceMonitor.interval` | Scrape interval (use by default, falling back to Prometheus' default) | `nil` |
| `alertmanager.serviceMonitor.metricRelabelings` | Metric relabeling | `[]` |
| `alertmanager.serviceMonitor.relabelings` | Relabel configs | `[]` |
| `alertmanager.ingress.enabled` | Enable ingress controller resource | `false` |
| `alertmanager.ingress.certManager` | Add annotations for cert-manager | `false` |
| `alertmanager.ingress.annotations` | Ingress annotations | `[]` |
| `alertmanager.ingress.hosts[0].name` | Hostname to your Alertmanager installation | `alertmanager.local` |
| `alertmanager.ingress.hosts[0].path` | Path within the url structure | `/` |
| `alertmanager.ingress.tls[0].hosts[0]` | TLS hosts | `alertmanager.local` |
| `alertmanager.ingress.tls[0].secretName` | TLS Secret (certificates) | `alertmanager.local-tls` |
| `alertmanager.resources` | CPU/Memory resource requests/limits for node | `{}` |
| `alertmanager.nodeAffinity` | Node Affinity (this value is evaluated as a template) | `{}` |
| `alertmanager.podAntiAffinity` | Pod anti-affinity policy | `soft` |
| `alertmanager.podAffinity` | Affinity, in addition to antiAffinity (this value is evaluated as a template) | `{}` |
| `alertmanager.nodeSelector` | Node labels for pod assignment (this value is evaluated as a template) | `{}` |
| `alertmanager.tolerations` | List of node taints to tolerate (this value is evaluated as a template) | `[]` |
| `alertmanager.config` | Alertmanager configuration directive | `{"global":{"resolve_timeout":"5m"},"route":{"group_by":["job"],"group_wait":"30s","group_interval":"5m","repeat_interval":"12h","receiver":"null","routes":[{"match":{"alertname":"Watchdog"},"receiver":"null"}]},"receivers":[{"name":"null"}]}` |
| `alertmanager.replicaCount` | Number of Alertmanager replicas desired | `1` |
| `alertmanager.logLevel` | Log level for Alertmanager | `info` |
| `alertmanager.logFormat` | Log format for Alertmanager | `logfmt` |
| `alertmanager.podMetadata` | Standard objects metadata | `{}` |
| `alertmanager.secrets` | Secrets that should be mounted into the Alertmanager Pods | `[]` |
| `alertmanager.configMaps` | ConfigMaps that should be mounted into the Alertmanager Pods | `[]` |
| `alertmanager.retention` | Metrics retention days | `10d` |
| `alertmanager.storageSpec` | Alertmanager StorageSpec for persistent data | `{}` |
| `alertmanager.paused` | If true, the Operator won't process any Alertmanager configuration changes | `false` |
| `alertmanager.listenLocal` | ListenLocal makes the Alertmanager server listen on loopback | `false` |
| `alertmanager.containers` | Containers allows injecting additional containers | `[]` |
| `alertmanager.priorityClassName` | Priority class assigned to the Pods | `` |
| `alertmanager.additionalPeers` | AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster | `[]` |
The above parameters map to the env variables defined in [bitnami/prometheus-operator](http://github.com/bitnami/bitnami-docker-prometheus-operator). For more information please refer to the [bitnami/prometheus-operator](http://github.com/bitnami/bitnami-docker-prometheus-operator) image documentation.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```bash
$ helm install --name my-release \
--set operator.logLevel=debug \
--set prometheus.replicaCount=5 \
bitnami/prometheus-operator
```
The above command sets the Prometheus Operator `logLevel` to `debug`. Additionally it sets the `prometheus.replicaCount` to `5`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```bash
$ helm install --name my-release -f values.yaml bitnami/prometheus-operator
```
> **Tip**: You can use the default [values.yaml](values.yaml)
### Production configuration
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`.
```console
$ helm install --name my-release -f ./values-production.yaml bitnami/prometheus-operator
```
- Modify the Log level for Prometheus Operator:
```diff
- logLevel: info
+ logLevel: error
```
- Increase the number of days to retain metrics:
```diff
- retention: 10d
+ retention: 30d
```
- Increase the number of Alertmanager replicas:
```diff
- replicaCount: 1
+ replicaCount: 3
```
- Modify the Log level for Alertmanager:
```diff
- logLevel: info
+ logLevel: error
```
- Increase the number of Prometheus replicas:
```diff
- replicaCount: 1
+ replicaCount: 3
```
- Modify the Log level for Prometheus:
```diff
- logLevel: info
+ logLevel: error
```
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
## Upgrading
```bash
$ helm upgrade my-release bitnami/prometheus-operator
```

View File

@@ -0,0 +1,96 @@
** Please be patient while the chart is being deployed **
Watch the Prometheus Operator Deployment status using the command:
kubectl get deploy -w --namespace {{ .Release.Namespace }} -l app.kubernetes.io/name={{ template "prometheus-operator.operator.name" . }},app.kubernetes.io/instance={{ .Release.Name }}
{{- if .Values.prometheus.enabled }}
Watch the Prometheus StatefulSet status using the command:
kubectl get sts -w --namespace {{ .Release.Namespace }} -l app.kubernetes.io/name={{ template "prometheus-operator.prometheus.name" . }},app.kubernetes.io/instance={{ .Release.Name }}
Prometheus can be accessed via port "{{ .Values.prometheus.service.port }}" on the following DNS name from within your cluster:
{{ template "prometheus-operator.prometheus.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
To access Prometheus from outside the cluster execute the following commands:
{{- if .Values.prometheus.ingress.enabled }}
You should be able to access your new Prometheus installation through
{{- range .Values.prometheus.ingress.hosts }}
{{ if .tls }}https{{ else }}http{{ end }}://{{ .name }}
{{- end }}
{{- else if contains "LoadBalancer" .Values.prometheus.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prometheus-operator.prometheus.fullname" . }}'
{{- $port:=.Values.prometheus.service.port | toString }}
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus-operator.prometheus.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo "Prometheus URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.prometheus.service.port }}{{ end }}/"
{{- else if contains "ClusterIP" .Values.prometheus.service.type }}
echo "Prometheus URL: http://127.0.0.1:9090/"
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "prometheus-operator.prometheus.fullname" . }} 9090:{{ .Values.prometheus.service.port }}
{{- else if contains "NodePort" .Values.prometheus.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus-operator.prometheus.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo "Prometheus URL: http://$NODE_IP:$NODE_PORT/"
{{- end }}
{{- end }}
{{- if .Values.alertmanager.enabled }}
Watch the Alertmanager StatefulSet status using the command:
kubectl get sts -w --namespace {{ .Release.Namespace }} -l app.kubernetes.io/name={{ template "prometheus-operator.alertmanager.name" . }},app.kubernetes.io/instance={{ .Release.Name }}
Alertmanager can be accessed via port "{{ .Values.alertmanager.service.port }}" on the following DNS name from within your cluster:
{{ template "prometheus-operator.alertmanager.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
To access Alertmanager from outside the cluster execute the following commands:
{{- if .Values.alertmanager.ingress.enabled }}
You should be able to access your new Prometheus installation through
{{- range .Values.alertmanager.ingress.hosts }}
{{ if .tls }}https{{ else }}http{{ end }}://{{ .name }}
{{- end }}
{{- else if contains "LoadBalancer" .Values.alertmanager.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "prometheus-operator.alertmanager.fullname" . }}'
{{- $port:=.Values.alertmanager.service.port | toString }}
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus-operator.alertmanager.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo "Alertmanager URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.alertmanager.service.port }}{{ end }}/"
{{- else if contains "ClusterIP" .Values.alertmanager.service.type }}
echo "Alertmanager URL: http://127.0.0.1:9093/"
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "prometheus-operator.alertmanager.fullname" . }} 9093:{{ .Values.alertmanager.service.port }}
{{- else if contains "NodePort" .Values.alertmanager.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus-operator.alertmanager.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo "Alertmanager URL: http://$NODE_IP:$NODE_PORT/"
{{- end }}
{{- end }}
{{ include "prometheus-operator.validateValues" . }}
{{ include "prometheus-operator.checkRollingTags" . }}

View File

@@ -0,0 +1,423 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "prometheus-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 50 | trimSuffix "-" -}}
{{- end -}}
{{/* Name suffixed with operator */}}
{{- define "prometheus-operator.operator.name" -}}
{{- printf "%s-operator" (include "prometheus-operator.name" .) -}}
{{- end }}
{{/* Name suffixed with prometheus */}}
{{- define "prometheus-operator.prometheus.name" -}}
{{- printf "%s-prometheus" (include "prometheus-operator.name" .) -}}
{{- end }}
{{/* Name suffixed with alertmanager */}}
{{- define "prometheus-operator.alertmanager.name" -}}
{{- printf "%s-alertmanager" (include "prometheus-operator.name" .) -}}
{{- 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).
*/}}
{{- define "prometheus-operator.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 26 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 26 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 26 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/* Fullname suffixed with operator */}}
{{- define "prometheus-operator.operator.fullname" -}}
{{- printf "%s-operator" (include "prometheus-operator.fullname" .) -}}
{{- end }}
{{/* Fullname suffixed with prometheus */}}
{{- define "prometheus-operator.prometheus.fullname" -}}
{{- printf "%s-prometheus" (include "prometheus-operator.fullname" .) -}}
{{- end }}
{{/* Fullname suffixed with alertmanager */}}
{{- define "prometheus-operator.alertmanager.fullname" -}}
{{- printf "%s-alertmanager" (include "prometheus-operator.fullname" .) -}}
{{- end }}
{{- define "prometheus-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common Labels
*/}}
{{- define "prometheus-operator.labels" -}}
app.kubernetes.io/name: {{ include "prometheus-operator.name" . }}
helm.sh/chart: {{ include "prometheus-operator.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.global.labels }}
{{ toYaml .Values.global.labels }}
{{- end }}
{{- end -}}
{{/*
Labels for operator
*/}}
{{- define "prometheus-operator.operator.labels" -}}
{{ include "prometheus-operator.labels" . }}
app.kubernetes.io/component: operator
{{- end -}}
{{/*
Labels for prometheus
*/}}
{{- define "prometheus-operator.prometheus.labels" -}}
{{ include "prometheus-operator.labels" . }}
app.kubernetes.io/component: prometheus
{{- end -}}
{{/*
Labels for alertmanager
*/}}
{{- define "prometheus-operator.alertmanager.labels" -}}
{{ include "prometheus-operator.labels" . }}
app.kubernetes.io/component: alertmanager
{{- end -}}
{{/*
Common matchLabels
*/}}
{{- define "prometheus-operator.matchLabels" -}}
app.kubernetes.io/name: {{ include "prometheus-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/*
matchLabels for operator
*/}}
{{- define "prometheus-operator.operator.matchLabels" -}}
{{ include "prometheus-operator.matchLabels" . }}
app.kubernetes.io/component: operator
{{- end -}}
{{/*
matchLabels for prometheus
*/}}
{{- define "prometheus-operator.prometheus.matchLabels" -}}
{{ include "prometheus-operator.matchLabels" . }}
app.kubernetes.io/component: prometheus
{{- end -}}
{{/*
matchLabels for alertmanager
*/}}
{{- define "prometheus-operator.alertmanager.matchLabels" -}}
{{ include "prometheus-operator.matchLabels" . }}
app.kubernetes.io/component: alertmanager
{{- end -}}
{{/*
Return the proper Prometheus Operator image name
*/}}
{{- define "prometheus-operator.image" -}}
{{- $registryName := .Values.operator.image.registry -}}
{{- $repositoryName := .Values.operator.image.repository -}}
{{- $tag := .Values.operator.image.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Prometheus Operator Reloader image name
*/}}
{{- define "prometheus-operator.prometheusConfigReloader.image" -}}
{{- $registryName := .Values.operator.prometheusConfigReloader.image.registry -}}
{{- $repositoryName := .Values.operator.prometheusConfigReloader.image.repository -}}
{{- $tag := .Values.operator.prometheusConfigReloader.image.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper ConfigMap Reload image name
*/}}
{{- define "prometheus-operator.configmapReload.image" -}}
{{- $registryName := .Values.operator.configmapReload.image.registry -}}
{{- $repositoryName := .Values.operator.configmapReload.image.repository -}}
{{- $tag := .Values.operator.configmapReload.image.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Prometheus BaseImage name
*/}}
{{- define "prometheus-operator.prometheus.baseImage" -}}
{{- $registryName := .Values.prometheus.image.registry -}}
{{- $repositoryName := .Values.prometheus.image.repository -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s" .Values.global.imageRegistry $repositoryName -}}
{{- else -}}
{{- printf "%s/%s" $registryName $repositoryName -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s" $registryName $repositoryName -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Alertmanager BaseImage name
*/}}
{{- define "prometheus-operator.alertmanager.baseImage" -}}
{{- $registryName := .Values.alertmanager.image.registry -}}
{{- $repositoryName := .Values.alertmanager.image.repository -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s" .Values.global.imageRegistry $repositoryName -}}
{{- else -}}
{{- printf "%s/%s" $registryName $repositoryName -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s" $registryName $repositoryName -}}
{{- end -}}
{{- end -}}
{{/*
Renders a value that contains template.
Usage:
{{ include "prometheus-operator.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "prometheus-operator.tplValue" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
{{/*
Create the name of the operator service account to use
*/}}
{{- define "prometheus-operator.operator.serviceAccountName" -}}
{{- if .Values.operator.serviceAccount.create -}}
{{ default (include "prometheus-operator.operator.fullname" .) .Values.operator.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.operator.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the prometheus service account to use
*/}}
{{- define "prometheus-operator.prometheus.serviceAccountName" -}}
{{- if .Values.prometheus.serviceAccount.create -}}
{{ default (include "prometheus-operator.prometheus.fullname" .) .Values.prometheus.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.prometheus.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the alertmanager service account to use
*/}}
{{- define "prometheus-operator.alertmanager.serviceAccountName" -}}
{{- if .Values.alertmanager.serviceAccount.create -}}
{{ default (include "prometheus-operator.alertmanager.fullname" .) .Values.alertmanager.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.alertmanager.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names for Prometheus Operator image
*/}}
{{- define "prometheus-operator.operator.imagePullSecrets" -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
Also, we can not use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.global.imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- else if .Values.operator.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.operator.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- else if .Values.operator.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.operator.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names for Prometheus image
*/}}
{{- define "prometheus-operator.prometheus.imagePullSecrets" -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
Also, we can not use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.global.imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- else if .Values.prometheus.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.prometheus.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- else if .Values.prometheus.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.prometheus.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names for Alertmanager image
*/}}
{{- define "prometheus-operator.alertmanager.imagePullSecrets" -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
Also, we can not use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.global.imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- else if .Values.alertmanager.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.alertmanager.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- else if .Values.alertmanager.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.alertmanager.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for PodSecurityPolicy.
*/}}
{{- define "podSecurityPolicy.apiVersion" -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "policy/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{/*
Check if there are rolling tags in the images
*/}}
{{- define "prometheus-operator.checkRollingTags" -}}
{{- if and (contains "bitnami/" .Values.operator.image.repository) (not (.Values.operator.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
WARNING: Rolling tag detected ({{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
{{- end }}
{{- if and (contains "bitnami/" .Values.operator.configmapReload.image.repository) (not (.Values.operator.configmapReload.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
WARNING: Rolling tag detected ({{ .Values.operator.configmapReload.image.repository }}:{{ .Values.operator.configmapReload.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
{{- end }}
{{- if and (contains "bitnami/" .Values.operator.prometheusConfigReloader.image.repository) (not (.Values.operator.prometheusConfigReloader.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
WARNING: Rolling tag detected ({{ .Values.operator.prometheusConfigReloader.image.repository }}:{{ .Values.operator.prometheusConfigReloader.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
{{- end }}
{{- if and (contains "bitnami/" .Values.prometheus.image.repository) (not (.Values.prometheus.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
WARNING: Rolling tag detected ({{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
{{- end }}
{{- if and (contains "bitnami/" .Values.alertmanager.image.repository) (not (.Values.alertmanager.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
WARNING: Rolling tag detected ({{ .Values.alertmanager.image.repository }}:{{ .Values.alertmanager.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
{{- end }}
{{- end -}}
{{/*
Compile all warnings into a single message, and call fail.
*/}}
{{- define "prometheus-operator.validateValues" -}}
{{- $messages := list -}}
{{- $messages := without $messages "" -}}
{{- $message := join "\n" $messages -}}
{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,81 @@
{{- if .Values.alertmanager.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.alertmanager.replicaCount }}
serviceAccountName: {{ template "prometheus-operator.alertmanager.serviceAccountName" . }}
{{- if .Values.alertmanager.image }}
baseImage: {{ template "prometheus-operator.alertmanager.baseImage" . }}
version: {{ .Values.alertmanager.image.tag }}
{{- end }}
listenLocal: {{ .Values.alertmanager.listenLocal }}
{{- if and .Values.alertmanager.ingress.enabled .Values.alertmanager.ingress.hosts }}
externalUrl: {{ if .Values.alertmanager.ingress.tls }}https{{else}}http{{ end }}://{{ (index .Values.alertmanager.ingress.hosts 0).name }}/
{{- else }}
externalUrl: http://{{ template "prometheus-operator.alertmanager.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.alertmanager.service.port }}
{{- end }}
paused: {{ .Values.alertmanager.paused }}
logFormat: {{ .Values.alertmanager.logFormat }}
logLevel: {{ .Values.alertmanager.logLevel }}
retention: {{ .Values.alertmanager.retention }}
{{- if .Values.alertmanager.secrets }}
secrets: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.secrets "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.alertmanager.configMaps }}
configMaps: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.configMaps "context" $) | nindent 4 }}
{{- end }}
resources: {{- toYaml .Values.alertmanager.resources | nindent 4 }}
routePrefix: "/"
{{- if .Values.alertmanager.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.alertmanager.securityContext.runAsUser }}
fsGroup: {{ .Values.alertmanager.securityContext.fsGroup }}
{{- end }}
{{- if .Values.alertmanager.storageSpec }}
storage: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.storageSpec "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.alertmanager.podMetadata }}
podMetadata: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.podMetadata "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.alertmanager.nodeSelector }}
nodeSelector: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.nodeSelector "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.alertmanager.tolerations }}
tolerations: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.tolerations "context" $) | nindent 4 }}
{{- end }}
affinity:
{{- if .Values.alertmanager.nodeAffinity }}
nodeAffinity: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.nodeAffinity "context" $) | nindent 6 }}
{{- end }}
{{- if eq .Values.alertmanager.podAntiAffinity "hard" }}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels: {{- include "prometheus-operator.alertmanager.matchLabels" . | nindent 12 }}
{{- else if eq .Values.alertmanager.podAntiAffinity "soft" }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels: {{- include "prometheus-operator.alertmanager.matchLabels" . | nindent 14 }}
{{- end }}
{{- if .Values.alertmanager.podAffinity }}
podAffinity: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.podAffinity "context" $) | nindent 6 }}
{{- end }}
{{- include "prometheus-operator.alertmanager.imagePullSecrets" . | indent 2 }}
{{- if .Values.alertmanager.containers }}
containers: {{- include "prometheus-operator.tplValue" (dict "value" .Values.alertmanager.containers "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.alertmanager.priorityClassName }}
priorityClassName: {{ .Values.alertmanager.priorityClassName }}
{{- end }}
{{- if .Values.alertmanager.additionalPeers }}
additionalPeers: {{ .Values.alertmanager.additionalPeers }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,29 @@
{{- if and .Values.alertmanager.enabled .Values.alertmanager.ingress.enabled }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
annotations:
{{- if .Values.alertmanager.ingress.certManager }}
kubernetes.io/tls-acme: "true"
{{- end }}
{{- range $key, $value := .Values.alertmanager.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range .Values.alertmanager.ingress.hosts }}
- host: {{ .name }}
http:
paths:
- path: {{ default "/" .path }}
backend:
serviceName: {{ template "prometheus-operator.alertmanager.fullname" $ }}
servicePort: http
{{- end }}
{{- if .Values.alertmanager.ingress.tls }}
tls:
{{ toYaml .Values.alertmanager.ingress.tls | indent 4 }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,18 @@
{{- if and .Values.alertmanager.enabled .Values.alertmanager.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app: alertmanager
alertmanager: {{ template "prometheus-operator.alertmanager.fullname" . }}
{{- if .Values.alertmanager.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.alertmanager.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.alertmanager.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.alertmanager.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,13 @@
{{- if and .Values.alertmanager.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}-psp
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "prometheus-operator.alertmanager.fullname" . }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if and .Values.alertmanager.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}-psp
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "prometheus-operator.alertmanager.fullname" . }}-psp
subjects:
- kind: ServiceAccount
name: {{ template "prometheus-operator.alertmanager.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@@ -0,0 +1,39 @@
{{- if and .Values.alertmanager.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: {{ template "podSecurityPolicy.apiVersion" . }}
kind: PodSecurityPolicy
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
spec:
privileged: false
allowPrivilegeEscalation: false
requiredDropCapabilities:
- ALL
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
fsGroup:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
{{- end }}

View File

@@ -0,0 +1,9 @@
{{- if .Values.alertmanager.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: alertmanager-{{ template "prometheus-operator.alertmanager.fullname" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
data:
alertmanager.yaml: {{ toYaml .Values.alertmanager.config | b64enc | quote }}
{{- end }}

View File

@@ -0,0 +1,33 @@
{{- if .Values.alertmanager.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
{{- with .Values.alertmanager.service.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.alertmanager.service.type }}
{{- if and .Values.alertmanager.service.loadBalancerIP (eq .Values.alertmanager.service.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.alertmanager.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.alertmanager.service.type "LoadBalancer") .Values.alertmanager.service.loadBalancerSourceRanges }}
{{- with .Values.alertmanager.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- if and (eq .Values.alertmanager.service.type "ClusterIP") .Values.alertmanager.service.clusterIP }}
clusterIP: {{ .Values.alertmanager.service.clusterIP }}
{{- end }}
ports:
- name: http
port: {{ .Values.alertmanager.service.port }}
targetPort: 9093
{{- if and .Values.alertmanager.service.nodePort (or (eq .Values.alertmanager.service.type "NodePort") (eq .Values.alertmanager.service.type "LoadBalancer")) }}
nodePort: {{ .Values.alertmanager.service.nodePort }}
{{- end }}
selector:
app: alertmanager
alertmanager: {{ template "prometheus-operator.alertmanager.fullname" . }}
{{- end }}

View File

@@ -0,0 +1,8 @@
{{- if and .Values.alertmanager.enabled .Values.alertmanager.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "prometheus-operator.alertmanager.serviceAccountName" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
{{- include "prometheus-operator.alertmanager.imagePullSecrets" . }}
{{- end }}

View File

@@ -0,0 +1,25 @@
{{- if .Values.alertmanager.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "prometheus-operator.alertmanager.fullname" . }}
labels: {{- include "prometheus-operator.alertmanager.labels" . | nindent 4 }}
spec:
selector:
matchLabels: {{- include "prometheus-operator.alertmanager.matchLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- if .Values.alertmanager.serviceMonitor.interval }}
interval: {{ .Values.alertmanager.serviceMonitor.interval }}
{{- end }}
path: "/metrics"
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- include "prometheus-operator.tplValue" ( dict "value" .Values.alertmanager.serviceMonitor.metricRelabelings "context" $) | nindent 6 }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.alertmanager.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,72 @@
{{- if and .Values.operator.enabled .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- '*'
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers
- prometheuses
- prometheuses/finalizers
- alertmanagers/finalizers
- servicemonitors
- podmonitors
- prometheusrules
verbs:
- '*'
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- delete
- apiGroups:
- ""
resources:
- services
- services/finalizers
- endpoints
verbs:
- get
- create
- update
- delete
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if and .Values.operator.enabled .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "prometheus-operator.operator.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "prometheus-operator.operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,240 @@
{{- if .Values.operator.enabled -}}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: podmonitors.monitoring.coreos.com
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": crd-install
"helm.sh/hook-delete-policy": "before-hook-creation"
spec:
group: monitoring.coreos.com
names:
kind: PodMonitor
plural: podmonitors
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
spec:
description: PodMonitorSpec contains specification parameters for a PodMonitor.
properties:
jobLabel:
description: The label to use to retrieve the job name from.
type: string
namespaceSelector:
description: NamespaceSelector is a selector for selecting either all
namespaces or a list of namespaces.
properties:
any:
description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
type: object
podMetricsEndpoints:
description: A list of endpoints allowed as part of this PodMonitor.
items:
description: PodMetricsEndpoint defines a scrapeable endpoint of a
Kubernetes Pod serving Prometheus metrics.
properties:
honorLabels:
description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean
interval:
description: Interval at which metrics should be scraped
type: string
metricRelabelings:
description: MetricRelabelConfigs to apply to samples before ingestion.
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It defines
`<metric_relabel_configs>`-section of Prometheus configuration.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source label
values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. defailt is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular expression
for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
params:
description: Optional HTTP URL parameters
type: object
path:
description: HTTP path to scrape for metrics.
type: string
port:
description: Name of the port this endpoint refers to. Mutually
exclusive with targetPort.
type: string
proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string
relabelings:
description: 'RelabelConfigs to apply to samples before ingestion.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It defines
`<metric_relabel_configs>`-section of Prometheus configuration.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source label
values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. defailt is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular expression
for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
scheme:
description: HTTP scheme to use for scraping.
type: string
scrapeTimeout:
description: Timeout after which the scrape is ended
type: string
targetPort:
anyOf:
- type: string
- type: integer
type: object
type: array
podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes Pod
onto the target.
items:
type: string
type: array
sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
format: int64
type: integer
selector:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
required:
- podMetricsEndpoints
- selector
type: object
type: object
version: v1
{{- end }}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,404 @@
{{- if .Values.operator.enabled -}}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: prometheusrules.monitoring.coreos.com
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": crd-install
"helm.sh/hook-delete-policy": "before-hook-creation"
spec:
group: monitoring.coreos.com
names:
kind: PrometheusRule
plural: prometheusrules
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
description: ObjectMeta is metadata that all persisted resources must have,
which includes all objects users must create.
properties:
annotations:
description: 'Annotations is an unstructured key value map stored with
a resource that may be set by external tools to store and retrieve
arbitrary metadata. They are not queryable and should be preserved
when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations'
type: object
clusterName:
description: The name of the cluster which the object belongs to. This
is used to distinguish resources with same name and namespace in different
clusters. This field is not set anywhere right now and apiserver is
going to ignore it if set in create or update request.
type: string
creationTimestamp:
description: Time is a wrapper around time.Time which supports correct
marshaling to YAML and JSON. Wrappers are provided for many of the
factory methods that the time package offers.
format: date-time
type: string
deletionGracePeriodSeconds:
description: Number of seconds allowed for this object to gracefully
terminate before it will be removed from the system. Only set when
deletionTimestamp is also set. May only be shortened. Read-only.
format: int64
type: integer
deletionTimestamp:
description: Time is a wrapper around time.Time which supports correct
marshaling to YAML and JSON. Wrappers are provided for many of the
factory methods that the time package offers.
format: date-time
type: string
finalizers:
description: Must be empty before the object is deleted from the registry.
Each entry is an identifier for the responsible component that will
remove the entry from the list. If the deletionTimestamp of the object
is non-nil, entries in this list can only be removed.
items:
type: string
type: array
generateName:
description: |-
GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).
Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency
type: string
generation:
description: A sequence number representing a specific generation of
the desired state. Populated by the system. Read-only.
format: int64
type: integer
initializers:
description: Initializers tracks the progress of initialization.
properties:
pending:
description: Pending is a list of initializers that must execute
in order before this object is visible. When the last pending
initializer is removed, and no failing result is set, the initializers
struct will be set to nil and the object is considered as initialized
and visible to all clients.
items:
description: Initializer is information about an initializer that
has not yet completed.
properties:
name:
description: name of the process that is responsible for initializing
this object.
type: string
required:
- name
type: object
type: array
result:
description: Status is a return value for calls that don't return
other objects.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this
representation of an object. Servers should convert recognized
schemas to the latest internal value, and may reject unrecognized
values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
code:
description: Suggested HTTP return code for this status, 0 if
not set.
format: int32
type: integer
details:
description: StatusDetails is a set of additional properties
that MAY be set by the server to provide additional information
about a response. The Reason field of a Status object defines
what attributes will be set. Clients must ignore fields that
do not match the defined type of each attribute, and should
assume that any attribute may be empty, invalid, or under
defined.
properties:
causes:
description: The Causes array includes more details associated
with the StatusReason failure. Not all StatusReasons may
provide detailed causes.
items:
description: StatusCause provides more information about
an api.Status failure, including cases when multiple
errors are encountered.
properties:
field:
description: |-
The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.
Examples:
"name" - the field "name" on the current resource
"items[0].name" - the field "name" on the first array entry in "items"
type: string
message:
description: A human-readable description of the cause
of the error. This field may be presented as-is
to a reader.
type: string
reason:
description: A machine-readable description of the
cause of the error. If this value is empty there
is no information available.
type: string
type: object
type: array
group:
description: The group attribute of the resource associated
with the status StatusReason.
type: string
kind:
description: 'The kind attribute of the resource associated
with the status StatusReason. On some operations may differ
from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
name:
description: The name attribute of the resource associated
with the status StatusReason (when there is a single name
which can be described).
type: string
retryAfterSeconds:
description: If specified, the time in seconds before the
operation should be retried. Some errors may indicate
the client must take an alternate action - for those errors
this field may indicate how long to wait before taking
the alternate action.
format: int32
type: integer
uid:
description: 'UID of the resource. (when there is a single
resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids'
type: string
type: object
kind:
description: 'Kind is a string value representing the REST resource
this object represents. Servers may infer this from the endpoint
the client submits requests to. Cannot be updated. In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
message:
description: A human-readable description of the status of this
operation.
type: string
metadata:
description: ListMeta describes metadata that synthetic resources
must have, including lists and various status objects. A resource
may have only one of {ObjectMeta, ListMeta}.
properties:
continue:
description: continue may be set if the user set a limit
on the number of items returned, and indicates that the
server has more data available. The value is opaque and
may be used to issue another request to the endpoint that
served this list to retrieve the next set of available
objects. Continuing a consistent list may not be possible
if the server configuration has changed or more than a
few minutes have passed. The resourceVersion field returned
when using this continue value will be identical to the
value in the first response, unless you have received
this token from an error message.
type: string
remainingItemCount:
description: |-
remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.
This field is alpha and can be changed or removed without notice.
format: int64
type: integer
resourceVersion:
description: 'String that identifies the server''s internal
version of this object that can be used by clients to
determine when objects have changed. Value must be treated
as opaque by clients and passed unmodified back to the
server. Populated by the system. Read-only. More info:
https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency'
type: string
selfLink:
description: selfLink is a URL representing this object.
Populated by the system. Read-only.
type: string
type: object
reason:
description: A machine-readable description of why this operation
is in the "Failure" status. If this value is empty there is
no information available. A Reason clarifies an HTTP status
code but does not override it.
type: string
status:
description: 'Status of the operation. One of: "Success" or
"Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status'
type: string
type: object
required:
- pending
type: object
labels:
description: 'Map of string keys and values that can be used to organize
and categorize (scope and select) objects. May match selectors of
replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels'
type: object
managedFields:
description: |-
ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object.
This field is alpha and can be changed or removed without notice.
items:
description: ManagedFieldsEntry is a workflow-id, a FieldSet and the
group version of the resource that the fieldset applies to.
properties:
apiVersion:
description: APIVersion defines the version of this resource that
this field set applies to. The format is "group/version" just
like the top-level APIVersion field. It is necessary to track
the version of a field set because it cannot be automatically
converted.
type: string
fields:
description: 'Fields stores a set of fields in a data structure
like a Trie. To understand how this is used, see: https://github.com/kubernetes-sigs/structured-merge-diff'
type: object
manager:
description: Manager is an identifier of the workflow managing
these fields.
type: string
operation:
description: Operation is the type of operation which lead to
this ManagedFieldsEntry being created. The only valid values
for this field are 'Apply' and 'Update'.
type: string
time:
description: Time is a wrapper around time.Time which supports
correct marshaling to YAML and JSON. Wrappers are provided
for many of the factory methods that the time package offers.
format: date-time
type: string
type: object
type: array
name:
description: 'Name must be unique within a namespace. Is required when
creating resources, although some resources may allow a client to
request the generation of an appropriate name automatically. Name
is primarily intended for creation idempotence and configuration definition.
Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type: string
namespace:
description: |-
Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
type: string
ownerReferences:
description: List of objects depended by this object. If ALL objects
in the list have been deleted, this object will be garbage collected.
If this object is managed by a controller, then an entry in this list
will point to this controller, with the controller field set to true.
There cannot be more than one managing controller.
items:
description: OwnerReference contains enough information to let you
identify an owning object. An owning object must be in the same
namespace as the dependent, or be cluster-scoped, so there is no
namespace field.
properties:
apiVersion:
description: API version of the referent.
type: string
blockOwnerDeletion:
description: If true, AND if the owner has the "foregroundDeletion"
finalizer, then the owner cannot be deleted from the key-value
store until this reference is removed. Defaults to false. To
set this field, a user needs "delete" permission of the owner,
otherwise 422 (Unprocessable Entity) will be returned.
type: boolean
controller:
description: If true, this reference points to the managing controller.
type: boolean
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type: string
uid:
description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids'
type: string
required:
- apiVersion
- kind
- name
- uid
type: object
type: array
resourceVersion:
description: |-
An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.
Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency
type: string
selfLink:
description: SelfLink is a URL representing this object. Populated by
the system. Read-only.
type: string
uid:
description: |-
UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.
Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids
type: string
type: object
spec:
description: PrometheusRuleSpec contains specification parameters for a
Rule.
properties:
groups:
description: Content of Prometheus rule file
items:
description: RuleGroup is a list of sequentially evaluated recording
and alerting rules.
properties:
interval:
type: string
name:
type: string
rules:
items:
description: Rule describes an alerting or recording rule.
properties:
alert:
type: string
annotations:
type: object
expr:
anyOf:
- type: string
- type: integer
for:
type: string
labels:
type: object
record:
type: string
required:
- expr
type: object
type: array
required:
- name
- rules
type: object
type: array
type: object
type: object
version: v1
{{- end }}

View File

@@ -0,0 +1,308 @@
{{- if .Values.operator.enabled -}}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: servicemonitors.monitoring.coreos.com
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": crd-install
"helm.sh/hook-delete-policy": "before-hook-creation"
spec:
group: monitoring.coreos.com
names:
kind: ServiceMonitor
plural: servicemonitors
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
spec:
description: ServiceMonitorSpec contains specification parameters for a
ServiceMonitor.
properties:
endpoints:
description: A list of endpoints allowed as part of this ServiceMonitor.
items:
description: Endpoint defines a scrapeable endpoint serving Prometheus
metrics.
properties:
basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over
basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
properties:
password:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
username:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or its key must
be defined
type: boolean
required:
- key
type: object
type: object
bearerTokenFile:
description: File to read bearer token for scraping targets.
type: string
honorLabels:
description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean
interval:
description: Interval at which metrics should be scraped
type: string
metricRelabelings:
description: MetricRelabelConfigs to apply to samples before ingestion.
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It defines
`<metric_relabel_configs>`-section of Prometheus configuration.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source label
values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. defailt is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular expression
for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
params:
description: Optional HTTP URL parameters
type: object
path:
description: HTTP path to scrape for metrics.
type: string
port:
description: Name of the service port this endpoint refers to.
Mutually exclusive with targetPort.
type: string
proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string
relabelings:
description: 'RelabelConfigs to apply to samples before scraping.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It defines
`<metric_relabel_configs>`-section of Prometheus configuration.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source label
values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. defailt is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular expression
for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: object
type: array
scheme:
description: HTTP scheme to use for scraping.
type: string
scrapeTimeout:
description: Timeout after which the scrape is ended
type: string
targetPort:
anyOf:
- type: string
- type: integer
tlsConfig:
description: TLSConfig specifies TLS configuration parameters.
properties:
caFile:
description: The CA cert to use for the targets.
type: string
certFile:
description: The client cert file for the targets.
type: string
insecureSkipVerify:
description: Disable target certificate validation.
type: boolean
keyFile:
description: The client key file for the targets.
type: string
serverName:
description: Used to verify the hostname for the targets.
type: string
type: object
type: object
type: array
jobLabel:
description: The label to use to retrieve the job name from.
type: string
namespaceSelector:
description: NamespaceSelector is a selector for selecting either all
namespaces or a list of namespaces.
properties:
any:
description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
type: object
podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes Pod
onto the target.
items:
type: string
type: array
sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
format: int64
type: integer
selector:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
targetLabels:
description: TargetLabels transfers labels on the Kubernetes Service
onto the target.
items:
type: string
type: array
required:
- endpoints
- selector
type: object
type: object
version: v1
{{- end }}

View File

@@ -0,0 +1,93 @@
{{- if .Values.operator.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels: {{- include "prometheus-operator.operator.matchLabels" . | nindent 6 }}
template:
metadata:
labels: {{- include "prometheus-operator.operator.labels" . | nindent 8 }}
annotations:
{{- if .Values.operator.podAnnotations }}
{{ toYaml .Values.operator.podAnnotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "prometheus-operator.operator.serviceAccountName" . }}
{{- if .Values.operator.schedulerName }}
schedulerName: {{ .Values.operator.schedulerName | quote }}
{{- end }}
{{- if .Values.operator.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.operator.securityContext.runAsUser }}
fsGroup: {{ .Values.operator.securityContext.fsGroup }}
runAsNonRoot: {{ .Values.operator.securityContext.runAsNonRoot }}
{{- end }}
{{- if .Values.operator.nodeSelector }}
nodeSelector: {{- include "prometheus-operator.tplValue" (dict "value" .Values.operator.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.operator.tolerations }}
tolerations: {{- include "prometheus-operator.tplValue" (dict "value" .Values.operator.tolerations "context" $) | nindent 8 }}
{{- end }}
affinity:
{{- if .Values.operator.nodeAffinity }}
nodeAffinity: {{- include "prometheus-operator.tplValue" (dict "value" .Values.operator.nodeAffinity "context" $) | nindent 10 }}
{{- end }}
{{- if eq .Values.operator.podAntiAffinity "hard" }}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels: {{- include "prometheus-operator.operator.matchLabels" . | nindent 16 }}
{{- else if eq .Values.operator.podAntiAffinity "soft" }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels: {{- include "prometheus-operator.operator.matchLabels" . | nindent 18 }}
{{- end }}
{{- if .Values.operator.podAffinity }}
podAffinity: {{- include "prometheus-operator.tplValue" (dict "value" .Values.operator.podAffinity "context" $) | nindent 10 }}
{{- end }}
containers:
- name: {{ template "prometheus-operator.name" . }}
image: {{ template "prometheus-operator.image" . }}
imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
args:
{{- if .Values.operator.kubeletService.enabled }}
- --kubelet-service={{ .Values.operator.kubeletService.namespace }}/{{ template "prometheus-operator.fullname" . }}-kubelet
{{- end }}
{{- if .Values.operator.logFormat }}
- --log-format={{ .Values.operator.logFormat }}
{{- end }}
{{- if .Values.operator.logLevel }}
- --log-level={{ .Values.operator.logLevel }}
{{- end }}
- --logtostderr=true
- --localhost=127.0.0.1
- --config-reloader-image={{ template "prometheus-operator.configmapReload.image" . }}
- --prometheus-config-reloader={{ template "prometheus-operator.prometheusConfigReloader.image" . }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /metrics
port: http
{{ toYaml .Values.operator.livenessProbe | indent 10 }}
readinessProbe:
httpGet:
path: /metrics
port: http
{{ toYaml .Values.operator.readinessProbe | indent 10 }}
resources: {{- toYaml .Values.operator.resources | nindent 10 }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- end }}

View File

@@ -0,0 +1,13 @@
{{- if and .Values.operator.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}-psp
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "prometheus-operator.operator.fullname" . }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if and .Values.operator.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}-psp
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "prometheus-operator.operator.fullname" . }}-psp
subjects:
- kind: ServiceAccount
name: {{ template "prometheus-operator.operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@@ -0,0 +1,39 @@
{{- if and .Values.operator.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: {{ template "podSecurityPolicy.apiVersion" . }}
kind: PodSecurityPolicy
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
spec:
privileged: false
allowPrivilegeEscalation: false
requiredDropCapabilities:
- ALL
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
fsGroup:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
{{- end }}

View File

@@ -0,0 +1,34 @@
{{- if .Values.operator.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
{{- with .Values.operator.service.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.operator.service.type }}
{{- if and .Values.operator.service.loadBalancerIP (eq .Values.operator.service.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.operator.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.operator.service.type "LoadBalancer") .Values.operator.service.loadBalancerSourceRanges }}
{{- with .Values.operator.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- if and (eq .Values.operator.service.type "ClusterIP") .Values.operator.service.clusterIP }}
clusterIP: {{ .Values.operator.service.clusterIP }}
{{- end }}
ports:
- name: http
port: {{ .Values.operator.service.port }}
targetPort: http
{{- if and .Values.operator.service.nodePort (or (eq .Values.operator.service.type "NodePort") (eq .Values.operator.service.type "LoadBalancer")) }}
nodePort: {{ .Values.operator.service.nodePort }}
{{- end }}
selector:
app.kubernetes.io/name: {{ template "prometheus-operator.name" . }}
app.kubernetes.io/component: operator
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

View File

@@ -0,0 +1,8 @@
{{- if and .Values.operator.enabled .Values.operator.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "prometheus-operator.operator.serviceAccountName" . }}
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
{{- include "prometheus-operator.operator.imagePullSecrets" . }}
{{- end }}

View File

@@ -0,0 +1,25 @@
{{- if and .Values.operator.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "prometheus-operator.operator.fullname" . }}
labels: {{- include "prometheus-operator.operator.labels" . | nindent 4 }}
spec:
endpoints:
- port: http
honorLabels: true
{{- if .Values.operator.serviceMonitor.interval }}
interval: {{ .Values.operator.serviceMonitor.interval }}
{{- end }}
{{- if .Values.operator.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- include "prometheus-operator.tplValue" ( dict "value" .Values.operator.serviceMonitor.metricRelabelings "context" $) | nindent 6 }}
{{- end }}
{{- if .Values.operator.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.operator.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
selector:
matchLabels: {{- include "prometheus-operator.operator.matchLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end }}

View File

@@ -0,0 +1,32 @@
{{- if and .Values.prometheus.enabled .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- nodes/metrics
verbs:
- get
- list
- watch
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups:
- extensions
- "networking.k8s.io"
resources:
- ingresses
verbs: ["get", "list", "watch"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if and .Values.prometheus.enabled .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "prometheus-operator.prometheus.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "prometheus-operator.prometheus.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@@ -0,0 +1,29 @@
{{- if and .Values.prometheus.enabled .Values.prometheus.ingress.enabled }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
annotations:
{{- if .Values.prometheus.ingress.certManager }}
kubernetes.io/tls-acme: "true"
{{- end }}
{{- range $key, $value := .Values.prometheus.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range .Values.prometheus.ingress.hosts }}
- host: {{ .name }}
http:
paths:
- path: {{ default "/" .path }}
backend:
serviceName: {{ template "prometheus-operator.prometheus.fullname" $ }}
servicePort: http
{{- end }}
{{- if .Values.prometheus.ingress.tls }}
tls:
{{ toYaml .Values.prometheus.ingress.tls | indent 4 }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,18 @@
{{- if and .Values.prometheus.enabled .Values.prometheus.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app: prometheus
prometheus: {{ template "prometheus-operator.prometheus.fullname" . }}
{{- if .Values.prometheus.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.prometheus.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.prometheus.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.prometheus.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,145 @@
{{- if .Values.prometheus.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.prometheus.replicaCount }}
serviceAccountName: {{ template "prometheus-operator.prometheus.serviceAccountName" . }}
{{- if .Values.prometheus.serviceMonitorSelector }}
serviceMonitorSelector: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.serviceMonitorSelector "context" $) | nindent 4 }}
{{- else }}
serviceMonitorSelector: {}
{{- end }}
alerting:
alertmanagers:
{{- if .Values.prometheus.externalLabels }}
{{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.externalLabels "context" $) | indent 6 }}
{{- else }}
{{- if .Values.alertmanager.enabled }}
- namespace: {{ .Release.Namespace }}
name: {{ template "prometheus-operator.alertmanager.fullname" . }}
port: http
pathPrefix: "/"
{{- else }}
[]
{{- end }}
{{- end }}
{{- if .Values.prometheus.image }}
baseImage: {{ template "prometheus-operator.prometheus.baseImage" . }}
version: {{ .Values.prometheus.image.tag }}
{{- end }}
{{- if .Values.prometheus.externalLabels }}
externalLabels: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.externalLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusExternalLabelNameClear }}
prometheusExternalLabelName: ""
{{- else if .Values.prometheus.prometheusExternalLabelName }}
prometheusExternalLabelName: "{{ .Values.prometheus.prometheusExternalLabelName }}"
{{- end }}
{{- if .Values.prometheus.replicaExternalLabelNameClear }}
replicaExternalLabelName: ""
{{- else if .Values.prometheus.replicaExternalLabelName }}
replicaExternalLabelName: "{{ .Values.prometheus.replicaExternalLabelName }}"
{{- end }}
{{- if and .Values.prometheus.ingress.enabled .Values.prometheus.ingress.hosts }}
externalUrl: {{ if .Values.prometheus.ingress.tls }}https{{else}}http{{ end }}://{{ (index .Values.prometheus.ingress.hosts 0).name }}/
{{- else }}
externalUrl: http://{{ template "prometheus-operator.prometheus.fullname" . }}.{{ .Release.Namespace }}:9090
{{- end }}
paused: {{ .Values.prometheus.paused }}
logLevel: {{ .Values.prometheus.logLevel }}
logFormat: {{ .Values.prometheus.logFormat }}
listenLocal: {{ .Values.prometheus.listenLocal }}
enableAdminAPI: {{ .Values.prometheus.enableAdminAPI }}
{{- if .Values.prometheus.scrapeInterval }}
scrapeInterval: {{ .Values.prometheus.scrapeInterval }}
{{- end }}
{{- if .Values.prometheus.evaluationInterval }}
evaluationInterval: {{ .Values.prometheus.evaluationInterval }}
{{- end }}
resources: {{- toYaml .Values.alertmanager.resources | nindent 4 }}
retention: {{ .Values.prometheus.retention }}
{{- if .Values.prometheus.retentionSize }}
retentionSize: {{ .Values.prometheus.retentionSize }}
{{- end }}
{{- if .Values.prometheus.walCompression }}
walCompression: {{ .Values.prometheus.walCompression }}
{{- end }}
routePrefix: "/"
{{- if .Values.prometheus.secrets }}
secrets: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.secrets "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.configMaps }}
configMaps: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.configMaps "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.serviceMonitorNamespaceSelector }}
serviceMonitorNamespaceSelector: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.serviceMonitorNamespaceSelector "context" $) | nindent 4 }}
{{- else }}
serviceMonitorNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.remoteRead }}
remoteRead: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.remoteRead "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.remoteWrite }}
remoteWrite: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.remoteWrite "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.prometheus.securityContext.runAsUser }}
fsGroup: {{ .Values.prometheus.securityContext.fsGroup }}
{{- end }}
{{- if .Values.prometheus.ruleNamespaceSelector }}
ruleNamespaceSelector: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.ruleNamespaceSelector "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.ruleSelector }}
ruleSelector: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.ruleSelector "context" $) | nindent 4 }}
{{- else }}
ruleSelector: {}
{{- end }}
{{- if .Values.prometheus.storageSpec }}
storage: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.storageSpec "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.podMetadata }}
podMetadata: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.podMetadata "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.querySpec }}
query: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.querySpec "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.nodeSelector }}
nodeSelector: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.nodeSelector "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.tolerations }}
tolerations: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.tolerations "context" $) | nindent 4 }}
{{- end }}
affinity:
{{- if .Values.prometheus.nodeAffinity }}
nodeAffinity: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.nodeAffinity "context" $) | nindent 6 }}
{{- end }}
{{- if eq .Values.prometheus.podAntiAffinity "hard" }}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels: {{- include "prometheus-operator.prometheus.matchLabels" . | nindent 12 }}
{{- else if eq .Values.prometheus.podAntiAffinity "soft" }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels: {{- include "prometheus-operator.prometheus.matchLabels" . | nindent 14 }}
{{- end }}
{{- if .Values.prometheus.podAffinity }}
podAffinity: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.podAffinity "context" $) | nindent 6 }}
{{- end }}
{{- include "prometheus-operator.prometheus.imagePullSecrets" . | indent 2 }}
{{- if .Values.prometheus.containers }}
containers: {{- include "prometheus-operator.tplValue" (dict "value" .Values.prometheus.containers "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.prometheus.priorityClassName }}
priorityClassName: {{ .Values.prometheus.priorityClassName }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,13 @@
{{- if and .Values.prometheus.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}-psp
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "prometheus-operator.prometheus.fullname" . }}
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if and .Values.prometheus.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}-psp
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "prometheus-operator.prometheus.fullname" . }}-psp
subjects:
- kind: ServiceAccount
name: {{ template "prometheus-operator.prometheus.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@@ -0,0 +1,39 @@
{{- if and .Values.prometheus.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: {{ template "podSecurityPolicy.apiVersion" . }}
kind: PodSecurityPolicy
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
spec:
privileged: false
allowPrivilegeEscalation: false
requiredDropCapabilities:
- ALL
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
fsGroup:
rule: 'MustRunAs'
ranges:
- min: 1001
max: 1001
{{- end }}

View File

@@ -0,0 +1,33 @@
{{- if .Values.prometheus.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
{{- with .Values.prometheus.service.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.prometheus.service.type }}
{{- if and .Values.prometheus.service.loadBalancerIP (eq .Values.prometheus.service.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.prometheus.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.prometheus.service.type "LoadBalancer") .Values.prometheus.service.loadBalancerSourceRanges }}
{{- with .Values.prometheus.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- if and (eq .Values.prometheus.service.type "ClusterIP") .Values.prometheus.service.clusterIP }}
clusterIP: {{ .Values.prometheus.service.clusterIP }}
{{- end }}
ports:
- name: http
port: {{ .Values.prometheus.service.port }}
targetPort: 9090
{{- if and .Values.prometheus.service.nodePort (or (eq .Values.prometheus.service.type "NodePort") (eq .Values.prometheus.service.type "LoadBalancer")) }}
nodePort: {{ .Values.prometheus.service.nodePort }}
{{- end }}
selector:
app: prometheus
prometheus: {{ template "prometheus-operator.prometheus.fullname" . }}
{{- end }}

View File

@@ -0,0 +1,8 @@
{{- if and .Values.prometheus.enabled .Values.prometheus.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "prometheus-operator.prometheus.serviceAccountName" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
{{- include "prometheus-operator.prometheus.imagePullSecrets" . }}
{{- end }}

View File

@@ -0,0 +1,25 @@
{{- if and .Values.prometheus.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "prometheus-operator.prometheus.fullname" . }}
labels: {{- include "prometheus-operator.prometheus.labels" . | nindent 4 }}
spec:
selector:
matchLabels: {{- include "prometheus-operator.prometheus.matchLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- if .Values.prometheus.serviceMonitor.interval }}
interval: {{ .Values.prometheus.serviceMonitor.interval }}
{{- end }}
path: "/metrics"
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- include "prometheus-operator.tplValue" ( dict "value" .Values.prometheus.serviceMonitor.metricRelabelings "context" $) | nindent 6 }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.prometheus.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,742 @@
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
global:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
labels: {}
# foo: bar
## String to partially override prometheus.fullname template (will maintain the release name)
##
# nameOverride:
## String to fully override prometheus.fullname template
##
# fullnameOverride:
## Role Based Access
## Ref: https://kubernetes.io/docs/admin/authorization/rbac/
##
rbac:
create: true
## RBAC API version
##
apiVersion: v1beta1
## Podsecuritypolicy
##
pspEnabled: true
operator:
enabled: true
## Bitnami Prometheus Operator image version
## ref: https://hub.docker.com/r/bitnami/prometheus-operator/tags/
##
image:
registry: docker.io
repository: bitnami/prometheus-operator
tag: 0.33.0-debian-9-r0
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Service account for Prometheus Operator to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
## Specifies whether a ServiceAccount should be created
##
create: true
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the prometheus-operator.operator.fullname template
# name:
## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
##
# schedulerName:
## SecurityContext configuration
##
securityContext:
enabled: true
runAsUser: 1001
fsGroup: 1001
## Prometheus Operator Service
##
service:
## Kubernetes service type and port number
##
type: ClusterIP
port: 8080
# clusterIP: None
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort: 30080
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
# loadBalancerIP:
## Load Balancer sources
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
##
# loadBalancerSourceRanges:
# - 10.10.10.0/24
## Provide any additional annotations which may be required.
##
annotations: {}
## Create a servicemonitor for the operator
##
serviceMonitor:
## Scrape interval. If not set, the Prometheus default scrape interval is used.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
##
interval: ""
## Metric relabeling
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
##
metricRelabelings: []
## Relabel configs
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
##
relabelings: []
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
## Pod annotations
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
podAnnotations: {}
## Node Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity
##
nodeAffinity: {}
## Pod AntiAffinity
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAntiAffinity: soft
## Pod Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAffinity: {}
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Configure extra options for liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
livenessProbe:
initialDelaySeconds: 120
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
## Log level for Prometheus Operator
##
logLevel: error
## Log format for Prometheus Operator
##
logFormat: logfmt
## If true, the operator will create and maintain a service for scraping kubelets
##
kubeletService:
enabled: true
namespace: kube-system
## Configmap-reload image to use for reloading configmaps
##
configmapReload:
image:
registry: docker.io
repository: bitnami/configmap-reload
tag: 0.3.0-debian-9-r0
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
prometheusConfigReloader:
image:
registry: docker.io
repository: bitnami/prometheus-operator
tag: 0.33.0-debian-9-r0
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Deploy a Prometheus instance
##
prometheus:
enabled: true
## Bitnami Prometheus image version
## ref: https://hub.docker.com/r/bitnami/prometheus-operator/tags/
##
image:
registry: docker.io
repository: bitnami/prometheus
tag: 2.13.0-debian-9-r10
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Service account for Prometheus to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
## Specifies whether a ServiceAccount should be created
##
create: true
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the prometheus-operator.prometheus.fullname template
# name:
## SecurityContext configuration
##
securityContext:
enabled: true
runAsUser: 1001
fsGroup: 1001
## Configure pod disruption budgets for Prometheus
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
##
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable:
## Prometheus Service
##
service:
## Kubernetes service type and port number
##
type: ClusterIP
port: 9090
# clusterIP: None
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort: 30090
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
# loadBalancerIP:
## Load Balancer sources
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
##
# loadBalancerSourceRanges:
# - 10.10.10.0/24
## Provide any additional annotations which may be required.
##
annotations: {}
serviceMonitor:
## Scrape interval. If not set, the Prometheus default scrape interval is used.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
##
interval: ""
## Metric relabeling
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
##
metricRelabelings: []
## Relabel configs
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
##
relabelings: []
## Configure the ingress resource that allows you to access the
## Alertmanager installation. Set up the URL
## ref: http://kubernetes.io/docs/user-guide/ingress/
##
ingress:
## Set to true to enable ingress record generation
enabled: false
## Set this to true in order to add the corresponding annotations for cert-manager
certManager: false
## Ingress annotations done as key:value pairs
## For a full list of possible ingress annotations, please see
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
##
## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set
## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set
annotations: {}
# kubernetes.io/ingress.class: nginx
## The list of hostnames to be covered with this ingress record.
## Most likely this will be just one host, but in the event more hosts are needed, this is an array
hosts:
- name: prometheus.local
path: /
## The tls configuration for the ingress
## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
## tls:
## - hosts:
## - prometheus.local
## secretName: prometheus.local-tls
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
## Node Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity
##
nodeAffinity: {}
## Pod AntiAffinity
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAntiAffinity: soft
## Pod Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAffinity: {}
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Interval between consecutive scrapes.
##
scrapeInterval: ""
## Interval between consecutive evaluations.
##
evaluationInterval: ""
## ListenLocal makes the Prometheus server listen on loopback, so that it does not bind against the Pod IP.
##
listenLocal: false
## Enable Prometheus adminitrative API
## ref: https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis
##
enableAdminAPI: false
## Alertmanagers to which alerts will be sent
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#alertmanagerendpoints
##
alertingEndpoints: []
## External labels to add to any time series or alerts when communicating with external systems
##
externalLabels: {}
## Name of the external label used to denote replica name
##
replicaExternalLabelName: ""
## If true, the Operator won't add the external label used to denote replica name
##
replicaExternalLabelNameClear: false
## Name of the external label used to denote Prometheus instance name
##
prometheusExternalLabelName: ""
## If true, the Operator won't add the external label used to denote Prometheus instance name
##
prometheusExternalLabelNameClear: false
## Secrets that should be mounted into the Prometheus Pods
##
secrets: []
## ConfigMaps that should be mounted into the Prometheus Pods
##
configMaps: []
## The query command line flags when starting Prometheus
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#queryspec
##
querySpec: {}
## Namespaces to be selected for PrometheusRules discovery
## See https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#namespaceselector for usage
##
ruleNamespaceSelector: {}
## PrometheusRules to be selected for target discovery.
## If {}, select all ServiceMonitors
##
ruleSelector: {}
## ServiceMonitors to be selected for target discovery.
## If {}, select all ServiceMonitors
##
serviceMonitorSelector: {}
# matchLabels:
# foo: bar
## Namespaces to be selected for ServiceMonitor discovery.
## See https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#namespaceselector for usage
##
serviceMonitorNamespaceSelector: {}
## How long to retain metrics
##
retention: 30d
## Maximum size of metrics
##
retentionSize: ""
## Enable compression of the write-ahead log using Snappy.
##
walCompression: false
## If true, the Operator won't process any Prometheus configuration changes
##
paused: false
## Desired number of Prometheus nodes
##
replicaCount: 3
## Log level for Prometheus
##
logLevel: error
## Log format for Prometheus
##
logFormat: logfmt
## Standard objects metadata
## ref: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
##
podMetadata: {}
# labels:
# app: prometheus
# k8s-app: prometheus
## The remote_read spec configuration for Prometheus.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#remotereadspec
##
remoteRead: []
# - url: http://remote1/read
## The remote_write spec configuration for Prometheus.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#remotewritespec
##
remoteWrite: []
# - url: http://remote1/push
## Prometheus StorageSpec for persistent data
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/storage.md
##
storageSpec: {}
## Priority class assigned to the Pods
##
priorityClassName: ""
## Containers allows injecting additional containers
##
containers: []
## Enable additional scrape configs that are managed externally to this chart
##
additionalScrapeConfigsExternal: false
## Configuration for alertmanager
## ref: https://prometheus.io/docs/alerting/alertmanager/
##
alertmanager:
enabled: true
## Bitnami Alertmanager image version
## ref: https://hub.docker.com/r/bitnami/prometheus-operator/tags/
##
image:
registry: docker.io
repository: bitnami/alertmanager
tag: 0.19.0-debian-9-r43
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Service account for Alertmanager to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
## Specifies whether a ServiceAccount should be created
##
create: true
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the prometheus-operator.alertmanager.fullname template
# name:
## SecurityContext configuration
##
securityContext:
enabled: true
runAsUser: 1001
fsGroup: 1001
## Configure pod disruption budgets for Alertmanager
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
##
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable:
## Alertmanager Service
##
service:
## Kubernetes service type and port number
##
type: ClusterIP
port: 9093
# clusterIP: None
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort: 30093
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
# loadBalancerIP:
## Load Balancer sources
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
##
# loadBalancerSourceRanges:
# - 10.10.10.0/24
## Provide any additional annotations which may be required.
##
annotations: {}
## If true, create a serviceMonitor for alertmanager
##
serviceMonitor:
## Scrape interval. If not set, the Prometheus default scrape interval is used.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
##
interval: ""
## Metric relabeling
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
##
metricRelabelings: []
## Relabel configs
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
##
relabelings: []
## Configure the ingress resource that allows you to access the
## Alertmanager installation. Set up the URL
## ref: http://kubernetes.io/docs/user-guide/ingress/
##
ingress:
## Set to true to enable ingress record generation
enabled: false
## Set this to true in order to add the corresponding annotations for cert-manager
certManager: false
## Ingress annotations done as key:value pairs
## For a full list of possible ingress annotations, please see
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
##
## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set
## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set
annotations: {}
# kubernetes.io/ingress.class: nginx
## The list of hostnames to be covered with this ingress record.
## Most likely this will be just one host, but in the event more hosts are needed, this is an array
hosts:
- name: alertmanager.local
path: /
## The tls configuration for the ingress
## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
## tls:
## - hosts:
## - alertmanager.local
## secretName: alertmanager.local-tls
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
## Node Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity
##
nodeAffinity: {}
## Pod AntiAffinity
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAntiAffinity: soft
## Pod Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAffinity: {}
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Alertmanager configuration
## ref: https://prometheus.io/docs/alerting/configuration/#configuration-file
##
config:
global:
resolve_timeout: 5m
route:
group_by: ['job']
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'null'
routes:
- match:
alertname: Watchdog
receiver: 'null'
receivers:
- name: 'null'
## Desired number of Alertmanager nodes
##
replicaCount: 3
## Log level for Alertmanager
##
logLevel: error
## Log format for Alertmanager
##
logFormat: logfmt
## Standard objects metadata.
## ref: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
##
podMetadata: {}
## Secrets that should be mounted into the Alertmanager Pods
##
secrets: []
## ConfigMaps that should be mounted into the Alertmanager Pods
##
configMaps: []
## Metrics retention
##
retention: 120h
## Alertmanager StorageSpec for persistent data
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/storage.md
##
storageSpec: {}
## If true, the Operator won't process any Alertmanager configuration changes
##
paused: false
## ListenLocal makes the Alertmanager server listen on loopbac
##
listenLocal: false
## Containers allows injecting additional containers
##
containers: []
## Priority class assigned to the Pods
##
priorityClassName: ""
## AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster.
##
additionalPeers: []

View File

@@ -0,0 +1,742 @@
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
global:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
labels: {}
# foo: bar
## String to partially override prometheus.fullname template (will maintain the release name)
##
# nameOverride:
## String to fully override prometheus.fullname template
##
# fullnameOverride:
## Role Based Access
## Ref: https://kubernetes.io/docs/admin/authorization/rbac/
##
rbac:
create: true
## RBAC API version
##
apiVersion: v1beta1
## Podsecuritypolicy
##
pspEnabled: true
operator:
enabled: true
## Bitnami Prometheus Operator image version
## ref: https://hub.docker.com/r/bitnami/prometheus-operator/tags/
##
image:
registry: docker.io
repository: bitnami/prometheus-operator
tag: 0.33.0-debian-9-r0
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Service account for Prometheus Operator to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
## Specifies whether a ServiceAccount should be created
##
create: true
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the prometheus-operator.operator.fullname template
# name:
## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
##
# schedulerName:
## SecurityContext configuration
##
securityContext:
enabled: true
runAsUser: 1001
fsGroup: 1001
## Prometheus Operator Service
##
service:
## Kubernetes service type and port number
##
type: ClusterIP
port: 8080
# clusterIP: None
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort: 30080
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
# loadBalancerIP:
## Load Balancer sources
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
##
# loadBalancerSourceRanges:
# - 10.10.10.0/24
## Provide any additional annotations which may be required.
##
annotations: {}
## Create a servicemonitor for the operator
##
serviceMonitor:
## Scrape interval. If not set, the Prometheus default scrape interval is used.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
##
interval: ""
## Metric relabeling
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
##
metricRelabelings: []
## Relabel configs
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
##
relabelings: []
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
## Pod annotations
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
podAnnotations: {}
## Node Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity
##
nodeAffinity: {}
## Pod AntiAffinity
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAntiAffinity: soft
## Pod Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAffinity: {}
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Configure extra options for liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
livenessProbe:
initialDelaySeconds: 120
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
## Log level for Prometheus Operator
##
logLevel: info
## Log format for Prometheus Operator
##
logFormat: logfmt
## If true, the operator will create and maintain a service for scraping kubelets
##
kubeletService:
enabled: true
namespace: kube-system
## Configmap-reload image to use for reloading configmaps
##
configmapReload:
image:
registry: docker.io
repository: bitnami/configmap-reload
tag: 0.3.0-debian-9-r0
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
prometheusConfigReloader:
image:
registry: docker.io
repository: bitnami/prometheus-operator
tag: 0.33.0-debian-9-r0
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Deploy a Prometheus instance
##
prometheus:
enabled: true
## Bitnami Prometheus image version
## ref: https://hub.docker.com/r/bitnami/prometheus-operator/tags/
##
image:
registry: docker.io
repository: bitnami/prometheus
tag: 2.13.0-debian-9-r10
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Service account for Prometheus to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
## Specifies whether a ServiceAccount should be created
##
create: true
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the prometheus-operator.prometheus.fullname template
# name:
## SecurityContext configuration
##
securityContext:
enabled: true
runAsUser: 1001
fsGroup: 1001
## Configure pod disruption budgets for Prometheus
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
##
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable:
## Prometheus Service
##
service:
## Kubernetes service type and port number
##
type: ClusterIP
port: 9090
# clusterIP: None
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort: 30090
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
# loadBalancerIP:
## Load Balancer sources
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
##
# loadBalancerSourceRanges:
# - 10.10.10.0/24
## Provide any additional annotations which may be required.
##
annotations: {}
serviceMonitor:
## Scrape interval. If not set, the Prometheus default scrape interval is used.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
##
interval: ""
## Metric relabeling
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
##
metricRelabelings: []
## Relabel configs
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
##
relabelings: []
## Configure the ingress resource that allows you to access the
## Alertmanager installation. Set up the URL
## ref: http://kubernetes.io/docs/user-guide/ingress/
##
ingress:
## Set to true to enable ingress record generation
enabled: false
## Set this to true in order to add the corresponding annotations for cert-manager
certManager: false
## Ingress annotations done as key:value pairs
## For a full list of possible ingress annotations, please see
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
##
## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set
## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set
annotations: {}
# kubernetes.io/ingress.class: nginx
## The list of hostnames to be covered with this ingress record.
## Most likely this will be just one host, but in the event more hosts are needed, this is an array
hosts:
- name: prometheus.local
path: /
## The tls configuration for the ingress
## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
## tls:
## - hosts:
## - prometheus.local
## secretName: prometheus.local-tls
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
## Node Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity
##
nodeAffinity: {}
## Pod AntiAffinity
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAntiAffinity: soft
## Pod Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAffinity: {}
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Interval between consecutive scrapes.
##
scrapeInterval: ""
## Interval between consecutive evaluations.
##
evaluationInterval: ""
## ListenLocal makes the Prometheus server listen on loopback, so that it does not bind against the Pod IP.
##
listenLocal: false
## Enable Prometheus adminitrative API
## ref: https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis
##
enableAdminAPI: false
## Alertmanagers to which alerts will be sent
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#alertmanagerendpoints
##
alertingEndpoints: []
## External labels to add to any time series or alerts when communicating with external systems
##
externalLabels: {}
## Name of the external label used to denote replica name
##
replicaExternalLabelName: ""
## If true, the Operator won't add the external label used to denote replica name
##
replicaExternalLabelNameClear: false
## Name of the external label used to denote Prometheus instance name
##
prometheusExternalLabelName: ""
## If true, the Operator won't add the external label used to denote Prometheus instance name
##
prometheusExternalLabelNameClear: false
## Secrets that should be mounted into the Prometheus Pods
##
secrets: []
## ConfigMaps that should be mounted into the Prometheus Pods
##
configMaps: []
## The query command line flags when starting Prometheus
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#queryspec
##
querySpec: {}
## Namespaces to be selected for PrometheusRules discovery
## See https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#namespaceselector for usage
##
ruleNamespaceSelector: {}
## PrometheusRules to be selected for target discovery.
## If {}, select all ServiceMonitors
##
ruleSelector: {}
## ServiceMonitors to be selected for target discovery.
## If {}, select all ServiceMonitors
##
serviceMonitorSelector: {}
# matchLabels:
# foo: bar
## Namespaces to be selected for ServiceMonitor discovery.
## See https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#namespaceselector for usage
##
serviceMonitorNamespaceSelector: {}
## How long to retain metrics
##
retention: 10d
## Maximum size of metrics
##
retentionSize: ""
## Enable compression of the write-ahead log using Snappy.
##
walCompression: false
## If true, the Operator won't process any Prometheus configuration changes
##
paused: false
## Desired number of Prometheus nodes
##
replicaCount: 1
## Log level for Prometheus
##
logLevel: info
## Log format for Prometheus
##
logFormat: logfmt
## Standard objects metadata
## ref: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
##
podMetadata: {}
# labels:
# app: prometheus
# k8s-app: prometheus
## The remote_read spec configuration for Prometheus.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#remotereadspec
##
remoteRead: []
# - url: http://remote1/read
## The remote_write spec configuration for Prometheus.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#remotewritespec
##
remoteWrite: []
# - url: http://remote1/push
## Prometheus StorageSpec for persistent data
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/storage.md
##
storageSpec: {}
## Priority class assigned to the Pods
##
priorityClassName: ""
## Containers allows injecting additional containers
##
containers: []
## Enable additional scrape configs that are managed externally to this chart
##
additionalScrapeConfigsExternal: false
## Configuration for alertmanager
## ref: https://prometheus.io/docs/alerting/alertmanager/
##
alertmanager:
enabled: true
## Bitnami Alertmanager image version
## ref: https://hub.docker.com/r/bitnami/prometheus-operator/tags/
##
image:
registry: docker.io
repository: bitnami/alertmanager
tag: 0.19.0-debian-9-r43
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Service account for Alertmanager to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
serviceAccount:
## Specifies whether a ServiceAccount should be created
##
create: true
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the prometheus-operator.alertmanager.fullname template
# name:
## SecurityContext configuration
##
securityContext:
enabled: true
runAsUser: 1001
fsGroup: 1001
## Configure pod disruption budgets for Alertmanager
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
##
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable:
## Alertmanager Service
##
service:
## Kubernetes service type and port number
##
type: ClusterIP
port: 9093
# clusterIP: None
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort: 30093
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
# loadBalancerIP:
## Load Balancer sources
## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
##
# loadBalancerSourceRanges:
# - 10.10.10.0/24
## Provide any additional annotations which may be required.
##
annotations: {}
## If true, create a serviceMonitor for alertmanager
##
serviceMonitor:
## Scrape interval. If not set, the Prometheus default scrape interval is used.
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
##
interval: ""
## Metric relabeling
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
##
metricRelabelings: []
## Relabel configs
## ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
##
relabelings: []
## Configure the ingress resource that allows you to access the
## Alertmanager installation. Set up the URL
## ref: http://kubernetes.io/docs/user-guide/ingress/
##
ingress:
## Set to true to enable ingress record generation
enabled: false
## Set this to true in order to add the corresponding annotations for cert-manager
certManager: false
## Ingress annotations done as key:value pairs
## For a full list of possible ingress annotations, please see
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
##
## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set
## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set
annotations: {}
# kubernetes.io/ingress.class: nginx
## The list of hostnames to be covered with this ingress record.
## Most likely this will be just one host, but in the event more hosts are needed, this is an array
hosts:
- name: alertmanager.local
path: /
## The tls configuration for the ingress
## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
## tls:
## - hosts:
## - alertmanager.local
## secretName: alertmanager.local-tls
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
## Node Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity
##
nodeAffinity: {}
## Pod AntiAffinity
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAntiAffinity: soft
## Pod Affinity. The value is evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
podAffinity: {}
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Alertmanager configuration
## ref: https://prometheus.io/docs/alerting/configuration/#configuration-file
##
config:
global:
resolve_timeout: 5m
route:
group_by: ['job']
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'null'
routes:
- match:
alertname: Watchdog
receiver: 'null'
receivers:
- name: 'null'
## Desired number of Alertmanager nodes
##
replicaCount: 1
## Log level for Alertmanager
##
logLevel: info
## Log format for Alertmanager
##
logFormat: logfmt
## Standard objects metadata.
## ref: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
##
podMetadata: {}
## Secrets that should be mounted into the Alertmanager Pods
##
secrets: []
## ConfigMaps that should be mounted into the Alertmanager Pods
##
configMaps: []
## Metrics retention
##
retention: 120h
## Alertmanager StorageSpec for persistent data
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/storage.md
##
storageSpec: {}
## If true, the Operator won't process any Alertmanager configuration changes
##
paused: false
## ListenLocal makes the Alertmanager server listen on loopbac
##
listenLocal: false
## Containers allows injecting additional containers
##
containers: []
## Priority class assigned to the Pods
##
priorityClassName: ""
## AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster.
##
additionalPeers: []