Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Omit service account generation when not using strimzi (#53) #64

Merged
merged 2 commits into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ helm install https://github.com/lightbend/kafka-lag-exporter/releases/download/v
--set clusters\[0\].bootstrapBrokers=my-cluster-kafka-bootstrap:9092
```

Install with statically defined cluster at the CLI, but with a non-default service account assigned to the deployment.

```
helm install https://github.com/lightbend/kafka-lag-exporter/releases/download/v0.5.1/kafka-lag-exporter-0.5.1.tgz \
--name kafka-lag-exporter \
--namespace myproject \
--set clusters\[0\].name=my-cluster \
--set clusters\[0\].bootstrapBrokers=my-cluster-kafka-bootstrap:9092
--set serviceAccount.create=true
```

Run a debug install (`DEBUG` logging, debug helm chart install, force docker pull policy to `Always`).

```
Expand Down
4 changes: 3 additions & 1 deletion charts/kafka-lag-exporter/templates/000-ServiceAccount.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if or .Values.watchers.strimzi .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -6,4 +7,5 @@ metadata:
app.kubernetes.io/name: {{ include "kafka-lag-exporter.name" . }}
helm.sh/chart: {{ include "kafka-lag-exporter.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/kafka-lag-exporter/templates/040-Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ spec:
app.kubernetes.io/name: {{ include "kafka-lag-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- if or .Values.watchers.strimzi .Values.serviceAccount.create -}}
serviceAccountName: {{ include "kafka-lag-exporter.fullname" . }}-serviceaccount
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down
5 changes: 5 additions & 0 deletions charts/kafka-lag-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ watchers:
## The Strimzi Cluster Watcher automatically watches for `kafka.strimzi.io` group, `Kafka` kind resources and will
## configure the Kafka Lag Exporter appropriately.
strimzi: false
## Applicable only in non-Strimzi installation. If true, a service account will be created and bind to the deployment.
## Otherwise, the default service account for the namespace will be used.
serviceAccount:
create: false

## You can use regex to control the metrics exposed by Prometheus endpoint.
## Any metric that matches one of the regex in the whitelist will be exposed.
## For example, if you only wish to expose the max lag metrics, use either:
Expand Down