From 8ab7211d8e303aee820ec86bbb41f703442a6756 Mon Sep 17 00:00:00 2001 From: juan131 Date: Wed, 16 Oct 2019 15:51:40 +0200 Subject: [PATCH] [bitnami/kafka] Add Metrics Servicemonitor Signed-off-by: juan131 --- bitnami/kafka/Chart.yaml | 2 +- bitnami/kafka/README.md | 248 ++++++++++---------- bitnami/kafka/templates/servicemonitor.yaml | 46 ++++ bitnami/kafka/values-production.yaml | 12 + bitnami/kafka/values.yaml | 12 + 5 files changed, 197 insertions(+), 123 deletions(-) create mode 100644 bitnami/kafka/templates/servicemonitor.yaml diff --git a/bitnami/kafka/Chart.yaml b/bitnami/kafka/Chart.yaml index ac68fd383..f4ec44b4c 100644 --- a/bitnami/kafka/Chart.yaml +++ b/bitnami/kafka/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: kafka -version: 6.0.2 +version: 6.1.0 appVersion: 2.3.0 description: Apache Kafka is a distributed streaming platform. keywords: diff --git a/bitnami/kafka/README.md b/bitnami/kafka/README.md index a03dc6d78..9f303dac0 100644 --- a/bitnami/kafka/README.md +++ b/bitnami/kafka/README.md @@ -48,128 +48,132 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Kafka 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` | Kafka image registry | `docker.io` | -| `image.repository` | Kafka Image name | `bitnami/kafka` | -| `image.tag` | Kafka Image tag | `{VERSION}` | -| `image.pullPolicy` | Kafka 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 kafka.fullname template with a string (will append the release name) | `nil` | -| `fullnameOverride` | String to fully override kafka.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 strategy for the stateful set | `RollingUpdate` | -| `rollingUpdatePartition` | Partition update strategy | `nil` | -| `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` | -| `replicaCount` | Number of Kafka nodes | `1` | -| `config` | Configuration file for Kafka | `nil` | -| `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` | -| `listeners` | The address the socket server listens on. | `nil` | -| `advertisedListeners` | Hostname and port the broker will advertise to producers and consumers. | `nil` | -| `listenerSecurityProtocolMap` | The protocol->listener mapping. | `nil` | -| `interBrokerListenerName` | The listener that the brokers should communicate on. | `nil` | -| `brokerId` | ID of the Kafka node | `-1` | -| `deleteTopicEnable` | Switch to enable topic deletion or not. | `false` | -| `heapOpts` | Kafka's Java Heap size. | `-Xmx1024m -Xms1024m` | -| `logFlushIntervalMessages` | The number of messages to accept before forcing a flush of data to disk. | `10000` | -| `logFlushIntervalMs` | The maximum amount of time a message can sit in a log before we force a flush. | `1000` | -| `logRetentionBytes` | A size-based retention policy for logs. | `_1073741824` | -| `logRetentionCheckIntervalMs` | The interval at which log segments are checked to see if they can be deleted. | `300000` | -| `logRetentionHours` | The minimum age of a log file to be eligible for deletion due to age. | `168` | -| `logSegmentBytes` | The maximum size of a log segment file. When this size is reached a new log segment will be created. | `_1073741824` | -| `logMessageFormatVersion` | Logging message format version. | `` | -| `logsDirs` | A comma separated list of directories under which to store log files. | `/bitnami/kafka/data` | -| `maxMessageBytes` | The largest record batch size allowed by Kafka. | `1000012` | -| `defaultReplicationFactor` | Default replication factors for automatically created topics | `1` | -| `offsetsTopicReplicationFactor` | The replication factor for the offsets topic | `1` | -| `transactionStateLogReplicationFactor ` | The replication factor for the transaction topic | `1` | -| `transactionStateLogMinIsr ` | Overridden min.insync.replicas config for the transaction topic | `1` | -| `numIoThreads` | The number of threads doing disk I/O. | `8` | -| `numNetworkThreads` | The number of threads handling network requests. | `3` | -| `numPartitions` | The default number of log partitions per topic. | `1` | -| `numRecoveryThreadsPerDataDir` | The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. | `1` | -| `socketReceiveBufferBytes` | The receive buffer (SO_RCVBUF) used by the socket server. | `102400` | -| `socketRequestMaxBytes` | The maximum size of a request that the socket server will accept (protection against OOM). | `_104857600` | -| `socketSendBufferBytes` | The send buffer (SO_SNDBUF) used by the socket server. | `102400` | -| `zookeeperConnectionTimeoutMs` | Timeout in ms for connecting to Zookeeper. | `6000` | -| `extraEnvVars` | Extra environment variables to add to kafka pods | `nil` | -| `sslEndpointIdentificationAlgorithm` | The endpoint identification algorithm to validate server hostname using server certificate. | `https` | -| `auth.enabled` | Switch to enable the kafka authentication. | `false` | -| `auth.existingSecret` | Name of the existing secret containing credentials for brokerUser, interBrokerUser and zookeeperUser. | `nil` | -| `auth.certificatesSecret` | Name of the existing secret containing the certificate files that will be used by Kafka. | `nil` | -| `auth.certificatesPassword` | Password for the above certificates if they are password protected. | `nil` | -| `auth.brokerUser` | Kafka client user. | `user` | -| `auth.brokerPassword` | Kafka client password. | `nil` | -| `auth.interBrokerUser` | Kafka inter broker communication user | `admin` | -| `auth.interBrokerPassword` | Kafka inter broker communication password. | `nil` | -| `auth.zookeeperUser` | Kafka Zookeeper user. | `nil` | -| `auth.zookeeperPassword` | Kafka Zookeeper password. | `nil` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the container | `1001` | -| `securityContext.runAsUser` | User ID for the container | `1001` | -| `clusterDomain` | Kubernetes cluster domain | `cluster.local` | -| `service.type` | Kubernetes Service type | `ClusterIP` | -| `service.port` | Kafka port | `9092` | -| `service.nodePort` | Kubernetes Service nodePort | `nil` | -| `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `nil` | -| `service.annotations` | Service annotations | `` | -| `persistence.enabled` | Enable Kafka persistence using PVC, note that Zookeeper perisstency is unaffected | `true` | -| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. | `nil` | -| `persistence.storageClass` | PVC Storage Class for Kafka volume | `nil` | -| `persistence.accessMode` | PVC Access Mode for Kafka volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for Kafka 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 livessProbed 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.kafka.enabled` | Whether or not to create a separate Kafka exporter | `false` | -| `metrics.kafka.image.registry` | Kafka exporter image registry | `docker.io` | -| `metrics.kafka.image.repository` | Kafka exporter image name | `bitnami/kafka-exporter` | -| `metrics.kafka.image.tag` | Kafka exporter image tag | `{TAG_NAME}` | -| `metrics.kafka.image.pullPolicy` | Kafka exporter image pull policy | `IfNotPresent` | -| `metrics.kafka.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `metrics.kafka.interval` | Interval that Prometheus scrapes Kafka metrics when using Prometheus Operator | `10s` | -| `metrics.kafka.port` | Kafka Exporter Port which exposes metrics in Prometheus format for scraping | `9308` | -| `metrics.kafka.resources` | Allows setting resource limits for kafka-exporter pod | `{}` | -| `metrics.jmx.resources` | Allows setting resource limits for jmx sidecar container | `{}` | -| `metrics.jmx.enabled` | Whether or not to expose JMX metrics to Prometheus | `false` | -| `metrics.jmx.image.registry` | JMX exporter image registry | `docker.io` | -| `metrics.jmx.image.repository` | JMX exporter image name | `bitnami/jmx-exporter` | -| `metrics.jmx.image.tag` | JMX exporter image tag | `{TAG_NAME}` | -| `metrics.jmx.image.pullPolicy` | JMX exporter image pull policy | `IfNotPresent` | -| `metrics.jmx.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `metrics.jmx.interval` | Interval that Prometheus scrapes JMX metrics when using Prometheus Operator | `10s` | -| `metrics.jmx.exporterPort` | JMX Exporter Port which exposes metrics in Prometheus format for scraping | `5556` | -| `metrics.jmx.configMap.enabled` | Enable the default ConfigMap for JMX | `true` | -| `metrics.jmx.configMap.overrideConfig` | Allows config file to be generated by passing values to ConfigMap | `{}` | -| `metrics.jmx.configMap.overrideName` | Allows setting the name of the ConfigMap to be used | `""` | -| `metrics.jmx.jmxPort` | The jmx port which JMX style metrics are exposed (note: these are not scrapeable by Prometheus) | `5555` | -| `metrics.jmx.whitelistObjectNames` | Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter | (see `values.yaml`) | -| `zookeeper.enabled` | Switch to enable or disable the Zookeeper helm chart | `true` | -| `zookeeper.persistence.enabled` | Enable Zookeeper persistence using PVC | `true` | -| `externalZookeeper.servers` | Server or list of external Zookeeper servers to use. | `nil` | +| 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` | Kafka image registry | `docker.io` | +| `image.repository` | Kafka Image name | `bitnami/kafka` | +| `image.tag` | Kafka Image tag | `{VERSION}` | +| `image.pullPolicy` | Kafka 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 kafka.fullname template with a string (will append the release name) | `nil` | +| `fullnameOverride` | String to fully override kafka.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 strategy for the stateful set | `RollingUpdate` | +| `rollingUpdatePartition` | Partition update strategy | `nil` | +| `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` | +| `replicaCount` | Number of Kafka nodes | `1` | +| `config` | Configuration file for Kafka | `nil` | +| `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` | +| `listeners` | The address the socket server listens on. | `nil` | +| `advertisedListeners` | Hostname and port the broker will advertise to producers and consumers. | `nil` | +| `listenerSecurityProtocolMap` | The protocol->listener mapping. | `nil` | +| `interBrokerListenerName` | The listener that the brokers should communicate on. | `nil` | +| `brokerId` | ID of the Kafka node | `-1` | +| `deleteTopicEnable` | Switch to enable topic deletion or not. | `false` | +| `heapOpts` | Kafka's Java Heap size. | `-Xmx1024m -Xms1024m` | +| `logFlushIntervalMessages` | The number of messages to accept before forcing a flush of data to disk. | `10000` | +| `logFlushIntervalMs` | The maximum amount of time a message can sit in a log before we force a flush. | `1000` | +| `logRetentionBytes` | A size-based retention policy for logs. | `_1073741824` | +| `logRetentionCheckIntervalMs` | The interval at which log segments are checked to see if they can be deleted. | `300000` | +| `logRetentionHours` | The minimum age of a log file to be eligible for deletion due to age. | `168` | +| `logSegmentBytes` | The maximum size of a log segment file. When this size is reached a new log segment will be created. | `_1073741824` | +| `logMessageFormatVersion` | Logging message format version. | `` | +| `logsDirs` | A comma separated list of directories under which to store log files. | `/bitnami/kafka/data` | +| `maxMessageBytes` | The largest record batch size allowed by Kafka. | `1000012` | +| `defaultReplicationFactor` | Default replication factors for automatically created topics | `1` | +| `offsetsTopicReplicationFactor` | The replication factor for the offsets topic | `1` | +| `transactionStateLogReplicationFactor ` | The replication factor for the transaction topic | `1` | +| `transactionStateLogMinIsr ` | Overridden min.insync.replicas config for the transaction topic | `1` | +| `numIoThreads` | The number of threads doing disk I/O. | `8` | +| `numNetworkThreads` | The number of threads handling network requests. | `3` | +| `numPartitions` | The default number of log partitions per topic. | `1` | +| `numRecoveryThreadsPerDataDir` | The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. | `1` | +| `socketReceiveBufferBytes` | The receive buffer (SO_RCVBUF) used by the socket server. | `102400` | +| `socketRequestMaxBytes` | The maximum size of a request that the socket server will accept (protection against OOM). | `_104857600` | +| `socketSendBufferBytes` | The send buffer (SO_SNDBUF) used by the socket server. | `102400` | +| `zookeeperConnectionTimeoutMs` | Timeout in ms for connecting to Zookeeper. | `6000` | +| `extraEnvVars` | Extra environment variables to add to kafka pods | `nil` | +| `sslEndpointIdentificationAlgorithm` | The endpoint identification algorithm to validate server hostname using server certificate. | `https` | +| `auth.enabled` | Switch to enable the kafka authentication. | `false` | +| `auth.existingSecret` | Name of the existing secret containing credentials for brokerUser, interBrokerUser and zookeeperUser. | `nil` | +| `auth.certificatesSecret` | Name of the existing secret containing the certificate files that will be used by Kafka. | `nil` | +| `auth.certificatesPassword` | Password for the above certificates if they are password protected. | `nil` | +| `auth.brokerUser` | Kafka client user. | `user` | +| `auth.brokerPassword` | Kafka client password. | `nil` | +| `auth.interBrokerUser` | Kafka inter broker communication user | `admin` | +| `auth.interBrokerPassword` | Kafka inter broker communication password. | `nil` | +| `auth.zookeeperUser` | Kafka Zookeeper user. | `nil` | +| `auth.zookeeperPassword` | Kafka Zookeeper password. | `nil` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `clusterDomain` | Kubernetes cluster domain | `cluster.local` | +| `service.type` | Kubernetes Service type | `ClusterIP` | +| `service.port` | Kafka port | `9092` | +| `service.nodePort` | Kubernetes Service nodePort | `nil` | +| `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `nil` | +| `service.annotations` | Service annotations | `` | +| `persistence.enabled` | Enable Kafka persistence using PVC, note that Zookeeper perisstency is unaffected | `true` | +| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. | `nil` | +| `persistence.storageClass` | PVC Storage Class for Kafka volume | `nil` | +| `persistence.accessMode` | PVC Access Mode for Kafka volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for Kafka 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 livessProbed 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.kafka.enabled` | Whether or not to create a separate Kafka exporter | `false` | +| `metrics.kafka.image.registry` | Kafka exporter image registry | `docker.io` | +| `metrics.kafka.image.repository` | Kafka exporter image name | `bitnami/kafka-exporter` | +| `metrics.kafka.image.tag` | Kafka exporter image tag | `{TAG_NAME}` | +| `metrics.kafka.image.pullPolicy` | Kafka exporter image pull policy | `IfNotPresent` | +| `metrics.kafka.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `metrics.kafka.interval` | Interval that Prometheus scrapes Kafka metrics when using Prometheus Operator | `10s` | +| `metrics.kafka.port` | Kafka Exporter Port which exposes metrics in Prometheus format for scraping | `9308` | +| `metrics.kafka.resources` | Allows setting resource limits for kafka-exporter pod | `{}` | +| `metrics.jmx.resources` | Allows setting resource limits for jmx sidecar container | `{}` | +| `metrics.jmx.enabled` | Whether or not to expose JMX metrics to Prometheus | `false` | +| `metrics.jmx.image.registry` | JMX exporter image registry | `docker.io` | +| `metrics.jmx.image.repository` | JMX exporter image name | `bitnami/jmx-exporter` | +| `metrics.jmx.image.tag` | JMX exporter image tag | `{TAG_NAME}` | +| `metrics.jmx.image.pullPolicy` | JMX exporter image pull policy | `IfNotPresent` | +| `metrics.jmx.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `metrics.jmx.interval` | Interval that Prometheus scrapes JMX metrics when using Prometheus Operator | `10s` | +| `metrics.jmx.exporterPort` | JMX Exporter Port which exposes metrics in Prometheus format for scraping | `5556` | +| `metrics.jmx.configMap.enabled` | Enable the default ConfigMap for JMX | `true` | +| `metrics.jmx.configMap.overrideConfig` | Allows config file to be generated by passing values to ConfigMap | `{}` | +| `metrics.jmx.configMap.overrideName` | Allows setting the name of the ConfigMap to be used | `""` | +| `metrics.jmx.jmxPort` | The jmx port which JMX style metrics are exposed (note: these are not scrapeable by Prometheus) | `5555` | +| `metrics.jmx.whitelistObjectNames` | Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter | (see `values.yaml`) | +| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.kafka.enabled` or `metrics.jmx.enabled` to be `true`) | `false` | +| `metrics.serviceMonitor.namespace` | Namespace which Prometheus is running in | `monitoring` | +| `metrics.serviceMonitor.interval` | How frequently to scrape metrics (use by default, falling back to Prometheus' default) | `nil` | +| `metrics.serviceMonitor.selector` | Default to kube-prometheus install (CoreOS recommended), but should be set according to Prometheus install | `{ prometheus: kube-prometheus }` | +| `zookeeper.enabled` | Switch to enable or disable the Zookeeper helm chart | `true` | +| `zookeeper.persistence.enabled` | Enable Zookeeper persistence using PVC | `true` | +| `externalZookeeper.servers` | Server or list of external Zookeeper servers to use. | `nil` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/bitnami/kafka/templates/servicemonitor.yaml b/bitnami/kafka/templates/servicemonitor.yaml new file mode 100644 index 000000000..a18636eef --- /dev/null +++ b/bitnami/kafka/templates/servicemonitor.yaml @@ -0,0 +1,46 @@ +{{- if and (or .Values.metrics.kafka.enabled .Values.metrics.jmx.enabled) .Values.metrics.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "kafka.fullname" . }} + {{- if .Values.metrics.serviceMonitor.namespace }} + namespace: {{ .Values.metrics.serviceMonitor.namespace }} + {{- end }} + labels: + app.kubernetes.io/name: {{ template "kafka.name" . }} + helm.sh/chart: {{ template "kafka.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: kafka + {{- range $key, $value := .Values.metrics.serviceMonitor.selector }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ template "kafka.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: kafka + endpoints: + {{- if .Values.metrics.kafka.enabled }} + - port: {{ .Values.metrics.kafka.exporterPort }} + {{- if .Values.metrics.serviceMonitor.interval }} + interval: {{ .Values.metrics.serviceMonitor.interval }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- end }} + {{- if .Values.metrics.jmx.enabled }} + - port: {{ .Values.metrics.jmx.exporterPort }} + {{- if .Values.metrics.serviceMonitor.interval }} + interval: {{ .Values.metrics.serviceMonitor.interval }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} diff --git a/bitnami/kafka/values-production.yaml b/bitnami/kafka/values-production.yaml index df433b599..dbd786ee0 100644 --- a/bitnami/kafka/values-production.yaml +++ b/bitnami/kafka/values-production.yaml @@ -427,6 +427,18 @@ metrics: - kafka.network:* - kafka.log:* + # Enable this if you're using https://github.com/coreos/prometheus-operator + serviceMonitor: + enabled: false + namespace: monitoring + # fallback to the prometheus default unless specified + # interval: 10s + ## Defaults to what's used if you follow CoreOS [Prometheus Install Instructions](https://github.com/helm/charts/tree/master/stable/prometheus-operator#tldr) + ## [Prometheus Selector Label](https://github.com/helm/charts/tree/master/stable/prometheus-operator#prometheus-operator-1) + ## [Kube Prometheus Selector Label](https://github.com/helm/charts/tree/master/stable/prometheus-operator#exporters) + selector: + prometheus: kube-prometheus + ## ## Zookeeper chart configuration ## diff --git a/bitnami/kafka/values.yaml b/bitnami/kafka/values.yaml index 6e4f4bb7a..c77a317b4 100644 --- a/bitnami/kafka/values.yaml +++ b/bitnami/kafka/values.yaml @@ -427,6 +427,18 @@ metrics: - kafka.network:* - kafka.log:* + # Enable this if you're using https://github.com/coreos/prometheus-operator + serviceMonitor: + enabled: false + namespace: monitoring + # fallback to the prometheus default unless specified + # interval: 10s + ## Defaults to what's used if you follow CoreOS [Prometheus Install Instructions](https://github.com/helm/charts/tree/master/stable/prometheus-operator#tldr) + ## [Prometheus Selector Label](https://github.com/helm/charts/tree/master/stable/prometheus-operator#prometheus-operator-1) + ## [Kube Prometheus Selector Label](https://github.com/helm/charts/tree/master/stable/prometheus-operator#exporters) + selector: + prometheus: kube-prometheus + ## ## Zookeeper chart configuration ##