Skip to content

Commit

Permalink
Add toleration and affinity (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuladhar committed Apr 18, 2024
1 parent 4f28742 commit 1b2351d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Add toleration for `node.cluster.x-k8s.io/uninitialized` and `node-role.kubernetes.io/control-plane` taint.
- Add node affinity to prefer scheduling pods to control-plane nodes.

## [0.8.0] - 2024-03-27

### Added
Expand Down
16 changes: 14 additions & 2 deletions helm/teleport-kube-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,14 @@ log:
# affinity(object) -- sets the affinities for any pods created by the chart.
# See [the Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity)
# for more details.
affinity: {}
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
weight: 10

# dnsConfig(object) -- contains custom Pod DNS Configuration for the agent pods.
# This value is useful if you need to reduce the DNS load: set "ndots" to 0 and
Expand Down Expand Up @@ -1209,7 +1216,12 @@ priorityClassName: ""
# tolerations(list) -- sets the tolerations for any pods created by the chart.
# See [the Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/)
# for more details.
tolerations: []
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
- effect: NoSchedule
key: node.cluster.x-k8s.io/uninitialized
operator: "Exists"

# probeTimeoutSeconds(int) -- sets the timeout for the readiness and liveness probes
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
Expand Down

0 comments on commit 1b2351d

Please sign in to comment.