Adds an independent local-path-provisioner pinned to the linode worker with its own ConfigMap (local-path-config-linode), helper pod, and StorageClass local-path-linode. The existing siriussec provisioner, its ConfigMap, the local-path StorageClass (still the cluster default) and every existing PVC/PV are untouched.
122 lines
3.4 KiB
YAML
122 lines
3.4 KiB
YAML
# Second local-path provisioner, pinned to the `linode` worker.
|
|
#
|
|
# The original `local-path` StorageClass keeps its single-replica provisioner on
|
|
# siriussec (and its helper pod pinned there), so a PVC consumed by a pod on
|
|
# linode would have its directory created on the ThinkPad's disk. This file adds
|
|
# an independent provisioner + StorageClass whose volumes live on linode's own
|
|
# disk. `local-path` remains the cluster default; nothing here touches it.
|
|
#
|
|
# Volumes land under /opt/local-path-provisioner/pvc-<uuid>_<ns>_<pvc> on linode.
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: local-path-config-linode
|
|
namespace: local-path-storage
|
|
data:
|
|
config.json: |-
|
|
{
|
|
"nodePathMap":[
|
|
{
|
|
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
|
|
"paths":["/opt/local-path-provisioner"]
|
|
},
|
|
{
|
|
"node":"linode",
|
|
"paths":["/opt/local-path-provisioner"]
|
|
}
|
|
]
|
|
}
|
|
setup: |-
|
|
#!/bin/sh
|
|
set -eu
|
|
mkdir -m 0777 -p "$VOL_DIR"
|
|
teardown: |-
|
|
#!/bin/sh
|
|
set -eu
|
|
rm -rf "$VOL_DIR"
|
|
helperPod.yaml: |-
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: helper-pod
|
|
spec:
|
|
priorityClassName: system-node-critical
|
|
nodeSelector:
|
|
kubernetes.io/hostname: linode
|
|
tolerations:
|
|
- key: node.kubernetes.io/disk-pressure
|
|
operator: Exists
|
|
effect: NoSchedule
|
|
- key: dedicated
|
|
operator: Equal
|
|
value: network
|
|
effect: PreferNoSchedule
|
|
containers:
|
|
- name: helper-pod
|
|
image: busybox
|
|
imagePullPolicy: IfNotPresent
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: local-path-provisioner-linode
|
|
namespace: local-path-storage
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: local-path-provisioner-linode
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: local-path-provisioner-linode
|
|
spec:
|
|
serviceAccountName: local-path-provisioner-service-account
|
|
nodeSelector:
|
|
kubernetes.io/hostname: linode
|
|
tolerations:
|
|
- key: dedicated
|
|
operator: Equal
|
|
value: network
|
|
effect: PreferNoSchedule
|
|
containers:
|
|
- name: local-path-provisioner
|
|
image: rancher/local-path-provisioner:v0.0.31
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- local-path-provisioner
|
|
- --debug
|
|
- start
|
|
- --config
|
|
- /etc/config/config.json
|
|
- --provisioner-name
|
|
- rancher.io/local-path-linode
|
|
- --configmap-name
|
|
- local-path-config-linode
|
|
volumeMounts:
|
|
- name: config-volume
|
|
mountPath: /etc/config/
|
|
env:
|
|
- name: POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: CONFIG_MOUNT_PATH
|
|
value: /etc/config/
|
|
- name: KUBERNETES_SERVICE_HOST
|
|
value: "10.10.0.2"
|
|
- name: KUBERNETES_SERVICE_PORT
|
|
value: "6443"
|
|
volumes:
|
|
- name: config-volume
|
|
configMap:
|
|
name: local-path-config-linode
|
|
---
|
|
apiVersion: storage.k8s.io/v1
|
|
kind: StorageClass
|
|
metadata:
|
|
name: local-path-linode
|
|
provisioner: rancher.io/local-path-linode
|
|
volumeBindingMode: WaitForFirstConsumer
|
|
reclaimPolicy: Delete
|