diff --git a/README.md b/README.md index f9f4ef72..1099abdc 100644 --- a/README.md +++ b/README.md @@ -8,22 +8,22 @@ Kafka exporter for Prometheus. For other metrics from Kafka, have a look at the Table of Contents ----------------- -- [Compatibility](#compatibility) -- [Dependency](#dependency) -- [Download](#download) -- [Compile](#compile) - - [Build Binary](#build-binary) - - [Build Docker Image](#build-docker-image) -- [Run](#run) - - [Run Binary](#run-binary) - - [Run Docker Image](#run-docker-image) -- [Flags](#flags) - - [Notes](#notes) -- [Metrics](#metrics) - - [Brokers](#brokers) - - [Topics](#topics) - - [Consumer Groups](#consumer-groups) -- [Grafana Dashboard](#grafana-dashboard) +- [Compatibility](#compatibility) +- [Dependency](#dependency) +- [Download](#download) +- [Compile](#compile) + - [Build Binary](#build-binary) + - [Build Docker Image](#build-docker-image) +- [Run](#run) + - [Run Binary](#run-binary) + - [Run Docker Image](#run-docker-image) +- [Flags](#flags) + - [Notes](#notes) +- [Metrics](#metrics) + - [Brokers](#brokers) + - [Topics](#topics) + - [Consumer Groups](#consumer-groups) +- [Grafana Dashboard](#grafana-dashboard) - [Contribute](#contribute) - [Donation](#donation) - [License](#license) @@ -36,9 +36,9 @@ Support [Apache Kafka](https://kafka.apache.org) version 0.10.1.0 (and later). Dependency ---------- -- [Prometheus](https://prometheus.io) -- [Sarama](https://shopify.github.io/sarama) -- [Golang](https://golang.org) +- [Prometheus](https://prometheus.io) +- [Sarama](https://shopify.github.io/sarama) +- [Golang](https://golang.org) Download -------- @@ -89,44 +89,44 @@ Flags This image is configurable using different flags -| Flag name | Default | Description | -|------------------------------|----------------|----------------------------------------------------------------------------------------------------------------------------------------| -| kafka.server | kafka:9092 | Addresses (host:port) of Kafka server | -| kafka.version | 2.0.0 | Kafka broker version | -| sasl.enabled | false | Connect using SASL/PLAIN | -| sasl.handshake | true | Only set this to false if using a non-Kafka SASL proxy | -| sasl.username | | SASL user name | -| sasl.password | | SASL user password | -| sasl.mechanism | | SASL mechanism can be plain, scram-sha512, scram-sha256 | -| sasl.service-name | | Service name when using Kerberos Auth | -| sasl.kerberos-config-path | | Kerberos config path | -| sasl.realm | | Kerberos realm | -| sasl.keytab-path | | Kerberos keytab file path | -| sasl.kerberos-auth-type | | Kerberos auth type. Either 'keytabAuth' or 'userAuth' | -| tls.enabled | false | Connect to Kafka using TLS | -| tls.server-name | | Used to verify the hostname on the returned certificates unless tls.insecure-skip-tls-verify is given. The kafka server's name should be given | -| tls.ca-file | | The optional certificate authority file for Kafka TLS client authentication | -| tls.cert-file | | The optional certificate file for Kafka client authentication | -| tls.key-file | | The optional key file for Kafka client authentication | -| tls.insecure-skip-tls-verify | false | If true, the server's certificate will not be checked for validity | -| server.tls.enabled | false | Enable TLS for web server | -| server.tls.mutual-auth-enabled | false | Enable TLS client mutual authentication | -| server.tls.ca-file | | The certificate authority file for the web server | -| server.tls.cert-file | | The certificate file for the web server | -| server.tls.key-file | | The key file for the web server | -| topic.filter | .* | Regex that determines which topics to collect | -| group.filter | .* | Regex that determines which consumer groups to collect | -| web.listen-address | :9308 | Address to listen on for web interface and telemetry | -| web.telemetry-path | /metrics | Path under which to expose metrics | -| log.enable-sarama | false | Turn on Sarama logging | -| use.consumelag.zookeeper | false | if you need to use a group from zookeeper | -| zookeeper.server | localhost:2181 | Address (hosts) of zookeeper server | -| kafka.labels | | Kafka cluster name | -| refresh.metadata | 30s | Metadata refresh interval | -| offset.show-all | true | Whether show the offset/lag for all consumer group, otherwise, only show connected consumer groups | -| concurrent.enable | false | If true, all scrapes will trigger kafka operations otherwise, they will share results. WARN: This should be disabled on large clusters | -| topic.workers | 100 | Number of topic workers | -| verbosity | 0 | Verbosity log level | +| Flag name | Default | Chart | Description | +|--------------------------------|----------------|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------| +| kafka.server | kafka:9092 | kafkaExporter.kafka.servers | Addresses (host:port) of Kafka server | +| kafka.version | 2.0.0 | kafkaExporter.kafka.version | Kafka broker version | +| sasl.enabled | false | kafkaExporter.sasl.enabled | Connect using SASL/PLAIN | +| sasl.handshake | true | kafkaExporter.sasl.handshake | Only set this to false if using a non-Kafka SASL proxy | +| sasl.username | | kafkaExporter.sasl.username | SASL user name | +| sasl.password | | kafkaExporter.sasl.password | SASL user password | +| sasl.mechanism | | kafkaExporter.sasl.mechanism | SASL mechanism can be plain, scram-sha512, scram-sha256 | +| sasl.service-name | | kafkaExporter.sasl.serviceName | Service name when using Kerberos Auth | +| sasl.kerberos-config-path | | kafkaExporter.sasl.kerberosConfigPath | Kerberos config path | +| sasl.realm | | kafkaExporter.sasl.realm | Kerberos realm | +| sasl.keytab-path | | kafkaExporter.sasl.keytabPath | Kerberos keytab file path | +| sasl.kerberos-auth-type | | kafkaExporter.sasl.kerberosAuthType | Kerberos auth type. Either 'keytabAuth' or 'userAuth' | +| tls.enabled | false | kafkaExporter.tls.enabled | Connect to Kafka using TLS | +| tls.server-name | | kafkaExporter.tls.serverName | Used to verify the hostname on the returned certificates unless tls.insecure-skip-tls-verify is given. The kafka server's name should be given | +| tls.ca-file | | kafkaExporter.tls.caFile | The optional certificate authority file for Kafka TLS client authentication | +| tls.cert-file | | kafkaExporter.tls.certFile | The optional certificate file for Kafka client authentication | +| tls.key-file | | kafkaExporter.tls.keyFile | The optional key file for Kafka client authentication | +| tls.insecure-skip-tls-verify | false | kafkaExporter.tls.insecureSkipTlsVerify | If true, the server's certificate will not be checked for validity | +| server.tls.enabled | false | | Enable TLS for web server | +| server.tls.mutual-auth-enabled | false | | Enable TLS client mutual authentication | +| server.tls.ca-file | | | The certificate authority file for the web server | +| server.tls.cert-file | | | The certificate file for the web server | +| server.tls.key-file | | | The key file for the web server | +| topic.filter | .* | kafkaExporter.filter.topic | Regex that determines which topics to collect | +| group.filter | .* | kafkaExporter.filter.group | Regex that determines which consumer groups to collect | +| web.listen-address | :9308 | kafkaExporter.web.listenAddress | Address to listen on for web interface and telemetry | +| web.telemetry-path | /metrics | kafkaExporter.web.telemetryPath | Path under which to expose metrics | +| log.enable-sarama | false | kafkaExporter.log.enableSarama | Turn on Sarama logging | +| use.consumelag.zookeeper | false | kafkaExporter.zookeeper.consumelag | if you need to use a group from zookeeper | +| zookeeper.server | localhost:2181 | kafkaExporter.zookeeper.server | Address (hosts) of zookeeper server | +| kafka.labels | | kafkaExporter.kafka.labels | Kafka cluster name | +| refresh.metadata | 30s | kafkaExporter.refresh.metadata | Metadata refresh interval | +| offset.show-all | true | kafkaExporter.offset.showAll | Whether show the offset/lag for all consumer group, otherwise, only show connected consumer groups | +| concurrent.enable | false | kafkaExporter.concurrent.enable | If true, all scrapes will trigger kafka operations otherwise, they will share results. WARN: This should be disabled on large clusters | +| topic.workers | 100 | kafkaExporter.topic.workers | Number of topic workers | +| verbosity | 0 | kafkaExporter.log.verbosity | Verbosity log level | ### Notes diff --git a/charts/kafka-exporter/.helmignore b/charts/kafka-exporter/.helmignore index 50af0317..0e8a0eb3 100644 --- a/charts/kafka-exporter/.helmignore +++ b/charts/kafka-exporter/.helmignore @@ -14,6 +14,7 @@ *.swp *.bak *.tmp +*.orig *~ # Various IDEs .project diff --git a/charts/kafka-exporter/Chart.yaml b/charts/kafka-exporter/Chart.yaml index 518d8d0d..799e93fa 100644 --- a/charts/kafka-exporter/Chart.yaml +++ b/charts/kafka-exporter/Chart.yaml @@ -1,9 +1,9 @@ -apiVersion: v1 -appVersion: "1.0" +apiVersion: v2 +appVersion: "v1.4.2" description: A Helm chart for Kubernetes name: kafka-exporter -version: 1.2.0 -home: https://github.com/abhishekjiitr/kafka-exporter-helm +version: 1.2.1 +home: https://github.com/danielqsj/kafka_exporter/tree/master/charts/kafka-exporter maintainers: - name: abhishekjiitr email: abhi2254015@gmail.com diff --git a/charts/kafka-exporter/templates/_helpers.tpl b/charts/kafka-exporter/templates/_helpers.tpl index bc51bbfc..7fce6991 100644 --- a/charts/kafka-exporter/templates/_helpers.tpl +++ b/charts/kafka-exporter/templates/_helpers.tpl @@ -1,10 +1,9 @@ -{{/* vim: set filetype=mustache: */}} {{/* Expand the name of the chart. */}} {{- define "kafka-exporter.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} {{/* Create a default fully qualified app name. @@ -12,21 +11,53 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this If release name contains chart name it will be used as a full name. */}} {{- define "kafka-exporter.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} {{/* Create chart name and version as used by the chart label. */}} {{- define "kafka-exporter.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "kafka-exporter.labels" -}} +app: kafka-exporter +helm.sh/chart: {{ include "kafka-exporter.chart" . }} +{{ include "kafka-exporter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "kafka-exporter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "kafka-exporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "kafka-exporter.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/kafka-exporter/templates/deployment.yaml b/charts/kafka-exporter/templates/deployment.yaml index 96b9d127..ac8d04c8 100644 --- a/charts/kafka-exporter/templates/deployment.yaml +++ b/charts/kafka-exporter/templates/deployment.yaml @@ -3,65 +3,161 @@ kind: Deployment metadata: name: {{ include "kafka-exporter.fullname" . }} labels: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - helm.sh/chart: {{ include "kafka-exporter.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - {{- if .Values.labels -}} - {{ .Values.labels | toYaml | nindent 4 -}} + {{- include "kafka-exporter.labels" . | nindent 4 }} + {{- if .Values.labels }} + {{ toYaml .Values.labels | nindent 4 }} {{- end }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "kafka-exporter.selectorLabels" . | nindent 6 }} template: metadata: labels: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - {{- if .Values.podLabels -}} - {{ .Values.podLabels | toYaml | nindent 8 -}} + {{- include "kafka-exporter.selectorLabels" . | nindent 8 }} + {{- if .Values.podLabels }} + {{ toYaml .Values.podLabels | nindent 8 }} {{- end }} + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "kafka-exporter.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - {{- if .Values.kafkaExporter}} - {{- range .Values.kafkaExporter.kafka.servers }} - - "--kafka.server={{ . }}" - {{- end }} - {{- if .Values.kafkaExporter.kafka.version }} - - --kafka.version={{ .Values.kafkaExporter.kafka.version }} - {{- end }} - {{- end}} - {{- if .Values.kafkaExporter.sasl.enabled }} + {{- with .Values.kafkaExporter }} + {{- /* Kafka */}} + {{- with .kafka }} + {{- range .servers }} + - --kafka.server={{ . }} + {{- end }} + {{- if .version }} + - --kafka.version={{ .version }} + {{- end }} + {{- if .labels }} + - --kafka.labels={{ .labels }} + {{- end }} + {{- end }} + {{- /* SASL */}} + {{- with .sasl }} + {{- if .enabled }} - --sasl.enabled - {{- if not .Values.kafkaExporter.sasl.handshake }} + {{- if not .handshake }} - --sasl.handshake=false - {{- end }} - - --sasl.username={{ .Values.kafkaExporter.sasl.username }} - - --sasl.password={{ .Values.kafkaExporter.sasl.password }} - - --sasl.mechanism={{ .Values.kafkaExporter.sasl.mechanism }} - {{- end }} - {{- if .Values.kafkaExporter.tls.enabled}} + {{- end }} + - --sasl.username={{ .username }} + - --sasl.password={{ .password }} + - --sasl.mechanism={{ .mechanism }} + {{- if .serviceName }} + - --sasl.service-name={{ .serviceName }} + {{- end }} + {{- if .kerberosConfigPath }} + - --sasl.kerberos-config-path={{ .kerberosConfigPath }} + {{- end }} + {{- if .realm }} + - --sasl.realm={{ .realm }} + {{- end }} + {{- if .keytabPath }} + - --sasl.keytab-path={{ .keytabPath }} + {{- end }} + {{- if .kerberosAuthType }} + - --sasl.kerberos-auth-type={{ .kerberosAuthType }} + {{- end }} + {{- end }} + {{- end }} + {{- /* TLS */}} + {{- with .tls }} + {{- if .enabled }} - --tls.enabled - {{- if .Values.kafkaExporter.tls.insecureSkipTlsVerify}} + {{- if .insecureSkipTlsVerify }} - --tls.insecure-skip-tls-verify - {{- else }} + {{- else }} + {{- if .serverName }} + - --tls.server-name={{ .serverName }} + {{- end }} - --tls.ca-file=/etc/tls-certs/ca-file - --tls.cert-file=/etc/tls-certs/cert-file - --tls.key-file=/etc/tls-certs/key-file - {{- end }} - {{- end }} - {{- if .Values.kafkaExporter.log }} - - --verbosity={{ .Values.kafkaExporter.log.verbosity }} - {{- end }} - {{- if .Values.kafkaExporter.log.enableSarama }} + {{- end }} + {{- end }} + {{- end }} + {{- /* Filters */}} + {{- with .filter }} + {{- if .topic }} + - --topic.filter={{ .topic }} + {{- end }} + {{- if .group }} + - --group.filter={{ .group }} + {{- end }} + {{- end }} + {{- /* Web */}} + {{- with .web }} + {{- if .listenAddress }} + - --listen-address={{ .listenAddress }} + {{- end }} + {{- if .telemetryPath }} + - --telemetry-path={{ .telemetryPath }} + {{- end }} + {{- end }} + {{- /* ZooKeeper */}} + {{- with .zookeeper }} + {{- if .consumelag }} + - --use.consumelag.zookeeper + {{- end }} + {{- range .servers }} + - --zookeeper.server={{ . }} + {{- end }} + {{- end }} + {{- /* Refresh */}} + {{- with .refresh }} + {{- if .metadata }} + - --refresh.metadata={{ .metadata }} + {{- end }} + {{- end }} + {{- /* Offset */}} + {{- with .offset }} + {{- if not .showAll }} + - --offset.show-all + {{- end }} + {{- end }} + {{- /* Concurrent */}} + {{- with .concurrent }} + {{- if .enable }} + - --concurrent.enable + {{- end }} + {{- end }} + {{- /* Topic */}} + {{- with .topic }} + {{- if .workers }} + - --topic.workers={{ .workers }} + {{- end }} + {{- end }} + {{- /* Log */}} + {{- with .log }} + {{- if .verbosity }} + - --verbosity={{ .verbosity }} + {{- end }} + {{- if .enableSarama }} - --log.enable-sarama + {{- end }} + {{- end }} {{- end }} ports: - name: metrics @@ -87,31 +183,29 @@ spec: periodSeconds: 15 successThreshold: 1 timeoutSeconds: 9 - + resources: + {{- toYaml .Values.resources | nindent 12 }} {{- if and .Values.kafkaExporter.tls.enabled (not .Values.kafkaExporter.tls.insecureSkipTlsVerify) }} volumeMounts: - - name: tls-certs - mountPath: "/etc/tls-certs/" - readOnly: true + - name: tls-certs + mountPath: /etc/tls-certs/ + readOnly: true {{- end }} - resources: - {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} - nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} + {{- end }} + {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} {{- if and .Values.kafkaExporter.tls.enabled (not .Values.kafkaExporter.tls.insecureSkipTlsVerify) }} volumes: - - name: tls-certs - secret: - secretName: {{ include "kafka-exporter.fullname" . }} + - name: tls-certs + secret: + secretName: {{ include "kafka-exporter.fullname" . }} {{- end }} diff --git a/charts/kafka-exporter/templates/secret.yaml b/charts/kafka-exporter/templates/secret.yaml index 48a6e851..ea6ba8f6 100644 --- a/charts/kafka-exporter/templates/secret.yaml +++ b/charts/kafka-exporter/templates/secret.yaml @@ -4,12 +4,9 @@ kind: Secret metadata: name: {{ include "kafka-exporter.fullname" . }} labels: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - helm.sh/chart: {{ include "kafka-exporter.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - {{- if .Values.labels -}} - {{- .Values.labels | toYaml | nindent 4 }} + {{- include "kafka-exporter.labels" . | nindent 4 }} + {{- if .Values.labels }} + {{ toYaml .Values.labels | nindent 4 }} {{- end }} data: ca-file: {{ .Values.kafkaExporter.tls.caFile | b64enc }} diff --git a/charts/kafka-exporter/templates/service.yaml b/charts/kafka-exporter/templates/service.yaml index 61e02bd8..1ff95155 100644 --- a/charts/kafka-exporter/templates/service.yaml +++ b/charts/kafka-exporter/templates/service.yaml @@ -3,12 +3,9 @@ kind: Service metadata: name: {{ include "kafka-exporter.fullname" . }} labels: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - helm.sh/chart: {{ include "kafka-exporter.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - {{- if .Values.labels -}} - {{ .Values.labels | toYaml | nindent 4 -}} + {{- include "kafka-exporter.labels" . | nindent 4 }} + {{- if .Values.labels }} + {{ toYaml .Values.labels | nindent 4 }} {{- end }} spec: type: {{ .Values.service.type }} @@ -18,5 +15,4 @@ spec: protocol: TCP name: metrics selector: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "kafka-exporter.selectorLabels" . | nindent 4 }} diff --git a/charts/kafka-exporter/templates/serviceaccount.yaml b/charts/kafka-exporter/templates/serviceaccount.yaml new file mode 100644 index 00000000..3ad27086 --- /dev/null +++ b/charts/kafka-exporter/templates/serviceaccount.yaml @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "kafka-exporter.serviceAccountName" . }} + labels: + {{- include "kafka-exporter.labels" . | nindent 4 }} + {{- if .Values.labels }} + {{ toYaml .Values.labels | nindent 4 }} + {{- end }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/kafka-exporter/templates/servicemonitor.yaml b/charts/kafka-exporter/templates/servicemonitor.yaml index 2efc6d6c..ac6bd023 100644 --- a/charts/kafka-exporter/templates/servicemonitor.yaml +++ b/charts/kafka-exporter/templates/servicemonitor.yaml @@ -7,22 +7,18 @@ metadata: namespace: {{ .Values.prometheus.serviceMonitor.namespace }} {{- end }} labels: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - helm.sh/chart: {{ include "kafka-exporter.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - {{- if .Values.labels -}} - {{ .Values.labels | toYaml | nindent 4 -}} + {{- include "kafka-exporter.labels" . | nindent 4 }} + {{- if .Values.labels }} + {{ toYaml .Values.labels | nindent 4 }} {{- end }} {{- if .Values.prometheus.serviceMonitor.additionalLabels }} -{{ toYaml .Values.prometheus.serviceMonitor.additionalLabels | indent 4 -}} + {{ toYaml .Values.prometheus.serviceMonitor.additionalLabels | nindent 4 }} {{- end }} spec: jobLabel: jobLabel selector: matchLabels: - app.kubernetes.io/name: {{ include "kafka-exporter.name" . }} - helm.sh/chart: {{ include "kafka-exporter.chart" . }} + {{- include "kafka-exporter.selectorLabels" . | nindent 6 }} namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/charts/kafka-exporter/values.yaml b/charts/kafka-exporter/values.yaml index d001b409..0e754976 100644 --- a/charts/kafka-exporter/values.yaml +++ b/charts/kafka-exporter/values.yaml @@ -6,12 +6,36 @@ replicaCount: 1 image: repository: danielqsj/kafka-exporter - tag: latest pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" +imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +serviceAccount: + # Specifies whether a service account should be created + create: false + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + service: type: ClusterIP port: 9308 @@ -20,7 +44,8 @@ kafkaExporter: kafka: servers: [] # - kafka:9092 - # version: "1.0.0" + version: "" + labels: "" sasl: enabled: false @@ -28,16 +53,46 @@ kafkaExporter: username: "" password: "" mechanism: "" + serviceName: "" + kerberosConfigPath: "" + realm: "" + keytabPath: "" + kerberosAuthType: "" tls: enabled: false - insecureSkipTlsVerify: false + serverName: "" caFile: "" certFile: "" keyFile: "" + insecureSkipTlsVerify: false + + filter: + topic: "" + group: "" + + web: + listenAddress: "" + telemetryPath: "" + + zookeeper: + consumelag: false + server: "" + + refresh: + metadata: "" + + offset: + showAll: true + + concurrent: + enable: false + + topic: + workers: "" log: - verbosity: 0 + verbosity: "" enableSarama: false prometheus: @@ -45,11 +100,13 @@ prometheus: enabled: true namespace: monitoring interval: "30s" - additionalLabels: - app: kafka-exporter + additionalLabels: {} metricRelabelings: {} +annotations: {} + labels: {} + podLabels: {} resources: {}