Skip to content

Commit

Permalink
fix: Volume requests are falsely scheduled to Robot servers
Browse files Browse the repository at this point in the history
- See #400
  • Loading branch information
lukasmetzner authored and lukasmetzner committed Oct 28, 2024
1 parent 719247e commit 6c7de80
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
7 changes: 7 additions & 0 deletions chart/templates/core/storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ provisioner: csi.hetzner.cloud
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
reclaimPolicy: {{ $val.reclaimPolicy | quote }}
{{- if $val.includesRobotServers }}
allowedTopologies:
- matchLabelExpressions:
- key: instance.hetzner.cloud/is-root-server
values:
- "false"
{{- end }}
---
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -724,3 +724,4 @@ storageClasses:
- name: hcloud-volumes
defaultStorageClass: true
reclaimPolicy: Delete
includesRobotServers: false
20 changes: 19 additions & 1 deletion docs/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,26 @@ $ 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 and the current behaviour of the scheduler can cause Pods to be stuck in `Pending`.
Include topology key evaluation into storage class, by setting the helm chart value `includesRobotServers`:
```yaml
storageClasses:
- name: hcloud-volumes
defaultStorageClass: true
reclaimPolicy: Delete
includesRobotServers: true # <---
```
Label the nodes according to their type:
**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
1 change: 1 addition & 0 deletions internal/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ const (
DefaultVolumeSize = MinVolumeSize

TopologySegmentLocation = PluginName + "/location"
IsRootServerLabel = "instance.hetzner.cloud/is-root-server"
)
1 change: 1 addition & 0 deletions internal/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (s *NodeService) NodeGetInfo(_ context.Context, _ *proto.NodeGetInfoRequest
AccessibleTopology: &proto.Topology{
Segments: map[string]string{
TopologySegmentLocation: s.serverLocation,
IsRootServerLabel: "false",
},
},
}
Expand Down

0 comments on commit 6c7de80

Please sign in to comment.