From 413151dd318ee35e0527b3b25e85f2b7a003f132 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 25 Oct 2019 16:12:01 +0530 Subject: [PATCH] [bitnami/zookepper] adds servicemonitor support Signed-off-by: Sameer Naik --- bitnami/zookeeper/Chart.yaml | 2 +- bitnami/zookeeper/README.md | 167 +++++++++--------- .../zookeeper/templates/servicemonitor.yaml | 36 ++++ bitnami/zookeeper/values-production.yaml | 24 +++ bitnami/zookeeper/values.yaml | 24 +++ 5 files changed, 171 insertions(+), 82 deletions(-) create mode 100644 bitnami/zookeeper/templates/servicemonitor.yaml diff --git a/bitnami/zookeeper/Chart.yaml b/bitnami/zookeeper/Chart.yaml index bfefef748c..c4a97dd20f 100644 --- a/bitnami/zookeeper/Chart.yaml +++ b/bitnami/zookeeper/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: zookeeper -version: 5.0.7 +version: 5.1.0 appVersion: 3.5.6 description: A centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services for distributed applications. keywords: diff --git a/bitnami/zookeeper/README.md b/bitnami/zookeeper/README.md index 0819e90d74..1e1647571f 100644 --- a/bitnami/zookeeper/README.md +++ b/bitnami/zookeeper/README.md @@ -48,87 +48,92 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the ZooKeeper chart and their default values. -| 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` | -| `image.registry` | ZooKeeper image registry | `docker.io` | -| `image.repository` | ZooKeeper Image name | `bitnami/zookeeper` | -| `image.tag` | ZooKeeper Image tag | `{TAG_NAME}` | -| `image.pullPolicy` | ZooKeeper image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `image.debug` | Specify if debug values should be set | `false` | -| `nameOverride` | String to partially override zookeeper.fullname template with a string (will append the release name) | `nil` | -| `fullnameOverride` | String to fully override zookeeper.fullname template with a string | `nil` | -| `volumePermissions.enabled` | Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) | `false` | -| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | -| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` | -| `volumePermissions.image.tag` | Init container volume-permissions image tag | `stretch` | -| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` | -| `volumePermissions.resources` | Init container resource requests/limit | `nil` | -| `updateStrategy` | Update strategies | `RollingUpdate` | -| `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` | -| `rollingUpdatePartition` | Partition update strategy | `nil` | -| `clusterDomain` | Kubernetes cluster domain | `cluster.local` | -| `podManagementpolicy` | Pod management policy | `Parallel` | -| `replicaCount` | Number of ZooKeeper nodes | `1` | -| `tickTime` | Basic time unit in milliseconds used by ZooKeeper for heartbeats | `2000` | -| `initLimit` | Time the ZooKeeper servers in quorum have to connect to a leader | `10` | -| `syncLimit` | How far out of date a server can be from a leader | `5` | -| `maxClientCnxns` | Number of concurrent connections that a single client may make to a single member | `60` | -| `fourlwCommandsWhitelist` | A list of comma separated Four Letter Words commands to use | `srvr, mntr` | -| `allowAnonymousLogin` | Allow to accept connections from unauthenticated users | `yes` | -| `auth.existingSecret` | Use existing secret (ignores previous password) | `nil` | -| `auth.enabled` | Enable ZooKeeper auth | `false` | -| `auth.clientUser` | User that will use ZooKeeper clients to auth | `nil` | -| `auth.clientPassword` | Password that will use ZooKeeper clients to auth | `nil` | -| `auth.serverUsers` | List of user to be created | `nil` | -| `auth.serverPasswords` | List of passwords to assign to users when created | `nil` | -| `heapSize` | Size in MB for the Java Heap options (Xmx and XMs) | `[]` | -| `logLevel` | Log level of ZooKeeper server | `ERROR` | -| `jvmFlags` | Default JVMFLAGS for the ZooKeeper process | `nil` | -| `config` | Configure ZooKeeper with a custom zoo.conf file | `nil` | -| `service.type` | Kubernetes Service type | `ClusterIP` | -| `service.port` | ZooKeeper port | `2181` | -| `service.followerPort` | ZooKeeper follower port | `2888` | -| `service.electionPort` | ZooKeeper election port | `3888` | -| `service.publishNotReadyAddresses` | If the ZooKeeper headless service should publish DNS records for not ready pods | `true` | -| `securityContext.enabled` | Enable security context (ZooKeeper master pod) | `true` | -| `securityContext.fsGroup` | Group ID for the container (ZooKeeper master pod) | `1001` | -| `securityContext.runAsUser` | User ID for the container (ZooKeeper master pod) | `1001` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.storageClass` | PVC Storage Class for ZooKeeper volume | `nil` | -| `persistence.accessMode` | PVC Access Mode for ZooKeeper volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for ZooKeeper volume | `8Gi` | -| `persistence.annotations` | Annotations for the PVC | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | Toleration labels for pod assignment | `[]` | -| `affinity` | Map of node/pod affinities | `{}` | -| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` | -| `livenessProbe.enabled` | Would you like a livenessProbe to be enabled | `true` | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 | -| `livenessProbe.periodSeconds` | How often to perform the probe | 10 | -| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | -| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | 6 | -| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | -| `readinessProbe.enabled` | Would you like a readinessProbe to be enabled | `true` | -| `readinessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 5 | -| `readinessProbe.periodSeconds` | How often to perform the probe | 10 | -| `readinessProbe.timeoutSeconds` | When the probe times out | 5 | -| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | 6 | -| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | -| `metrics.enabled` | Start a side-car prometheus exporter | `false` | -| `metrics.image.registry` | ZooKeeper exporter image registry | `docker.io` | -| `metrics.image.repository` | ZooKeeper exporter image name | `bitnami/zookeeper-exporter` | -| `metrics.image.tag` | ZooKeeper exporter image tag | `{TAG_NAME}` | -| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | -| `metrics.podLabels` | Additional labels for Metrics exporter pod | `{}` | -| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9141"}` | -| `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` | -| `metrics.tolerations` | Exporter toleration labels for pod assignment | `[]` | -| `metrics.timeoutSeconds` | Timeout in seconds the exporter uses to scrape its targets | 3 | +| 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` | | +| `image.registry` | ZooKeeper image registry | `docker.io` | | +| `image.repository` | ZooKeeper Image name | `bitnami/zookeeper` | | +| `image.tag` | ZooKeeper Image tag | `{TAG_NAME}` | | +| `image.pullPolicy` | ZooKeeper image pull policy | `IfNotPresent` | | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | +| `image.debug` | Specify if debug values should be set | `false` | | +| `nameOverride` | String to partially override zookeeper.fullname template with a string (will append the release name) | `nil` | | +| `fullnameOverride` | String to fully override zookeeper.fullname template with a string | `nil` | | +| `volumePermissions.enabled` | Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) | `false` | | +| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | | +| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` | | +| `volumePermissions.image.tag` | Init container volume-permissions image tag | `stretch` | | +| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` | | +| `volumePermissions.resources` | Init container resource requests/limit | `nil` | | +| `updateStrategy` | Update strategies | `RollingUpdate` | | +| `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` | | +| `rollingUpdatePartition` | Partition update strategy | `nil` | | +| `clusterDomain` | Kubernetes cluster domain | `cluster.local` | | +| `podManagementpolicy` | Pod management policy | `Parallel` | | +| `replicaCount` | Number of ZooKeeper nodes | `1` | | +| `tickTime` | Basic time unit in milliseconds used by ZooKeeper for heartbeats | `2000` | | +| `initLimit` | Time the ZooKeeper servers in quorum have to connect to a leader | `10` | | +| `syncLimit` | How far out of date a server can be from a leader | `5` | | +| `maxClientCnxns` | Number of concurrent connections that a single client may make to a single member | `60` | | +| `fourlwCommandsWhitelist` | A list of comma separated Four Letter Words commands to use | `srvr, mntr` | | +| `allowAnonymousLogin` | Allow to accept connections from unauthenticated users | `yes` | | +| `auth.existingSecret` | Use existing secret (ignores previous password) | `nil` | | +| `auth.enabled` | Enable ZooKeeper auth | `false` | | +| `auth.clientUser` | User that will use ZooKeeper clients to auth | `nil` | | +| `auth.clientPassword` | Password that will use ZooKeeper clients to auth | `nil` | | +| `auth.serverUsers` | List of user to be created | `nil` | | +| `auth.serverPasswords` | List of passwords to assign to users when created | `nil` | | +| `heapSize` | Size in MB for the Java Heap options (Xmx and XMs) | `[]` | | +| `logLevel` | Log level of ZooKeeper server | `ERROR` | | +| `jvmFlags` | Default JVMFLAGS for the ZooKeeper process | `nil` | | +| `config` | Configure ZooKeeper with a custom zoo.conf file | `nil` | | +| `service.type` | Kubernetes Service type | `ClusterIP` | | +| `service.port` | ZooKeeper port | `2181` | | +| `service.followerPort` | ZooKeeper follower port | `2888` | | +| `service.electionPort` | ZooKeeper election port | `3888` | | +| `service.publishNotReadyAddresses` | If the ZooKeeper headless service should publish DNS records for not ready pods | `true` | | +| `securityContext.enabled` | Enable security context (ZooKeeper master pod) | `true` | | +| `securityContext.fsGroup` | Group ID for the container (ZooKeeper master pod) | `1001` | | +| `securityContext.runAsUser` | User ID for the container (ZooKeeper master pod) | `1001` | | +| `persistence.enabled` | Enable persistence using PVC | `true` | | +| `persistence.storageClass` | PVC Storage Class for ZooKeeper volume | `nil` | | +| `persistence.accessMode` | PVC Access Mode for ZooKeeper volume | `ReadWriteOnce` | | +| `persistence.size` | PVC Storage Request for ZooKeeper volume | `8Gi` | | +| `persistence.annotations` | Annotations for the PVC | `{}` | | +| `nodeSelector` | Node labels for pod assignment | `{}` | | +| `tolerations` | Toleration labels for pod assignment | `[]` | | +| `affinity` | Map of node/pod affinities | `{}` | | +| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` | | +| `livenessProbe.enabled` | Would you like a livenessProbe to be enabled | `true` | | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 | | +| `livenessProbe.periodSeconds` | How often to perform the probe | 10 | | +| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | 6 | | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | | +| `readinessProbe.enabled` | Would you like a readinessProbe to be enabled | `true` | | +| `readinessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 5 | | +| `readinessProbe.periodSeconds` | How often to perform the probe | 10 | | +| `readinessProbe.timeoutSeconds` | When the probe times out | 5 | | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded | 6 | | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | | +| `metrics.enabled` | Start a side-car prometheus exporter | `false` | | +| `metrics.image.registry` | ZooKeeper exporter image registry | `docker.io` | | +| `metrics.image.repository` | ZooKeeper exporter image name | `bitnami/zookeeper-exporter` | | +| `metrics.image.tag` | ZooKeeper exporter image tag | `{TAG_NAME}` | | +| `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | | +| `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | | +| `metrics.podLabels` | Additional labels for Metrics exporter pod | `{}` | | +| `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9141"}` | | +| `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` | | +| `metrics.tolerations` | Exporter toleration labels for pod assignment | `[]` | | +| `metrics.timeoutSeconds` | Timeout in seconds the exporter uses to scrape its targets | 3 | | +| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` | | +| `metrics.serviceMonitor.namespace` | Namespace in which Prometheus is running | `nil` | | +| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. | `nil` (Prometheus Operator default value) | | +| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `nil` (Prometheus Operator default value) | | +| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `nil` | | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/zookeeper/templates/servicemonitor.yaml b/bitnami/zookeeper/templates/servicemonitor.yaml new file mode 100644 index 0000000000..55b958ccb5 --- /dev/null +++ b/bitnami/zookeeper/templates/servicemonitor.yaml @@ -0,0 +1,36 @@ +{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "zookeeper.fullname" . }} + {{- if .Values.metrics.serviceMonitor.namespace }} + namespace: {{ .Values.metrics.serviceMonitor.namespace }} + {{- end }} + labels: + app.kubernetes.io/name: {{ template "zookeeper.name" . }} + helm.sh/chart: {{ template "zookeeper.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: metrics + {{- range $key, $value := .Values.metrics.serviceMonitor.selector }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ template "zookeeper.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: metrics + endpoints: + - port: metrics + path: "/metrics" + {{- if .Values.metrics.serviceMonitor.interval }} + interval: {{ .Values.metrics.serviceMonitor.interval }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} diff --git a/bitnami/zookeeper/values-production.yaml b/bitnami/zookeeper/values-production.yaml index 0d81a750a8..7b938b541f 100644 --- a/bitnami/zookeeper/values-production.yaml +++ b/bitnami/zookeeper/values-production.yaml @@ -251,3 +251,27 @@ metrics: ## Metrics exporter labels and tolerations for pod assignment # nodeSelector: {"beta.kubernetes.io/arch": "amd64"} # tolerations: [] + + ## Prometheus Operator ServiceMonitor configuration + ## + serviceMonitor: + enabled: false + ## Namespace in which Prometheus is running + ## + # namespace: monitoring + + ## Interval at which metrics should be scraped. + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## + # interval: 10s + + ## Timeout after which the scrape is ended + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## + # scrapeTimeout: 10s + + ## ServiceMonitor selector labels + ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration + ## + # selector: + # prometheus: my-prometheus diff --git a/bitnami/zookeeper/values.yaml b/bitnami/zookeeper/values.yaml index 806131a3f2..b5122fcb55 100644 --- a/bitnami/zookeeper/values.yaml +++ b/bitnami/zookeeper/values.yaml @@ -251,3 +251,27 @@ metrics: ## Metrics exporter labels and tolerations for pod assignment # nodeSelector: {"beta.kubernetes.io/arch": "amd64"} # tolerations: [] + + ## Prometheus Operator ServiceMonitor configuration + ## + serviceMonitor: + enabled: false + ## Namespace in which Prometheus is running + ## + # namespace: monitoring + + ## Interval at which metrics should be scraped. + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## + # interval: 10s + + ## Timeout after which the scrape is ended + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## + # scrapeTimeout: 10s + + ## ServiceMonitor selector labels + ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration + ## + # selector: + # prometheus: my-prometheus