Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,42 @@ more details on possible values for `extra_fields`.
See [the Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity)
for more details.

## `disableTopologySpreadConstraints`

| Type | Default |
|------|---------|
| `bool` | `false` |

`disableTopologySpreadConstraints` turns off the topology spread constraints.
The feature is automatically turned off on Kubernetes versions below 1.18.

## `topologySpreadConstraints`

| Type | Default |
|------|---------|
| `list` | `[]` |

`topologySpreadConstraints` sets the topology spread constraints for any pods created by the chart.
See [the Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/)
for more details.

When unset, the chart defaults to a soft topology spread constraint
that tries to spread pods across hosts and zones.

```
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels: # dynamically computed
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels: # dynamically computed
```

## `dnsConfig`

| Type | Default |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
authToken: auth-token
proxyAddr: proxy.example.com:3080
roles: kube
kubeClusterName: test-kube-cluster
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: foo
matchLabelKeys:
- pod-template-hash
3 changes: 3 additions & 0 deletions examples/chart/teleport-kube-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.topologySpreadConstraints }}
topologySpreadConstraints: {{- toYaml .Values.topologySpreadConstraints | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 6 }}
Expand Down
20 changes: 20 additions & 0 deletions examples/chart/teleport-kube-agent/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Warning to maintainers, any changes to this file that are not specific to the StatefulSet need to also be duplicated
# in the deployment.yaml file.
#
{{- $topologySpreadConstraints := and (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version) (not .Values.disableTopologySpreadConstraints) }}
{{- $replicaCount := (coalesce .Values.replicaCount .Values.highAvailability.replicaCount "1") }}
apiVersion: apps/v1
kind: StatefulSet
Expand Down Expand Up @@ -84,6 +85,25 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if $topologySpreadConstraints }}
{{- if .Values.topologySpreadConstraints }}
topologySpreadConstraints: {{- toYaml .Values.topologySpreadConstraints | nindent 8 }}
{{- else }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: {{ .Release.Name }}
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: {{ .Release.Name }}
{{- end }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 6 }}
Expand Down
Loading
Loading