-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Dockerfile to build docker image - Kubernetes deploy yaml files Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
- Loading branch information
1 parent
93379ae
commit b9dfe6a
Showing
6 changed files
with
222 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM centos:7.4.1708 | ||
|
||
LABEL maintainers="Kubernetes Authors" | ||
LABEL description="Iscsi Driver" | ||
|
||
RUN yum -y install iscsi-initiator-utils && yum -y install epel-release && yum -y install jq && yum clean all | ||
|
||
COPY bin/iscsiplugin /iscsiplugin | ||
ENTRYPOINT ["/iscsiplugin"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This YAML file contains RBAC API objects that are necessary to run external | ||
# CSI attacher for nfs flex adapter | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: csi-attacher | ||
|
||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: 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"] | ||
|
||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: csi-attacher-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: csi-attacher | ||
namespace: default | ||
roleRef: | ||
kind: ClusterRole | ||
name: external-attacher-runner | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# This YAML file contains attacher & csi driver API objects that are necessary | ||
# to run external CSI attacher for nfs | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: csi-iscsi-attacher | ||
labels: | ||
app: csi-iscsi-attacher | ||
spec: | ||
selector: | ||
app: csi-iscsi-attacher | ||
ports: | ||
- name: dummy | ||
port: 12345 | ||
|
||
--- | ||
kind: StatefulSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: csi-iscsi-attacher | ||
spec: | ||
serviceName: "csi-attacher" | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: csi-iscsi-attacher | ||
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: /csi/csi.sock | ||
imagePullPolicy: "IfNotPresent" | ||
volumeMounts: | ||
- name: socket-dir | ||
mountPath: /csi | ||
|
||
- name: iscsi | ||
image: quay.io/k8scsi/iscsiplugin:v1.0.0 | ||
args : | ||
- "--nodeid=$(NODE_ID)" | ||
- "--endpoint=$(CSI_ENDPOINT)" | ||
env: | ||
- name: NODE_ID | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: CSI_ENDPOINT | ||
value: unix://plugin/csi.sock | ||
imagePullPolicy: "IfNotPresent" | ||
volumeMounts: | ||
- name: socket-dir | ||
mountPath: /plugin | ||
volumes: | ||
- name: socket-dir | ||
emptyDir: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This YAML file contains driver-registrar & csi driver nodeplugin API objects | ||
# that are necessary to run CSI nodeplugin for nfs | ||
kind: DaemonSet | ||
apiVersion: apps/v1beta2 | ||
metadata: | ||
name: csi-iscsi-nodeplugin | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: csi-iscsi-nodeplugin | ||
template: | ||
metadata: | ||
labels: | ||
app: csi-iscsi-nodeplugin | ||
spec: | ||
serviceAccount: csi-nodeplugin | ||
hostNetwork: true | ||
containers: | ||
- name: node-driver-registrar | ||
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2 | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: ["/bin/sh", "-c", "rm -rf /registration/csi-iscsiplugin /registration/csi-iscsiplugin-reg.sock"] | ||
args: | ||
- --v=5 | ||
- --csi-address=/plugin/csi.sock | ||
- --kubelet-registration-path=/var/lib/kubelet/plugins/csi-iscsiplugin/csi.sock | ||
env: | ||
- name: KUBE_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
volumeMounts: | ||
- name: plugin-dir | ||
mountPath: /plugin | ||
- name: registration-dir | ||
mountPath: /registration | ||
- name: nfs | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: ["SYS_ADMIN"] | ||
allowPrivilegeEscalation: true | ||
image: quay.io/k8scsi/iscsiplugin:v1.0.0 | ||
args : | ||
- "--nodeid=$(NODE_ID)" | ||
- "--endpoint=$(CSI_ENDPOINT)" | ||
env: | ||
- name: NODE_ID | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: CSI_ENDPOINT | ||
value: unix://plugin/csi.sock | ||
imagePullPolicy: "IfNotPresent" | ||
volumeMounts: | ||
- name: plugin-dir | ||
mountPath: /plugin | ||
- name: pods-mount-dir | ||
mountPath: /var/lib/kubelet/pods | ||
mountPropagation: "Bidirectional" | ||
volumes: | ||
- name: plugin-dir | ||
hostPath: | ||
path: /var/lib/kubelet/plugins/csi-iscsiplugin | ||
type: DirectoryOrCreate | ||
- name: pods-mount-dir | ||
hostPath: | ||
path: /var/lib/kubelet/pods | ||
type: Directory | ||
- hostPath: | ||
path: /var/lib/kubelet/plugins_registry | ||
type: Directory | ||
name: registration-dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This YAML defines all API objects to create RBAC roles for CSI node plugin | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: csi-nodeplugin | ||
|
||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: csi-nodeplugin | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["persistentvolumes"] | ||
verbs: ["get", "list", "watch", "update"] | ||
- apiGroups: [""] | ||
resources: ["nodes"] | ||
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-nodeplugin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: csi-nodeplugin | ||
namespace: default | ||
roleRef: | ||
kind: ClusterRole | ||
name: csi-nodeplugin | ||
apiGroup: rbac.authorization.k8s.io |