Skip to content

Commit

Permalink
final touches
Browse files Browse the repository at this point in the history
  • Loading branch information
JTaeuber committed Nov 5, 2024
1 parent 2f7acf6 commit 4957b0d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion website/content/_global_md_links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
[kubernetes-security-context]: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ "Kubernetes Security Context"
[kubernetes-resource-management]: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ "Kubernetes Resource Management"
[kubernetes-taints-and-tolerations]: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ "Kubernetes Taints and Tolerations"
[kubernetes-affinity]: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ "Kubernetes Affinity"
[kubernetes-affinity]: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity "Kubernetes Affinity"
41 changes: 40 additions & 1 deletion website/content/docs/0 - helm-chart/2 - values/14 - affinity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,45 @@ affinity: {}
:::
By default the `affinity` field is empty. You can add affinity rules to this field for two .
By default the `affinity` field is empty.

You can add affinity rules to this field that give you a few more options for pod scheduling than [nodeSelector][nodeSelector].

## Node affinity

You can use Node affinity to achieve something very similar to the [nodeSelector][nodeSelector].

```yaml
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- antarctica-east1
- antarctica-west1
```

With the configuration above the GoKubeDownscaler will only be scheduled on a Node where a label `topology.kubernetes.io/zone` exists and has either the value `antarctica-east1` or `antarctica-west1`.

## Pod affinity

Pod affinity on the other hand will compare the labels of all **pods** on a Node.

```yaml
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: security
operator: In
values:
- S1
```

With this configuration the GoKubeDownscaler will prefer to deploy the pods on a Node where no other pod has the label `security=S1`.

For more information on affinity you can reference [the official Kubernetes documentation][kubernetes-affinity].

0 comments on commit 4957b0d

Please sign in to comment.