Skip to content

Commit

Permalink
annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
diranged committed Jan 21, 2025
1 parent 3a90e28 commit 75143f1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 11 deletions.
5 changes: 3 additions & 2 deletions charts/local-kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ are up and ready before your own application pods start up:
```yaml
# values.yaml
local-kafka:
podAnnotations:
"helm.sh/hook": pre-install
annotations:
helm.sh/hook: pre-install
```
## Requirements
Expand All @@ -66,6 +66,7 @@ local-kafka:
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| annotations | object | `{}` | Optionall annotations added to all of the resources managed by this template. |
| clusterName | string | `"default"` | Set the name of the Kafka Cluster that is created for local development |
| kafka.brokerVersion | `str` | `nil` | Optional version of Kafka to install (eg, `2.8.0`) |
| kafka.interBrokerProtocolVersion | `str` | `nil` | Optional value for the inter.broker.protocol.version property (eg. `2.8`) |
Expand Down
4 changes: 2 additions & 2 deletions charts/local-kafka/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ are up and ready before your own application pods start up:
```yaml
# values.yaml
local-kafka:
podAnnotations:
"helm.sh/hook": pre-install
annotations:
helm.sh/hook: pre-install
```

{{ template "chart.requirementsSection" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/local-kafka/ci/helm-hook-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Test that setting the helm.sh/hook annotations works as expected and the helm
# tests function
podAnnotations:
annotations:
helm.sh/hook: pre-install
11 changes: 9 additions & 2 deletions charts/local-kafka/templates/kafka-node-pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
{{- end }}
labels:
strimzi.io/cluster: {{ .Values.clusterName }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
roles:
Expand All @@ -20,10 +24,13 @@ spec:
size: 500Mi
deleteClaim: false
kraftMetadata: shared
{{- with .Values.podAnnotations }}
template:
pod:
metadata:
annotations:
{{- with .Values.annotations }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 10 }}
{{- end }}
13 changes: 9 additions & 4 deletions charts/local-kafka/templates/kafka.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# https://github.com/strimzi/strimzi-kafka-operator/blob/master/examples/kafka/kafka-ephemeral.yaml
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
Expand All @@ -9,6 +8,9 @@ metadata:
annotations:
strimzi.io/node-pools: enabled
strimzi.io/kraft: enabled
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
kafka:
{{- with .Values.kafka.brokerVersion }}
Expand Down Expand Up @@ -60,10 +62,13 @@ spec:
entityOperator:
topicOperator: {}
userOperator: {}
{{- with .Values.podAnnotations }}
template:
pod:
metadata:
annotations:
{{- toYaml . | nindent 14 }}
{{- end }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 12 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/local-kafka/templates/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
{{- end }}
labels:
strimzi.io/cluster: {{ .Values.clusterName }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
authentication:
type: tls
Expand Down
2 changes: 2 additions & 0 deletions charts/local-kafka/values.local.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Example of setting custom pod annotations
annotations:
testAllAnnotations: value
podAnnotations:
testAnnotation: value
3 changes: 3 additions & 0 deletions charts/local-kafka/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ clusterName: default
# put into is used. It is recommended to keep this empty.
namespaceOverride:

# -- Optionall annotations added to all of the resources managed by this template.
annotations: {}

# -- Optional annotations added to all of the Strimzi-managed Pods.
podAnnotations: {}

Expand Down

0 comments on commit 75143f1

Please sign in to comment.