mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 08:20:23 +00:00
02bcb5f16a
Use Deployment with leader election instead of StatefulSet Deployment behaves better when a node gets disconnected from the rest of the cluster - new provisioner leader is elected in ~15 seconds, while it may take up to 5 minutes for StatefulSet to start a new replica. Refer: kubernetes-csi/external-provisioner@52d1fbc Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
120 lines
3.3 KiB
YAML
120 lines
3.3 KiB
YAML
---
|
|
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: csi-cephfsplugin-provisioner
|
|
labels:
|
|
app: csi-cephfsplugin-provisioner
|
|
spec:
|
|
selector:
|
|
app: csi-cephfsplugin-provisioner
|
|
ports:
|
|
- name: dummy
|
|
port: 12345
|
|
|
|
---
|
|
kind: StatefulSet
|
|
apiVersion: apps/v1
|
|
metadata:
|
|
name: csi-cephfsplugin-provisioner
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: csi-cephfsplugin-provisioner
|
|
serviceName: "csi-cephfsplugin-provisioner"
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: csi-cephfsplugin-provisioner
|
|
spec:
|
|
serviceAccount: cephfs-csi-provisioner
|
|
containers:
|
|
- name: csi-provisioner
|
|
image: quay.io/k8scsi/csi-provisioner:v1.3.0
|
|
args:
|
|
- "--csi-address=$(ADDRESS)"
|
|
- "--v=5"
|
|
- "--timeout=60s"
|
|
- "--retry-interval-start=500ms"
|
|
env:
|
|
- name: ADDRESS
|
|
value: unix:///csi/csi-provisioner.sock
|
|
imagePullPolicy: "IfNotPresent"
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
- name: csi-cephfsplugin-attacher
|
|
image: quay.io/k8scsi/csi-attacher:v1.2.0
|
|
args:
|
|
- "--v=5"
|
|
- "--csi-address=$(ADDRESS)"
|
|
env:
|
|
- name: ADDRESS
|
|
value: /csi/csi-provisioner.sock
|
|
imagePullPolicy: "IfNotPresent"
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
- name: csi-cephfsplugin
|
|
securityContext:
|
|
privileged: true
|
|
capabilities:
|
|
add: ["SYS_ADMIN"]
|
|
# for stable functionality replace canary with latest release version
|
|
image: quay.io/cephcsi/cephcsi:canary
|
|
args:
|
|
- "--nodeid=$(NODE_ID)"
|
|
- "--type=cephfs"
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
|
- "--v=5"
|
|
- "--drivername=cephfs.csi.ceph.com"
|
|
- "--metadatastorage=k8s_configmap"
|
|
env:
|
|
- name: NODE_ID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
- name: POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: CSI_ENDPOINT
|
|
value: unix:///csi/csi-provisioner.sock
|
|
imagePullPolicy: "IfNotPresent"
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
- name: host-sys
|
|
mountPath: /sys
|
|
- name: lib-modules
|
|
mountPath: /lib/modules
|
|
readOnly: true
|
|
- name: host-dev
|
|
mountPath: /dev
|
|
- name: ceph-csi-config
|
|
mountPath: /etc/ceph-csi-config/
|
|
- name: keys-tmp-dir
|
|
mountPath: /tmp/csi/keys
|
|
volumes:
|
|
- name: socket-dir
|
|
hostPath:
|
|
path: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
|
|
type: DirectoryOrCreate
|
|
- name: host-sys
|
|
hostPath:
|
|
path: /sys
|
|
- name: lib-modules
|
|
hostPath:
|
|
path: /lib/modules
|
|
- name: host-dev
|
|
hostPath:
|
|
path: /dev
|
|
- name: ceph-csi-config
|
|
configMap:
|
|
name: ceph-csi-config
|
|
- name: keys-tmp-dir
|
|
emptyDir: {
|
|
medium: "Memory"
|
|
}
|