Skip to content

Commit

Permalink
feat(chart): configure best effort topology spread constraints for k8…
Browse files Browse the repository at this point in the history
…sensor deployment
  • Loading branch information
maandr committed Feb 6, 2024
1 parent 87e8cc2 commit 3311df3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions instana-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ The following table lists the configurable parameters of the Instana chart and t
| `zones` | Multi-zone daemonset configuration. | `nil` see [below](#multiple-zones) for details |
| `k8s_sensor.podDisruptionBudget.enabled` | Whether to create DisruptionBudget for k8sensor to limit the number of concurrent disruptions | `false` |
| `k8s_sensor.deployment.pod.affinity` | `k8sensor` deployment affinity format | `podAntiAffinity` defined in `values.yaml` |
| `k8s_sensor.deployment.pod.topologySpreadConstraints` | `k8sensor` deployment topology spread constraints format | `topologySpreadConstraints` defined in `values.yaml` |

### Agent Modes

Expand Down
2 changes: 2 additions & 0 deletions instana-agent/templates/k8s-sensor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ spec:
{{- end }}
affinity:
{{- toYaml .Values.k8s_sensor.deployment.pod.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.k8s_sensor.deployment.pod.topologySpreadConstraints | nindent 8 }}
{{- end -}}
{{- end -}}
{{- end -}}
17 changes: 17 additions & 0 deletions instana-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,23 @@ k8s_sensor:
operator: In
values: [ KUBERNETES ]
topologyKey: "kubernetes.io/hostname"
# k8s_sensor.deployment.pod.topologySpreadConstraints are constraints to influence how pods are distributed accross nodes
# https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
topologySpreadConstraints:
- labelSelector:
matchLabels:
app.kubernetes.io/instance: instana-agent
app: k8sensor
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
- labelSelector:
matchLabels:
app.kubernetes.io/instance: instana-agent
app: k8sensor
maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
podDisruptionBudget:
# Specifies whether or not to setup a pod disruption budget for the k8sensor deployment
enabled: false
Expand Down

0 comments on commit 3311df3

Please sign in to comment.