1
0
Fork 0

longhorn: Remove node selector labels

I originally added the `du5t1n.me/storage` label to the x86_64 nodes and
configured Longhorn to only run on nodes with those labels because I
thought that was the correct way to control where volume replicas are
stored.  It turns out that this was incorrect, as it prevented Longhorn
from running on non-matching nodes entirely.  Thus, any machine that was
not so labeled could not access any Longhorn storage volumes.

The correct way to limit where Longhorn stores volume replicas is to
enable the `create-default-disk-labeled-nodes` setting.  With this
setting enabled, Longhorn will run on all nodes, but will not create
"disks" on them unless they have the
`node.longhorn.io/create-default-disk` label set to `true`.  Nodes that
do not have "disks" will not store volume replicas, but will run the
other Longhorn components and can therefore access Longhorn volumes.

Note that changing the "default settings" ConfigMap does not change the
setting once Longhorn has been deployed.  To update the setting on an
existing installation, the setting has to be changed explicitly:

```sh
kubectl get setting -n longhorn-system -o json \
    create-default-disk-labeled-nodes \
    | jq '.value="true"' \
    | kubectl apply -f -
```
dch-webhooks-secrets
Dustin 2022-10-11 21:58:43 -05:00
parent a683505e5d
commit 6df6e552b7
1 changed files with 1 additions and 6 deletions

View File

@ -63,8 +63,7 @@ metadata:
app.kubernetes.io/version: v1.3.0 app.kubernetes.io/version: v1.3.0
data: data:
default-setting.yaml: |- default-setting.yaml: |-
system-managed-components-node-selector: create-default-disk-labeled-nodes: true
du5t1n.me/storage=longhorn
--- ---
# Source: longhorn/templates/storageclass.yaml # Source: longhorn/templates/storageclass.yaml
apiVersion: v1 apiVersion: v1
@ -3457,8 +3456,6 @@ spec:
app.kubernetes.io/version: v1.3.0 app.kubernetes.io/version: v1.3.0
app: longhorn-manager app: longhorn-manager
spec: spec:
nodeSelector:
du5t1n.me/storage: longhorn
initContainers: initContainers:
- name: wait-longhorn-admission-webhook - name: wait-longhorn-admission-webhook
image: longhornio/longhorn-manager:v1.3.0 image: longhornio/longhorn-manager:v1.3.0
@ -3556,8 +3553,6 @@ spec:
app.kubernetes.io/version: v1.3.0 app.kubernetes.io/version: v1.3.0
app: longhorn-driver-deployer app: longhorn-driver-deployer
spec: spec:
nodeSelector:
du5t1n.me/storage: longhorn
initContainers: initContainers:
- name: wait-longhorn-manager - name: wait-longhorn-manager
image: longhornio/longhorn-manager:v1.3.0 image: longhornio/longhorn-manager:v1.3.0