democratic-csi: Initial deployment
Deploying _democratic-csi_ to manage PersistentVolumeClaim resources, mapping them to iSCSI volumes on the Synology. Eventually, all Longhorn-managed PVCs will be replaced with Synology iSCSI volumes. Getting rid of Longhorn should free up a lot of resources and remove a point of failure from the cluster.
This commit is contained in:
325
democratic-csi/democratic-csi.yaml
Normal file
325
democratic-csi/democratic-csi.yaml
Normal file
@@ -0,0 +1,325 @@
|
||||
kind: DaemonSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: csi-synology-democratic-csi-node
|
||||
namespace: democratic-csi
|
||||
labels:
|
||||
app.kubernetes.io/name: democratic-csi
|
||||
app.kubernetes.io/csi-role: node
|
||||
app.kubernetes.io/component: node-linux
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: democratic-csi
|
||||
app.kubernetes.io/csi-role: node
|
||||
app.kubernetes.io/component: node-linux
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: democratic-csi
|
||||
app.kubernetes.io/csi-role: node
|
||||
app.kubernetes.io/component: node-linux
|
||||
spec:
|
||||
serviceAccount: csi-synology-democratic-csi-node-sa
|
||||
priorityClassName: system-node-critical
|
||||
hostNetwork: true
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
hostAliases: []
|
||||
hostIPC: true
|
||||
hostPID: false
|
||||
containers:
|
||||
- name: csi-driver
|
||||
image: docker.io/democraticcsi/democratic-csi:latest
|
||||
args:
|
||||
- --csi-version=1.5.0
|
||||
- --csi-name=org.democratic-csi.iscsi-synology
|
||||
- --driver-config-file=/config/driver-config-file.yaml
|
||||
- --log-level=info
|
||||
- --csi-mode=node
|
||||
- --server-socket=/csi-data/csi.sock.internal
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: true
|
||||
capabilities:
|
||||
add:
|
||||
- SYS_ADMIN
|
||||
privileged: true
|
||||
env:
|
||||
- name: CSI_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
terminationMessagePath: /tmp/termination-log
|
||||
terminationMessagePolicy: File
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
exec:
|
||||
command:
|
||||
- bin/liveness-probe
|
||||
- --csi-version=1.5.0
|
||||
- --csi-address=/csi-data/csi.sock.internal
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 15
|
||||
periodSeconds: 60
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /csi-data
|
||||
- name: kubelet-dir
|
||||
mountPath: /var/lib/kubelet
|
||||
mountPropagation: Bidirectional
|
||||
- name: iscsi-dir
|
||||
mountPath: /etc/iscsi
|
||||
mountPropagation: Bidirectional
|
||||
- name: iscsi-info
|
||||
mountPath: /var/lib/iscsi
|
||||
mountPropagation: Bidirectional
|
||||
- name: modules-dir
|
||||
mountPath: /lib/modules
|
||||
readOnly: true
|
||||
- name: localtime
|
||||
mountPath: /etc/localtime
|
||||
readOnly: true
|
||||
- name: udev-data
|
||||
mountPath: /run/udev
|
||||
- name: host-dir
|
||||
mountPath: /host
|
||||
mountPropagation: Bidirectional
|
||||
- mountPath: /sys
|
||||
name: sys-dir
|
||||
- name: dev-dir
|
||||
mountPath: /dev
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: csi-proxy
|
||||
image: docker.io/democraticcsi/csi-grpc-proxy:v0.5.6
|
||||
env:
|
||||
- name: BIND_TO
|
||||
value: unix:///csi-data/csi.sock
|
||||
- name: PROXY_TO
|
||||
value: unix:///csi-data/csi.sock.internal
|
||||
volumeMounts:
|
||||
- mountPath: /csi-data
|
||||
name: socket-dir
|
||||
- name: driver-registrar
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.9.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi-data/csi.sock
|
||||
- --kubelet-registration-path=/var/lib/kubelet/plugins/org.democratic-csi.iscsi-synology/csi.sock
|
||||
env:
|
||||
- name: KUBE_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- /csi-node-driver-registrar
|
||||
- --kubelet-registration-path=/var/lib/kubelet/plugins/org.democratic-csi.iscsi-synology/csi.sock
|
||||
- --mode=kubelet-registration-probe
|
||||
volumeMounts:
|
||||
- mountPath: /csi-data
|
||||
name: socket-dir
|
||||
- name: registration-dir
|
||||
mountPath: /registration
|
||||
- name: kubelet-dir
|
||||
mountPath: /var/lib/kubelet
|
||||
- name: cleanup
|
||||
image: docker.io/busybox:1.37.0
|
||||
command:
|
||||
- /bin/sh
|
||||
args:
|
||||
- -c
|
||||
- |-
|
||||
sleep infinity &
|
||||
trap 'kill !$' INT TERM
|
||||
wait
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- rm -rf /plugins/org.democratic-csi.iscsi-synology /registration/org.democratic-csi.iscsi-synology-reg.sock
|
||||
volumeMounts:
|
||||
- name: plugins-dir
|
||||
mountPath: /plugins
|
||||
- name: registration-dir
|
||||
mountPath: /registration
|
||||
volumes:
|
||||
- name: socket-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/plugins/org.democratic-csi.iscsi-synology
|
||||
type: DirectoryOrCreate
|
||||
- name: plugins-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/plugins
|
||||
type: Directory
|
||||
- name: registration-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/plugins_registry
|
||||
type: Directory
|
||||
- name: kubelet-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet
|
||||
type: Directory
|
||||
- name: iscsi-dir
|
||||
hostPath:
|
||||
path: /etc/iscsi
|
||||
type: Directory
|
||||
- name: iscsi-info
|
||||
hostPath:
|
||||
path: /var/lib/iscsi
|
||||
- name: dev-dir
|
||||
hostPath:
|
||||
path: /dev
|
||||
type: Directory
|
||||
- name: modules-dir
|
||||
hostPath:
|
||||
path: /lib/modules
|
||||
- name: localtime
|
||||
hostPath:
|
||||
path: /etc/localtime
|
||||
- name: udev-data
|
||||
hostPath:
|
||||
path: /run/udev
|
||||
- name: sys-dir
|
||||
hostPath:
|
||||
path: /sys
|
||||
type: Directory
|
||||
- name: host-dir
|
||||
hostPath:
|
||||
path: /
|
||||
type: Directory
|
||||
- name: config
|
||||
secret:
|
||||
secretName: csi-synology-democratic-csi-driver-config
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
|
||||
---
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: csi-synology-democratic-csi-controller
|
||||
namespace: democratic-csi
|
||||
labels:
|
||||
app.kubernetes.io/name: democratic-csi
|
||||
app.kubernetes.io/csi-role: controller
|
||||
app.kubernetes.io/component: controller-linux
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: democratic-csi
|
||||
app.kubernetes.io/csi-role: controller
|
||||
app.kubernetes.io/component: controller-linux
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: democratic-csi
|
||||
app.kubernetes.io/csi-role: controller
|
||||
app.kubernetes.io/component: controller-linux
|
||||
spec:
|
||||
serviceAccount: csi-synology-democratic-csi-controller-sa
|
||||
priorityClassName: system-cluster-critical
|
||||
hostNetwork: false
|
||||
dnsPolicy: ClusterFirst
|
||||
hostAliases: []
|
||||
hostIPC: false
|
||||
containers:
|
||||
- name: external-attacher
|
||||
image: registry.k8s.io/sig-storage/csi-attacher:v4.4.0
|
||||
args:
|
||||
- --v=5
|
||||
- --leader-election
|
||||
- --leader-election-namespace=democratic-csi
|
||||
- --timeout=90s
|
||||
- --worker-threads=10
|
||||
- --csi-address=/csi-data/csi.sock
|
||||
volumeMounts:
|
||||
- mountPath: /csi-data
|
||||
name: socket-dir
|
||||
- name: external-provisioner
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v3.6.0
|
||||
args:
|
||||
- --v=5
|
||||
- --leader-election
|
||||
- --leader-election-namespace=democratic-csi
|
||||
- --timeout=90s
|
||||
- --worker-threads=10
|
||||
- --extra-create-metadata
|
||||
- --csi-address=/csi-data/csi.sock
|
||||
volumeMounts:
|
||||
- mountPath: /csi-data
|
||||
name: socket-dir
|
||||
env:
|
||||
- name: NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
- name: NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.namespace
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.name
|
||||
- name: csi-driver
|
||||
image: docker.io/democraticcsi/democratic-csi:latest
|
||||
args:
|
||||
- --csi-version=1.5.0
|
||||
- --csi-name=org.democratic-csi.iscsi-synology
|
||||
- --driver-config-file=/config/driver-config-file.yaml
|
||||
- --log-level=debug
|
||||
- --csi-mode=controller
|
||||
- --server-socket=/csi-data/csi.sock.internal
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
exec:
|
||||
command:
|
||||
- bin/liveness-probe
|
||||
- --csi-version=1.5.0
|
||||
- --csi-address=/csi-data/csi.sock.internal
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 15
|
||||
periodSeconds: 60
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /csi-data
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: csi-proxy
|
||||
image: docker.io/democraticcsi/csi-grpc-proxy:v0.5.6
|
||||
env:
|
||||
- name: BIND_TO
|
||||
value: unix:///csi-data/csi.sock
|
||||
- name: PROXY_TO
|
||||
value: unix:///csi-data/csi.sock.internal
|
||||
volumeMounts:
|
||||
- mountPath: /csi-data
|
||||
name: socket-dir
|
||||
volumes:
|
||||
- name: socket-dir
|
||||
emptyDir: {}
|
||||
- name: config
|
||||
secret:
|
||||
secretName: csi-synology-democratic-csi-driver-config
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: CSIDriver
|
||||
metadata:
|
||||
name: org.democratic-csi.iscsi-synology
|
||||
labels:
|
||||
app.kubernetes.io/name: democratic-csi
|
||||
spec:
|
||||
attachRequired: true
|
||||
podInfoOnMount: true
|
||||
Reference in New Issue
Block a user