Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1 from subodh01/master
Browse files Browse the repository at this point in the history
Added deployment yamls for Centos, Ubuntu1804 and Openshift 3.11
  • Loading branch information
subodh01 authored May 17, 2019
2 parents a47864d + c000174 commit 998bd19
Show file tree
Hide file tree
Showing 22 changed files with 1,290 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# csi-plugin
# csi-plugin

This repository contains Nutanix CSI driver deployment yamls for different OS
and kubernetes distributions. The repository also contains example usage for
the CSI driver.

54 changes: 54 additions & 0 deletions deploy/Centos/ntnx-csi-attacher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2018 Nutanix Inc
#
# Configuration to deploy the CSI Nutanix plugin compatible with Kubernetes >=v1.10
#
# example usage: kubectl create -f <this_file>

kind: StatefulSet
apiVersion: apps/v1
metadata:
name: csi-attacher-ntnx-plugin
namespace: kube-system
spec:
serviceName: "csi-attacher-ntnx-plugin"
replicas: 1
selector:
matchLabels:
app: csi-attacher-ntnx-plugin
template:
metadata:
labels:
app: csi-attacher-ntnx-plugin
spec:
serviceAccount: csi-attacher
containers:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v1.0.1
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: nutanix-csi-plugin
image: ntnx/ntnx-csi:v1.0.1
args :
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
env:
- name: CSI_ENDPOINT
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
volumes:
- name: socket-dir
emptyDir: {}
103 changes: 103 additions & 0 deletions deploy/Centos/ntnx-csi-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Copyright 2018 Nutanix Inc
#
# Configuration to deploy the CSI Nutanix plugin compatible with Kubernetes >=v1.10
#
# example usage: kubectl create -f <this_file>

---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: csi-ntnx-plugin
namespace: kube-system
spec:
selector:
matchLabels:
app: csi-ntnx-plugin
template:
metadata:
labels:
app: csi-ntnx-plugin
spec:
serviceAccount: csi-ntnx-plugin
hostNetwork: true
containers:
- name: driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.1
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
env:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/com.nutanix.csi/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: plugin-dir
mountPath: /csi/
- name: registration-dir
mountPath: /registration
- name: csi-ntnx-plugin
securityContext:
privileged: true
allowPrivilegeEscalation: true
image: ntnx/ntnx-csi:v1.0.1
args :
- "--endpoint=$(CSI_ENDPOINT)"
- "--nodeid=$(NODE_ID)"
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: pods-mount-dir
mountPath: /var/lib/kubelet
# needed so that any mounts setup inside this container are
# propagated back to the host machine.
mountPropagation: "Bidirectional"
- mountPath: /dev
name: device-dir
- mountPath: /etc/iscsi
name: iscsi-dir
- mountPath: /sbin/iscsiadm
name: iscsiadm
- mountPath: /lib/modules
name: lib-dir
volumes:
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/com.nutanix.csi/
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: /var/lib/kubelet
type: Directory
- name: device-dir
hostPath:
path: /dev
- name: iscsi-dir
hostPath:
path: /etc/iscsi
type: Directory
- name: iscsiadm
hostPath:
path: /sbin/iscsiadm
type: File
- name: lib-dir
hostPath:
path: /lib/modules
type: Directory
59 changes: 59 additions & 0 deletions deploy/Centos/ntnx-csi-provisioner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2018 Nutanix Inc
#
# Configuration to deploy the CSI Nutanix plugin compatible with Kubernetes >=v1.10
#
# example usage: kubectl create -f <this_file>

---
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: csi-provisioner-ntnx-plugin
namespace: kube-system
spec:
serviceName: "csi-provisioner-ntnx-plugin"
replicas: 1
selector:
matchLabels:
app: csi-provisioner-ntnx-plugin
template:
metadata:
labels:
app: csi-provisioner-ntnx-plugin
spec:
serviceAccount: csi-provisioner
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.0.1
args:
- "--provisioner=com.nutanix.csi"
- "--csi-address=$(ADDRESS)"
- "--v=5"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: nutanix-csi-plugin
image: ntnx/ntnx-csi:v1.0.1
securityContext:
privileged: true
allowPrivilegeEscalation: true
args :
- "--endpoint=$(CSI_ENDPOINT)"
- "--nodeid=$(NODE_ID)"
env:
- name: CSI_ENDPOINT
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
volumes:
- name: socket-dir
emptyDir: {}
166 changes: 166 additions & 0 deletions deploy/Centos/ntnx-csi-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Copyright 2018 Nutanix Inc
#
# Configuration to deploy the CSI Nutanix plugin compatible with Kubernetes >=v1.10
#
# example usage: kubectl create -f <this_file>

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-attacher
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: external-attacher-runner
namespace: kube-system
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "update"]
- 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"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-attacher-role
namespace: kube-system
subjects:
- kind: ServiceAccount
name: csi-attacher
namespace: kube-system
roleRef:
kind: ClusterRole
name: external-attacher-runner
apiGroup: rbac.authorization.k8s.io

---
# needed for StatefulSet
kind: Service
apiVersion: v1
metadata:
name: csi-attacher-ntnx-plugin
namespace: kube-system
labels:
app: csi-attacher-ntnx-plugin
spec:
selector:
app: csi-attacher-ntnx-plugin
ports:
- name: dummy
port: 12345
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-provisioner
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: external-provisioner-runner
namespace: kube-system
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-provisioner-role
namespace: kube-system
subjects:
- kind: ServiceAccount
name: csi-provisioner
namespace: kube-system
roleRef:
kind: ClusterRole
name: external-provisioner-runner
apiGroup: rbac.authorization.k8s.io
---
# needed for StatefulSet
kind: Service
apiVersion: v1
metadata:
name: csi-provisioner-ntnx-plugin
namespace: kube-system
labels:
app: csi-provisioner-ntnx-plugin
spec:
selector:
app: csi-provisioner-ntnx-plugin
ports:
- name: dummy
port: 12345
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-ntnx-plugin
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-ntnx-plugin
namespace: kube-system
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "update"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-ntnx-plugin
namespace: kube-system
subjects:
- kind: ServiceAccount
name: csi-ntnx-plugin
namespace: kube-system
roleRef:
kind: ClusterRole
name: csi-ntnx-plugin
apiGroup: rbac.authorization.k8s.io

1 change: 1 addition & 0 deletions deploy/Openshift/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This deployment yamls is tested with openshift 3.11
Loading

0 comments on commit 998bd19

Please sign in to comment.