This commit is contained in:
parent
8dd47900cf
commit
7f0a136cf7
13 changed files with 265 additions and 0 deletions
7
files/nfs/StorageClass.yaml
Normal file
7
files/nfs/StorageClass.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
kind: StorageClass
|
||||
apiVersion: storage.k8s.io/v1
|
||||
metadata:
|
||||
name: nfs
|
||||
provisioner: reslinger.net/nfs
|
||||
mountOptions:
|
||||
- vers=4.1
|
||||
8
files/nfs/leader-locking-nfs-provisioner-Role.yaml
Normal file
8
files/nfs/leader-locking-nfs-provisioner-Role.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
kind: Role
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: leader-locking-nfs-provisioner
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["endpoints"]
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||
13
files/nfs/leader-locking-nfs-provisioner-RoleBinding.yaml
Normal file
13
files/nfs/leader-locking-nfs-provisioner-RoleBinding.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
kind: RoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: leader-locking-nfs-provisioner
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: nfs-provisioner
|
||||
# replace with namespace where provisioner is deployed
|
||||
namespace: default
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: leader-locking-nfs-provisioner
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
77
files/nfs/nfs-provisioner-Deployment.yaml
Normal file
77
files/nfs/nfs-provisioner-Deployment.yaml
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: nfs-provisioner
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nfs-provisioner
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nfs-provisioner
|
||||
spec:
|
||||
serviceAccount: nfs-provisioner
|
||||
containers:
|
||||
- name: nfs-provisioner
|
||||
image: quay.io/kubernetes_incubator/nfs-provisioner:latest
|
||||
ports:
|
||||
- name: nfs
|
||||
containerPort: 2049
|
||||
- name: nfs-udp
|
||||
containerPort: 2049
|
||||
protocol: UDP
|
||||
- name: nlockmgr
|
||||
containerPort: 32803
|
||||
- name: nlockmgr-udp
|
||||
containerPort: 32803
|
||||
protocol: UDP
|
||||
- name: mountd
|
||||
containerPort: 20048
|
||||
- name: mountd-udp
|
||||
containerPort: 20048
|
||||
protocol: UDP
|
||||
- name: rquotad
|
||||
containerPort: 875
|
||||
- name: rquotad-udp
|
||||
containerPort: 875
|
||||
protocol: UDP
|
||||
- name: rpcbind
|
||||
containerPort: 111
|
||||
- name: rpcbind-udp
|
||||
containerPort: 111
|
||||
protocol: UDP
|
||||
- name: statd
|
||||
containerPort: 662
|
||||
- name: statd-udp
|
||||
containerPort: 662
|
||||
protocol: UDP
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- DAC_READ_SEARCH
|
||||
- SYS_RESOURCE
|
||||
args:
|
||||
- "-provisioner=reslinger.net/nfs"
|
||||
env:
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: SERVICE_NAME
|
||||
value: nfs-provisioner
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
volumeMounts:
|
||||
- name: export-volume
|
||||
mountPath: /export
|
||||
volumes:
|
||||
- name: export-volume
|
||||
hostPath:
|
||||
path: /srv
|
||||
23
files/nfs/nfs-provisioner-PodSecurityPolicy.yaml
Normal file
23
files/nfs/nfs-provisioner-PodSecurityPolicy.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
apiVersion: extensions/v1beta1
|
||||
kind: PodSecurityPolicy
|
||||
metadata:
|
||||
name: nfs-provisioner
|
||||
spec:
|
||||
fsGroup:
|
||||
rule: RunAsAny
|
||||
allowedCapabilities:
|
||||
- DAC_READ_SEARCH
|
||||
- SYS_RESOURCE
|
||||
runAsUser:
|
||||
rule: RunAsAny
|
||||
seLinux:
|
||||
rule: RunAsAny
|
||||
supplementalGroups:
|
||||
rule: RunAsAny
|
||||
volumes:
|
||||
- configMap
|
||||
- downwardAPI
|
||||
- emptyDir
|
||||
- persistentVolumeClaim
|
||||
- secret
|
||||
- hostPath
|
||||
40
files/nfs/nfs-provisioner-Service.yaml
Normal file
40
files/nfs/nfs-provisioner-Service.yaml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs-provisioner
|
||||
labels:
|
||||
app: nfs-provisioner
|
||||
spec:
|
||||
ports:
|
||||
- name: nfs
|
||||
port: 2049
|
||||
- name: nfs-udp
|
||||
port: 2049
|
||||
protocol: UDP
|
||||
- name: nlockmgr
|
||||
port: 32803
|
||||
- name: nlockmgr-udp
|
||||
port: 32803
|
||||
protocol: UDP
|
||||
- name: mountd
|
||||
port: 20048
|
||||
- name: mountd-udp
|
||||
port: 20048
|
||||
protocol: UDP
|
||||
- name: rquotad
|
||||
port: 875
|
||||
- name: rquotad-udp
|
||||
port: 875
|
||||
protocol: UDP
|
||||
- name: rpcbind
|
||||
port: 111
|
||||
- name: rpcbind-udp
|
||||
port: 111
|
||||
protocol: UDP
|
||||
- name: statd
|
||||
port: 662
|
||||
- name: statd-udp
|
||||
port: 662
|
||||
protocol: UDP
|
||||
selector:
|
||||
app: nfs-provisioner
|
||||
4
files/nfs/nfs-provisioner-ServiceAccount.yaml
Normal file
4
files/nfs/nfs-provisioner-ServiceAccount.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: nfs-provisioner
|
||||
24
files/nfs/nfs-provisioner-runner-ClusterRole.yaml
Normal file
24
files/nfs/nfs-provisioner-runner-ClusterRole.yaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: nfs-provisioner-runner
|
||||
rules:
|
||||
- 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: ["create", "update", "patch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["services", "endpoints"]
|
||||
verbs: ["get"]
|
||||
- apiGroups: ["extensions"]
|
||||
resources: ["podsecuritypolicies"]
|
||||
resourceNames: ["nfs-provisioner"]
|
||||
verbs: ["use"]
|
||||
13
files/nfs/run-nfs-provisioner-ClusterRoleBinding.yaml
Normal file
13
files/nfs/run-nfs-provisioner-ClusterRoleBinding.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: run-nfs-provisioner
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: nfs-provisioner
|
||||
# replace with namespace where provisioner is deployed
|
||||
namespace: default
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: nfs-provisioner-runner
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
Loading…
Add table
Add a link
Reference in a new issue