Skip to content

Commit

Permalink
chore: replace nodeSelector with nodeAffinity in chart + manifests
Browse files Browse the repository at this point in the history
Some K8s distributions might label control-plane nodes with
```
node-role.kubernetes.io/control-plane: "true"
```
rather than
```
node-role.kubernetes.io/control-plane: ""
```
which makes the default `nodeSelector` fail. Replacing it with a `affinity.nodeAffinity` nodeSelector fixes it.
  • Loading branch information
tamcore authored and sergelogvinov committed Dec 14, 2023
1 parent 93d8edc commit a76b7c2
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/proxmox-cloud-controller-manager/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ maintainers:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.8
version: 0.1.9

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
9 changes: 7 additions & 2 deletions charts/proxmox-cloud-controller-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ enabledControllers:
- cloud-node-lifecycle

# Deploy CCM only on control-plane nodes
nodeSelector:
node-role.kubernetes.io/control-plane: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
Expand Down
9 changes: 7 additions & 2 deletions charts/proxmox-cloud-controller-manager/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ enabledControllers:
- cloud-node-lifecycle

# Deploy CCM only on control-plane nodes
nodeSelector:
node-role.kubernetes.io/control-plane: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
Expand Down
10 changes: 7 additions & 3 deletions charts/proxmox-cloud-controller-manager/ci/values.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@

image:
repository: ghcr.io/sergelogvinov/proxmox-cloud-controller-manager
pullPolicy: Always
tag: edge

nodeSelector:
node-role.kubernetes.io/control-plane: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists

logVerbosityLevel: 4

Expand Down
10 changes: 7 additions & 3 deletions charts/proxmox-cloud-controller-manager/values.edge.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

image:
pullPolicy: Always
tag: edge

nodeSelector:
node-role.kubernetes.io/control-plane: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists

logVerbosityLevel: 4

Expand Down
10 changes: 7 additions & 3 deletions charts/proxmox-cloud-controller-manager/values.talos.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

nodeSelector:
node-role.kubernetes.io/control-plane: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists

logVerbosityLevel: 4

Expand Down
6 changes: 6 additions & 0 deletions charts/proxmox-cloud-controller-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ tolerations:
# -- Affinity for data pods assignment.
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: node-role.kubernetes.io/control-plane
# operator: Exists

# -- Additional volumes for Pods
extraVolumes: []
Expand Down
9 changes: 7 additions & 2 deletions docs/deploy/cloud-controller-manager-talos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,13 @@ spec:
- name: cloud-config
mountPath: /etc/proxmox
readOnly: true
nodeSelector:
node-role.kubernetes.io/control-plane: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
Expand Down
9 changes: 7 additions & 2 deletions docs/deploy/cloud-controller-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,13 @@ spec:
- name: cloud-config
mountPath: /etc/proxmox
readOnly: true
nodeSelector:
node-role.kubernetes.io/control-plane: ""
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
Expand Down

0 comments on commit a76b7c2

Please sign in to comment.