Skip to content

Commit

Permalink
Merge branch 'csi-v1.0' into default_multiwrite_blockmode
Browse files Browse the repository at this point in the history
  • Loading branch information
j-griffith committed Mar 18, 2019
2 parents 6ec1196 + a4dd845 commit 3951b4a
Show file tree
Hide file tree
Showing 30 changed files with 133 additions and 60 deletions.
9 changes: 8 additions & 1 deletion cmd/cephfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

var (
endpoint = flag.String("endpoint", "unix://tmp/csi.sock", "CSI endpoint")
driverName = flag.String("drivername", "csi-cephfsplugin", "name of the driver")
driverName = flag.String("drivername", "cephfs.csi.ceph.com", "name of the driver")
nodeID = flag.String("nodeid", "", "node id")
volumeMounter = flag.String("volumemounter", "", "default volume mounter (possible options are 'kernel', 'fuse')")
metadataStorage = flag.String("metadatastorage", "", "metadata persistence method [node|k8s_configmap]")
Expand All @@ -43,6 +43,13 @@ func init() {

func main() {

err := util.ValidateDriverName(*driverName)
if err != nil {
klog.Fatalln(err)
}
//update plugin name
cephfs.PluginFolder = cephfs.PluginFolder + *driverName

cp, err := util.CreatePersistanceStorage(cephfs.PluginFolder, *metadataStorage, *driverName)
if err != nil {
os.Exit(1)
Expand Down
9 changes: 8 additions & 1 deletion cmd/rbd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

var (
endpoint = flag.String("endpoint", "unix://tmp/csi.sock", "CSI endpoint")
driverName = flag.String("drivername", "csi-rbdplugin", "name of the driver")
driverName = flag.String("drivername", "rbd.csi.ceph.com", "name of the driver")
nodeID = flag.String("nodeid", "", "node id")
containerized = flag.Bool("containerized", true, "whether run as containerized")
metadataStorage = flag.String("metadatastorage", "", "metadata persistence method [node|k8s_configmap]")
Expand All @@ -43,6 +43,13 @@ func init() {

func main() {

err := util.ValidateDriverName(*driverName)
if err != nil {
klog.Fatalln(err)
}
//update plugin name
rbd.PluginFolder = rbd.PluginFolder + *driverName

cp, err := util.CreatePersistanceStorage(rbd.PluginFolder, *metadataStorage, *driverName)
if err != nil {
os.Exit(1)
Expand Down
6 changes: 6 additions & 0 deletions deploy/cephfs/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ If you want to delete your Chart, use this command
```bash
helm delete --purge "ceph-csi-cephfs"
```

If you want to delete the namespace, use this command

```bash
kubectl delete namespace ceph-csi-rbd
```
10 changes: 8 additions & 2 deletions deploy/cephfs/helm/templates/nodeplugin-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ spec:
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/csi-cephfsplugin /registration/csi-cephfsplugin-reg.sock"]
command: [
"/bin/sh", "-c",
'rm -rf /registration/{{ .Values.driverName }}
/registration/{{ .Values.driverName }}-reg.sock'
]
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand All @@ -64,11 +68,13 @@ spec:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=csi-cephfsplugin"
- "--drivername=$(DRIVER_NAME)"
- "--metadatastorage=k8s_configmap"
env:
- name: HOST_ROOTFS
value: "/rootfs"
- name: DRIVER_NAME
value: {{ .Values.driverName }}
- name: NODE_ID
valueFrom:
fieldRef:
Expand Down
4 changes: 3 additions & 1 deletion deploy/cephfs/helm/templates/provisioner-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ spec:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=csi-cephfsplugin"
- "--drivername=$(DRIVER_NAME)"
- "--metadatastorage=k8s_configmap"
env:
- name: HOST_ROOTFS
value: "/rootfs"
- name: DRIVER_NAME
value: {{ .Values.driverName }}
- name: NODE_ID
valueFrom:
fieldRef:
Expand Down
4 changes: 2 additions & 2 deletions deploy/cephfs/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ serviceAccounts:
create: true
name:

socketDir: /var/lib/kubelet/plugins/csi-cephfsplugin
socketDir: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
socketFile: csi.sock
registrationDir: /var/lib/kubelet/plugins_registry
volumeDevicesDir: /var/lib/kubelet/plugins/kubernetes.io/csi/volumeDevices

driverName: cephfs.csi.ceph.com
attacher:
name: attacher

Expand Down
6 changes: 3 additions & 3 deletions deploy/cephfs/kubernetes/csi-cephfsplugin-attacher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ spec:
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/csi-cephfsplugin/csi.sock
value: /var/lib/kubelet/plugins/cephfs.csi.ceph.com/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-cephfsplugin
mountPath: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
volumes:
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-cephfsplugin
path: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
type: DirectoryOrCreate
12 changes: 6 additions & 6 deletions deploy/cephfs/kubernetes/csi-cephfsplugin-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ spec:
- "--v=5"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/csi-cephfsplugin/csi-provisioner.sock
value: /var/lib/kubelet/plugins/cephfs.csi.ceph.com/csi-provisioner.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-cephfsplugin
mountPath: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
- name: csi-cephfsplugin
securityContext:
privileged: true
Expand All @@ -49,7 +49,7 @@ spec:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=csi-cephfsplugin"
- "--drivername=cephfs.csi.ceph.com"
- "--metadatastorage=k8s_configmap"
env:
- name: NODE_ID
Expand All @@ -61,11 +61,11 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CSI_ENDPOINT
value: unix://var/lib/kubelet/plugins/csi-cephfsplugin/csi-provisioner.sock
value: unix://var/lib/kubelet/plugins/cephfs.csi.ceph.com/csi-provisioner.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-cephfsplugin
mountPath: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
- name: host-sys
mountPath: /sys
- name: lib-modules
Expand All @@ -76,7 +76,7 @@ spec:
volumes:
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-cephfsplugin
path: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
type: DirectoryOrCreate
- name: host-sys
hostPath:
Expand Down
10 changes: 5 additions & 5 deletions deploy/cephfs/kubernetes/csi-cephfsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
- "--kubelet-registration-path=/var/lib/kubelet/plugins/csi-cephfsplugin/csi.sock"
- "--kubelet-registration-path=/var/lib/kubelet/plugins/cephfs.csi.ceph.com/csi.sock"
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -53,7 +53,7 @@ spec:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=csi-cephfsplugin"
- "--drivername=cephfs.csi.ceph.com"
- "--metadatastorage=k8s_configmap"
env:
- name: NODE_ID
Expand All @@ -65,11 +65,11 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CSI_ENDPOINT
value: unix://var/lib/kubelet/plugins/csi-cephfsplugin/csi.sock
value: unix://var/lib/kubelet/plugins/cephfs.csi.ceph.com/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: plugin-dir
mountPath: /var/lib/kubelet/plugins/csi-cephfsplugin
mountPath: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
- name: csi-plugins-dir
mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi
mountPropagation: "Bidirectional"
Expand All @@ -86,7 +86,7 @@ spec:
volumes:
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-cephfsplugin/
path: /var/lib/kubelet/plugins/cephfs.csi.ceph.com/
type: DirectoryOrCreate
- name: csi-plugins-dir
hostPath:
Expand Down
6 changes: 6 additions & 0 deletions deploy/rbd/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ If you want to delete your Chart, use this command
```bash
helm delete --purge "ceph-csi-rbd"
```

If you want to delete the namespace, use this command

```bash
kubectl delete namespace ceph-csi-rbd
```
10 changes: 8 additions & 2 deletions deploy/rbd/helm/templates/nodeplugin-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ spec:
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/csi-rbdplugin /registration/csi-rbdplugin-reg.sock"]
command: [
"/bin/sh", "-c",
'rm -rf /registration/{{ .Values.driverName }}
/registration/{{ .Values.driverName }}-reg.sock'
]
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand All @@ -64,12 +68,14 @@ spec:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=csi-rbdplugin"
- "--drivername=$(DRIVER_NAME)"
- "--containerized=true"
- "--metadatastorage=k8s_configmap"
env:
- name: HOST_ROOTFS
value: "/rootfs"
- name: DRIVER_NAME
value: {{ .Values.driverName }}
- name: NODE_ID
valueFrom:
fieldRef:
Expand Down
4 changes: 3 additions & 1 deletion deploy/rbd/helm/templates/provisioner-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ spec:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=csi-rbdplugin"
- "--drivername=$(DRIVER_NAME)"
- "--containerized=true"
- "--metadatastorage=k8s_configmap"
env:
- name: HOST_ROOTFS
value: "/rootfs"
- name: DRIVER_NAME
value: {{ .Values.driverName }}
- name: NODE_ID
valueFrom:
fieldRef:
Expand Down
3 changes: 2 additions & 1 deletion deploy/rbd/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ serviceAccounts:
create: true
name:

socketDir: /var/lib/kubelet/plugins/csi-rbdplugin
socketDir: /var/lib/kubelet/plugins/rbd.csi.ceph.com
socketFile: csi.sock
registrationDir: /var/lib/kubelet/plugins_registry
volumeDevicesDir: /var/lib/kubelet/plugins/kubernetes.io/csi/volumeDevices
driverName: rbd.csi.ceph.com

attacher:
name: attacher
Expand Down
6 changes: 3 additions & 3 deletions deploy/rbd/kubernetes/csi-rbdplugin-attacher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ spec:
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/csi-rbdplugin/csi.sock
value: /var/lib/kubelet/plugins/rbd.csi.ceph.com/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-rbdplugin
mountPath: /var/lib/kubelet/plugins/rbd.csi.ceph.com
volumes:
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-rbdplugin
path: /var/lib/kubelet/plugins/rbd.csi.ceph.com
type: DirectoryOrCreate
16 changes: 8 additions & 8 deletions deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ spec:
- "--v=5"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/csi-rbdplugin/csi-provisioner.sock
value: /var/lib/kubelet/plugins/rbd.csi.ceph.com/csi-provisioner.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-rbdplugin
mountPath: /var/lib/kubelet/plugins/rbd.csi.ceph.com
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.0.1
args:
Expand All @@ -47,13 +47,13 @@ spec:
- "--v=5"
env:
- name: ADDRESS
value: /var/lib/kubelet/plugins/csi-rbdplugin/csi-provisioner.sock
value: /var/lib/kubelet/plugins/rbd.csi.ceph.com/csi-provisioner.sock
imagePullPolicy: Always
securityContext:
privileged: true
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-rbdplugin
mountPath: /var/lib/kubelet/plugins/rbd.csi.ceph.com
- name: csi-rbdplugin
securityContext:
privileged: true
Expand All @@ -64,7 +64,7 @@ spec:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=csi-rbdplugin"
- "--drivername=rbd.csi.ceph.com"
- "--containerized=true"
- "--metadatastorage=k8s_configmap"
env:
Expand All @@ -79,11 +79,11 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: CSI_ENDPOINT
value: unix://var/lib/kubelet/plugins/csi-rbdplugin/csi-provisioner.sock
value: unix://var/lib/kubelet/plugins/rbd.csi.ceph.com/csi-provisioner.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/kubelet/plugins/csi-rbdplugin
mountPath: /var/lib/kubelet/plugins/rbd.csi.ceph.com
- mountPath: /dev
name: host-dev
- mountPath: /rootfs
Expand All @@ -108,5 +108,5 @@ spec:
path: /lib/modules
- name: socket-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-rbdplugin
path: /var/lib/kubelet/plugins/rbd.csi.ceph.com
type: DirectoryOrCreate
Loading

0 comments on commit 3951b4a

Please sign in to comment.