Finish TrueNAS CSI Driver
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: CSIDriver
|
||||
metadata:
|
||||
name: csi.truenas.io
|
||||
spec:
|
||||
attachRequired: true
|
||||
fsGroupPolicy: File
|
||||
podInfoOnMount: true
|
||||
volumeLifecycleModes:
|
||||
- Ephemeral
|
||||
- Persistent
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
defaultPool: datapool
|
||||
iscsiIQNBase: iqn.net.ts.orca-uaru.apex-truenas
|
||||
iscsiPortal: apex-truenas.orca-uaru.ts.net:3260
|
||||
nfsServer: apex-truenas.orca-uaru.ts.net
|
||||
truenasInsecure: "true"
|
||||
truenasURL: wss://apex-truenas.orca-uaru.ts.net/api/current
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: truenas-csi
|
||||
namespace: truenas-csi
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: truenas-csi-controller-role-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: truenas-csi-controller-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: truenas-csi-controller-sa
|
||||
namespace: truenas-csi
|
||||
@@ -0,0 +1,138 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: truenas-csi-controller-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- persistentvolumes
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- persistentvolumeclaims
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- patch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- persistentvolumeclaims/status
|
||||
verbs:
|
||||
- update
|
||||
- patch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- patch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- nodes
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- storage.k8s.io
|
||||
resources:
|
||||
- storageclasses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- storage.k8s.io
|
||||
resources:
|
||||
- csinodes
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- storage.k8s.io
|
||||
resources:
|
||||
- volumeattachments
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- storage.k8s.io
|
||||
resources:
|
||||
- volumeattachments/status
|
||||
verbs:
|
||||
- patch
|
||||
- apiGroups:
|
||||
- snapshot.storage.k8s.io
|
||||
resources:
|
||||
- volumesnapshots
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- patch
|
||||
- apiGroups:
|
||||
- snapshot.storage.k8s.io
|
||||
resources:
|
||||
- volumesnapshots/status
|
||||
verbs:
|
||||
- update
|
||||
- patch
|
||||
- apiGroups:
|
||||
- snapshot.storage.k8s.io
|
||||
resources:
|
||||
- volumesnapshotcontents
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- snapshot.storage.k8s.io
|
||||
resources:
|
||||
- volumesnapshotcontents/status
|
||||
verbs:
|
||||
- update
|
||||
- patch
|
||||
- apiGroups:
|
||||
- snapshot.storage.k8s.io
|
||||
resources:
|
||||
- volumesnapshotclasses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
@@ -0,0 +1,153 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: truenas-csi-controller
|
||||
name: truenas-csi-controller
|
||||
namespace: truenas-csi
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: truenas-csi-controller
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: truenas-csi-controller
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- --endpoint=$(CSI_ENDPOINT)
|
||||
- --node-id=$(NODE_ID)
|
||||
- --mode=controller
|
||||
- --v=4
|
||||
env:
|
||||
- name: CSI_ENDPOINT
|
||||
value: unix:///csi/csi.sock
|
||||
- name: TRUENAS_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: api-key
|
||||
name: truenas-csi-api-credentials
|
||||
- name: NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: TRUENAS_DEFAULT_POOL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: defaultPool
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_INSECURE_SKIP_VERIFY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: truenasInsecure
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_ISCSI_IQN_BASE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: iscsiIQNBase
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_ISCSI_PORTAL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: iscsiPortal
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_NFS_SERVER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: nfsServer
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: truenasURL
|
||||
name: truenas-csi
|
||||
image: ghcr.io/truenas/truenas-csi:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
failureThreshold: 5
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 9808
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 3
|
||||
name: csi-controller
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- args:
|
||||
- --csi-address=$(ADDRESS)
|
||||
- --v=5
|
||||
- --feature-gates=Topology=true
|
||||
- --extra-create-metadata
|
||||
- --leader-election=true
|
||||
- --default-fstype=ext4
|
||||
- --timeout=60s
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
image: registry.k8s.io/sig-storage/csi-provisioner:v6.1.1
|
||||
name: csi-provisioner
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- args:
|
||||
- --csi-address=$(ADDRESS)
|
||||
- --v=5
|
||||
- --leader-election=true
|
||||
- --timeout=60s
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
image: registry.k8s.io/sig-storage/csi-attacher:v4.11.0
|
||||
name: csi-attacher
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- args:
|
||||
- --csi-address=$(ADDRESS)
|
||||
- --v=5
|
||||
- --leader-election=true
|
||||
- --timeout=60s
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
image: registry.k8s.io/sig-storage/csi-snapshotter:v8.5.0
|
||||
name: csi-snapshotter
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- args:
|
||||
- --csi-address=$(ADDRESS)
|
||||
- --v=5
|
||||
- --leader-election=true
|
||||
- --timeout=60s
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
image: registry.k8s.io/sig-storage/csi-resizer:v2.1.0
|
||||
name: csi-resizer
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- args:
|
||||
- --csi-address=/csi/csi.sock
|
||||
- --health-port=9808
|
||||
image: registry.k8s.io/sig-storage/livenessprobe:v2.18.0
|
||||
name: liveness-probe
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
serviceAccountName: truenas-csi-controller-sa
|
||||
volumes:
|
||||
- emptyDir: {}
|
||||
name: socket-dir
|
||||
status: {}
|
||||
@@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: truenas-csi-controller-sa
|
||||
namespace: truenas-csi
|
||||
@@ -4,4 +4,14 @@ metadata:
|
||||
name: truenas-csi
|
||||
namespace: truenas-csi
|
||||
resources:
|
||||
- node-service-account.yaml
|
||||
- node-binding.yaml
|
||||
- node-deamonset.yaml
|
||||
- config.yaml
|
||||
- namespace.yaml
|
||||
- controller-deployment.yaml
|
||||
- controller-cluster-role.yaml
|
||||
- controller-binding.yaml
|
||||
- node-cluster-role.yaml
|
||||
- CSIDriver.yaml
|
||||
- controller-service-account.yaml
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: truenas-csi-node-role-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: truenas-csi-node-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: truenas-csi-node-sa
|
||||
namespace: truenas-csi
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: truenas-csi-node-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- nodes
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- storage.k8s.io
|
||||
resources:
|
||||
- volumeattachments
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
@@ -0,0 +1,170 @@
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
labels:
|
||||
app: truenas-csi-node
|
||||
name: truenas-csi-node
|
||||
namespace: truenas-csi
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: truenas-csi-node
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: truenas-csi-node
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- --endpoint=$(CSI_ENDPOINT)
|
||||
- --node-id=$(NODE_ID)
|
||||
- --mode=node
|
||||
- --v=4
|
||||
env:
|
||||
- name: CSI_ENDPOINT
|
||||
value: unix:///csi/csi.sock
|
||||
- name: TRUENAS_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: api-key
|
||||
name: truenas-csi-api-credentials
|
||||
- name: NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: TRUENAS_DEFAULT_POOL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: defaultPool
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_INSECURE_SKIP_VERIFY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: truenasInsecure
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_ISCSI_IQN_BASE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: iscsiIQNBase
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_ISCSI_PORTAL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: iscsiPortal
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_NFS_SERVER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: nfsServer
|
||||
name: truenas-csi
|
||||
- name: TRUENAS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: truenasURL
|
||||
name: truenas-csi
|
||||
image: ghcr.io/truenas/truenas-csi:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
lifecycle:
|
||||
postStart:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- mkdir -p /run/lock/iscsi && mv /usr/sbin/iscsiadm /usr/sbin/iscsiadm.orig
|
||||
2>/dev/null; printf '#!/bin/sh\nnsenter --mount=/host/proc/1/ns/mnt
|
||||
-- /usr/sbin/iscsiadm "$@"\n' > /usr/sbin/iscsiadm && chmod +x /usr/sbin/iscsiadm
|
||||
livenessProbe:
|
||||
failureThreshold: 5
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 9808
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 3
|
||||
name: csi-node
|
||||
resources: {}
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: plugin-dir
|
||||
- mountPath: /var/lib/kubelet
|
||||
name: kubelet-dir
|
||||
- mountPath: /dev
|
||||
name: device-dir
|
||||
- mountPath: /etc/iscsi
|
||||
mountPropagation: Bidirectional
|
||||
name: iscsi-dir
|
||||
- mountPath: /var/lib/iscsi
|
||||
mountPropagation: Bidirectional
|
||||
name: iscsi-lib
|
||||
- mountPath: /
|
||||
mountPropagation: Bidirectional
|
||||
name: host-root
|
||||
- args:
|
||||
- --csi-address=$(ADDRESS)
|
||||
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
|
||||
- --v=5
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
- name: DRIVER_REG_SOCK_PATH
|
||||
value: /var/lib/kubelet/plugins/csi.truenas.io/csi.sock
|
||||
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.16.0
|
||||
name: csi-node-driver-registrar
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: plugin-dir
|
||||
- mountPath: /registration
|
||||
name: registration-dir
|
||||
- args:
|
||||
- --csi-address=/csi/csi.sock
|
||||
- --health-port=9808
|
||||
image: registry.k8s.io/sig-storage/livenessprobe:v2.18.0
|
||||
name: liveness-probe
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: plugin-dir
|
||||
hostIPC: true
|
||||
hostNetwork: true
|
||||
hostPID: true
|
||||
priorityClassName: system-node-critical
|
||||
serviceAccountName: truenas-csi-node-sa
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
volumes:
|
||||
- hostPath:
|
||||
path: /var/lib/kubelet/plugins_registry/
|
||||
type: DirectoryOrCreate
|
||||
name: registration-dir
|
||||
- hostPath:
|
||||
path: /var/lib/kubelet/plugins/csi.truenas.io/
|
||||
type: DirectoryOrCreate
|
||||
name: plugin-dir
|
||||
- hostPath:
|
||||
path: /var/lib/kubelet
|
||||
type: Directory
|
||||
name: kubelet-dir
|
||||
- hostPath:
|
||||
path: /dev
|
||||
name: device-dir
|
||||
- hostPath:
|
||||
path: /etc/iscsi
|
||||
type: Directory
|
||||
name: iscsi-dir
|
||||
- hostPath:
|
||||
path: /var/lib/iscsi
|
||||
type: DirectoryOrCreate
|
||||
name: iscsi-lib
|
||||
- hostPath:
|
||||
path: /
|
||||
type: Directory
|
||||
name: host-root
|
||||
updateStrategy: {}
|
||||
status:
|
||||
currentNumberScheduled: 0
|
||||
desiredNumberScheduled: 0
|
||||
numberMisscheduled: 0
|
||||
numberReady: 0
|
||||
@@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: truenas-csi-node-sa
|
||||
namespace: truenas-csi
|
||||
Reference in New Issue
Block a user