mirror of
https://github.com/cristicalin/synology-csi.git
synced 2026-07-30 17:24:27 +00:00
[v1.23] add support for kubernetes 1.23
This commit is contained in:
157
deploy/kubernetes/v1.23/snapshotter/snapshotter.yaml
Normal file
157
deploy/kubernetes/v1.23/snapshotter/snapshotter.yaml
Normal file
@@ -0,0 +1,157 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: csi-snapshotter-sa
|
||||
namespace: synology-csi
|
||||
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: synology-csi-snapshotter-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["list", "watch", "create", "update", "patch"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshots"]
|
||||
verbs: ["get", "list"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotclasses"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotcontents"]
|
||||
verbs: ["create", "get", "list", "watch", "update", "delete"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotcontents/status"]
|
||||
verbs: ["update"]
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets"]
|
||||
verbs: ["get", "list"]
|
||||
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: synology-csi-snapshotter-role
|
||||
namespace: synology-csi
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: csi-snapshotter-sa
|
||||
namespace: synology-csi
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: synology-csi-snapshotter-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
kind: Role
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
namespace: synology-csi
|
||||
name: synology-csi-snapshotter-cfg
|
||||
rules:
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leases"]
|
||||
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
||||
|
||||
---
|
||||
kind: RoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
namespace: synology-csi
|
||||
name: synology-csi-snapshotter-role-cfg
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: csi-snapshotter-sa
|
||||
namespace: synology-csi
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: synology-csi-snapshotter-cfg
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
kind: StatefulSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: synology-csi-snapshotter
|
||||
namespace: synology-csi
|
||||
spec:
|
||||
serviceName: "synology-csi-snapshotter"
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: synology-csi-snapshotter
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: synology-csi-snapshotter
|
||||
spec:
|
||||
serviceAccountName: csi-snapshotter-sa
|
||||
hostNetwork: true
|
||||
containers:
|
||||
- name: csi-snapshotter
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add: ["SYS_ADMIN"]
|
||||
allowPrivilegeEscalation: true
|
||||
image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.1
|
||||
args:
|
||||
- --v=1
|
||||
- --csi-address=$(ADDRESS)
|
||||
- --leader-election
|
||||
- --http-endpoint=:8083
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /var/lib/csi/sockets/pluginproxy/csi.sock
|
||||
imagePullPolicy: Always
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /var/lib/csi/sockets/pluginproxy/
|
||||
ports:
|
||||
- containerPort: 8083
|
||||
name: snap-port
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
failureThreshold: 1
|
||||
httpGet:
|
||||
path: /healthz/leader-election
|
||||
port: snap-port
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 10
|
||||
periodSeconds: 20
|
||||
- name: csi-plugin
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add: ["SYS_ADMIN"]
|
||||
allowPrivilegeEscalation: true
|
||||
image: cristicalin/synology-csi:v1.0.1
|
||||
args:
|
||||
- --nodeid=$(KUBE_NODE_NAME)
|
||||
- --endpoint=$(CSI_ENDPOINT)
|
||||
- --client-info
|
||||
- /etc/synology/client-info.yml
|
||||
- --log-level=info
|
||||
env:
|
||||
- name: CSI_ENDPOINT
|
||||
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
|
||||
- name: KUBE_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /var/lib/csi/sockets/pluginproxy/
|
||||
- name: client-info
|
||||
mountPath: /etc/synology
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: socket-dir
|
||||
emptyDir: {}
|
||||
- name: client-info
|
||||
secret:
|
||||
secretName: client-info-secret
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: snapshot.storage.k8s.io/v1beta1
|
||||
kind: VolumeSnapshotClass
|
||||
metadata:
|
||||
name: synology-snapshotclass
|
||||
annotations:
|
||||
storageclass.kubernetes.io/is-default-class: "false"
|
||||
labels:
|
||||
velero.io/csi-volumesnapshot-class: "true"
|
||||
driver: csi.san.synology.com
|
||||
deletionPolicy: Retain
|
||||
# parameters:
|
||||
# description: 'Kubernetes CSI'
|
||||
# is_locked: 'false'
|
||||
Reference in New Issue
Block a user