mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
deploy attacher sidecar in rbd provisioner sts
currently we are deploying external-attacher as a seperate statefulset, which leads to attacher communicating with the node provisoner daemonset, This PR deploys external-attacher as a sidecar container inside provisioner statefulset, so that external-provisioner always communicates with the plugin responsible for the provision controller capcabilities. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
426bf67966
commit
3ef11e06c3
@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: rbd-csi-attacher
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: ClusterRole
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
metadata:
|
|
||||||
name: rbd-external-attacher-runner
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["persistentvolumes"]
|
|
||||||
verbs: ["get", "list", "watch", "update"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["nodes"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
- apiGroups: ["storage.k8s.io"]
|
|
||||||
resources: ["volumeattachments"]
|
|
||||||
verbs: ["get", "list", "watch", "update"]
|
|
||||||
- apiGroups: ["csi.storage.k8s.io"]
|
|
||||||
resources: ["csinodeinfos"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: ClusterRoleBinding
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
metadata:
|
|
||||||
name: rbd-csi-attacher-role
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: rbd-csi-attacher
|
|
||||||
namespace: default
|
|
||||||
roleRef:
|
|
||||||
kind: ClusterRole
|
|
||||||
name: rbd-external-attacher-runner
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
@ -43,6 +43,12 @@ rules:
|
|||||||
- apiGroups: ["csi.storage.k8s.io"]
|
- apiGroups: ["csi.storage.k8s.io"]
|
||||||
resources: ["csinodeinfos"]
|
resources: ["csinodeinfos"]
|
||||||
verbs: ["get", "list", "watch"]
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["nodes"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["storage.k8s.io"]
|
||||||
|
resources: ["volumeattachments"]
|
||||||
|
verbs: ["get", "list", "watch", "update"]
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
---
|
|
||||||
kind: Service
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: csi-rbdplugin-attacher
|
|
||||||
labels:
|
|
||||||
app: csi-rbdplugin-attacher
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: csi-rbdplugin-attacher
|
|
||||||
ports:
|
|
||||||
- name: dummy
|
|
||||||
port: 12345
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: StatefulSet
|
|
||||||
apiVersion: apps/v1beta1
|
|
||||||
metadata:
|
|
||||||
name: csi-rbdplugin-attacher
|
|
||||||
spec:
|
|
||||||
serviceName: "csi-rbdplugin-attacher"
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: csi-rbdplugin-attacher
|
|
||||||
spec:
|
|
||||||
serviceAccount: rbd-csi-attacher
|
|
||||||
containers:
|
|
||||||
- name: csi-rbdplugin-attacher
|
|
||||||
image: quay.io/k8scsi/csi-attacher:v1.0.1
|
|
||||||
args:
|
|
||||||
- "--v=5"
|
|
||||||
- "--csi-address=$(ADDRESS)"
|
|
||||||
env:
|
|
||||||
- name: ADDRESS
|
|
||||||
value: unix:///csi/csi-attacher.sock
|
|
||||||
imagePullPolicy: "IfNotPresent"
|
|
||||||
volumeMounts:
|
|
||||||
- name: socket-dir
|
|
||||||
mountPath: /csi
|
|
||||||
volumes:
|
|
||||||
- name: socket-dir
|
|
||||||
hostPath:
|
|
||||||
path: /var/lib/kubelet/plugins/rbd.csi.ceph.com
|
|
||||||
type: DirectoryOrCreate
|
|
@ -54,6 +54,18 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: socket-dir
|
- name: socket-dir
|
||||||
mountPath: /csi
|
mountPath: /csi
|
||||||
|
- name: csi-rbdplugin-attacher
|
||||||
|
image: quay.io/k8scsi/csi-attacher:v1.0.1
|
||||||
|
args:
|
||||||
|
- "--v=5"
|
||||||
|
- "--csi-address=$(ADDRESS)"
|
||||||
|
env:
|
||||||
|
- name: ADDRESS
|
||||||
|
value: /csi/csi.sock
|
||||||
|
imagePullPolicy: "IfNotPresent"
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /csi
|
||||||
- name: csi-rbdplugin
|
- name: csi-rbdplugin
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
Loading…
Reference in New Issue
Block a user