Skip to content

Commit

Permalink
feat: force pods with volumes to be scheduled on Cloud servers (#743)
Browse files Browse the repository at this point in the history
Due to a bug in the scheduler a node with no driver instance might be
picked and the volume is stuck in pending as the "no capacity - >
reschedule" recovery is never triggered
[[0]](kubernetes/kubernetes#122109),
[[1]](kubernetes-csi/external-provisioner#544).

- See #400

---------

Co-authored-by: lukasmetzner <[email protected]>
Co-authored-by: Julian Tölle <[email protected]>
  • Loading branch information
3 people committed Nov 11, 2024
1 parent 7211dd8 commit cd5c717
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 2 deletions.
4 changes: 4 additions & 0 deletions chart/.snapshots/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ spec:
operator: NotIn
values:
- "true"
- key: instance.hetzner.cloud/provided-by
operator: NotIn
values:
- robot
tolerations:
- effect: NoExecute
operator: Exists
Expand Down
2 changes: 2 additions & 0 deletions chart/.snapshots/full.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,5 @@ storageClasses:
- name: foobar
defaultStorageClass: false
reclaimPolicy: Keep
allowedTopologyCloudServer: false

4 changes: 4 additions & 0 deletions chart/.snapshots/full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ spec:
operator: NotIn
values:
- "true"
- key: instance.hetzner.cloud/provided-by
operator: NotIn
values:
- robot
nodeSelector:
foo: bar
tolerations:
Expand Down
4 changes: 4 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ node:
operator: NotIn
values:
- "true"
- key: "instance.hetzner.cloud/provided-by"
operator: NotIn
values:
- "robot"

## @param node.nodeSelector Node labels for node pods assignment
## ref: https://kubernetes.io/docs/user-guide/node-selection/
Expand Down
4 changes: 4 additions & 0 deletions deploy/kubernetes/hcloud-csi.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions docs/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ metadata:
stringData:
encryption-passphrase: foobar

---
---

apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand Down Expand Up @@ -209,8 +209,33 @@ $ kubectl apply -f https://raw.githubusercontent.com/hetznercloud/csi-driver/v2.

## Integration with Root Servers

Root servers can be part of the cluster, but the CSI plugin doesn't work there. Taint the root server as follows to skip that node for the DaemonSet.
Root servers can be part of the cluster, but the CSI plugin doesn't work there.
Labels are needed to indicate whether a node is a cloud VM or a dedicated server from Robot. If you are using the `hcloud-cloud-controller-manager` version 1.21.0 or later, these labels are added automatically. Otherwise, you will need to label the nodes manually.
### Adding labels manually
**Cloud Servers**
```bash
kubectl label nodes <node name> instance.hetzner.cloud/provided-by=cloud
```
**Root Servers**
```bash
kubectl label nodes <node name> instance.hetzner.cloud/provided-by=robot
```
### DEPRECATED: Old Label
We prefer that you use our [new label](#new-label). The label `instance.hetzner.cloud/is-robot-server` will be deprecated in future releases.
**Cloud Servers**
```bash
kubectl label nodes <node name> instance.hetzner.cloud/is-root-server=false
```
**Root Servers**
```bash
kubectl label nodes <node name> instance.hetzner.cloud/is-root-server=true
```
Expand Down

0 comments on commit cd5c717

Please sign in to comment.