Skip to content

Commit

Permalink
Allow chaos-dns-server affinity to be set in helm values (chaos-mesh#…
Browse files Browse the repository at this point in the history
…4260)

Add change log entry for chaos-dns-server pod affinities



Modify install.sh for default pod anti-affinity removal



Set default chaos-dns-server pod affinity

Update install.sh

Signed-off-by: Josh Ferrell <[email protected]>
  • Loading branch information
josh-ferrell authored Nov 29, 2023
1 parent 6126b2b commit ee64258
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ For more information and how-to, see [RFC: Keep A Changelog](https://github.com/
- Support for deploying chaos-dashboard with sidecar containers in helm chart [#4164](https://github.com/chaos-mesh/chaos-mesh/pull/4164)
- Add `values.schema.json` [#4205](https://github.com/chaos-mesh/chaos-mesh/pull/4205)
- Add [`GreptimeDB`](https://greptime.com) to ADOPTERS.md [#4245](https://github.com/chaos-mesh/chaos-mesh/pull/4245)
- Support configurable chaos-dns-server pod affinities[#4260](https://github.com/chaos-mesh/chaos-mesh/pull/4260)

### Changed

Expand Down
13 changes: 3 additions & 10 deletions helm/chaos-mesh/templates/dns-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,10 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ .Values.dnsServer.serviceAccount }}
{{- with .Values.dnsServer.affinity }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values: ["chaos-dns"]
topologyKey: kubernetes.io/hostname
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.dnsServer.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
Expand Down
12 changes: 12 additions & 0 deletions helm/chaos-mesh/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,18 @@ dnsServer:
LISTEN_HOST: "0.0.0.0"
# The port of chaos-dns-server listen on
LISTEN_PORT: 53
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- chaos-dns-server
topologyKey: kubernetes.io/hostname
weight: 100

prometheus:
# Enable prometheus
Expand Down
11 changes: 6 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1963,14 +1963,15 @@ spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values: ["chaos-dns"]
- key: app.kubernetes.io/component
operator: In
values:
- chaos-dns-server
topologyKey: kubernetes.io/hostname
weight: 100
priorityClassName:
containers:
- name: chaos-dns-server
Expand Down

0 comments on commit ee64258

Please sign in to comment.