Skip to content

Commit

Permalink
Add affinity customization
Browse files Browse the repository at this point in the history
For charts that have existing `affinity` hard-coded configs
defined, add support for overriding the hard-coded values.

For charts that lack `affinity` config entirely, add
the support for injecting custom affinity values.
  • Loading branch information
kppullin-nt committed Jan 28, 2021
1 parent b6c4597 commit 47f7666
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/cp-control-center/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ nodeSelector: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Monitoring
## Kafka JMX Settings
## ref: https://docs.confluent.io/current/kafka/monitoring.html
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-kafka-connect/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,7 @@ spec:
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/cp-kafka-connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ nodeSelector: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Monitoring
## Kafka Connect JMX Settings
## ref: https://kafka.apache.org/documentation/#connect_monitoring
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-kafka-rest/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,7 @@ spec:
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/cp-kafka-rest/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ nodeSelector: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Kafka REST configuration options
## ref: https://docs.confluent.io/current/kafka-rest/docs/config.html
configurationOverrides:
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-kafka/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ spec:
{{- end }}
spec:
affinity:
{{- if .Values.affinity }}
{{ toYaml .Values.affinity | indent 8 }}
{{- else }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
Expand All @@ -55,6 +58,7 @@ spec:
values:
- {{ .Release.Name }}
topologyKey: "kubernetes.io/hostname"
{{- end }}
containers:
{{- if .Values.prometheus.jmx.enabled }}
- name: prometheus-jmx-exporter
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-kafka/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ nodeSelector: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Monitoring
## Kafka JMX Settings
## ref: https://docs.confluent.io/current/kafka/monitoring.html
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-ksql-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ spec:
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/cp-ksql-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ nodeSelector: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Monitoring
## JMX Settings
## ref: https://docs.confluent.io/current/ksql/docs/operations.html
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-schema-registry/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,7 @@ spec:
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/cp-schema-registry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ nodeSelector: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Monitoring
## Schema Registry JMX Settings
## ref: https://docs.confluent.io/current/schema-registry/docs/monitoring.html
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-zookeeper/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ spec:
{{- end }}
spec:
affinity:
{{- if .Values.affinity }}
{{ toYaml .Values.affinity | indent 8 }}
{{- else }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
Expand All @@ -55,6 +58,7 @@ spec:
values:
- {{ .Release.Name }}
topologyKey: "kubernetes.io/hostname"
{{- end }}
containers:
{{- if .Values.prometheus.jmx.enabled }}
- name: prometheus-jmx-exporter
Expand Down
4 changes: 4 additions & 0 deletions charts/cp-zookeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ nodeSelector: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Monitoring
## Zookeeper JMX Settings
## ref: https://docs.confluent.io/current/installation/docker/docs/operations/monitoring.html
Expand Down

0 comments on commit 47f7666

Please sign in to comment.