Add nfs-server
parent
829cc1777e
commit
16f8427610
|
|
@ -0,0 +1,49 @@
|
|||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs-service
|
||||
spec:
|
||||
clusterIP: 10.100.10.10
|
||||
selector:
|
||||
role: nfs
|
||||
ports:
|
||||
# Open the ports required by the NFS server
|
||||
# Port 2049 for TCP
|
||||
- name: tcp-2049
|
||||
port: 2049
|
||||
protocol: TCP
|
||||
|
||||
# Port 111 for UDP
|
||||
- name: udp-111
|
||||
port: 111
|
||||
type: ClusterIP
|
||||
---
|
||||
kind: Pod
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs-server
|
||||
labels:
|
||||
role: nfs
|
||||
spec:
|
||||
containers:
|
||||
- name: nfs-server
|
||||
image: cpuguy83/nfs-server
|
||||
securityContext:
|
||||
privileged: true
|
||||
args:
|
||||
# Pass the paths to share to the Docker image
|
||||
- /exports
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: nfs-k8s
|
||||
annotations:
|
||||
storageclass.kubernetes.io/is-default-class: "true"
|
||||
provisioner: nfs
|
||||
parameters:
|
||||
server: 10.100.10.10
|
||||
path: /share
|
||||
readOnly: "false"
|
||||
reclaimPolicy: Retain
|
||||
volumeBindingMode: WaitForFirstConsumer
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs-service
|
||||
spec:
|
||||
clusterIP: 10.100.10.10
|
||||
selector:
|
||||
role: nfs
|
||||
ports:
|
||||
# Open the ports required by the NFS server
|
||||
# Port 2049 for TCP
|
||||
- name: tcp-2049
|
||||
port: 2049
|
||||
protocol: TCP
|
||||
|
||||
# Port 111 for UDP
|
||||
- name: udp-111
|
||||
port: 111
|
||||
type: ClusterIP
|
||||
---
|
||||
kind: Pod
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nfs-server
|
||||
labels:
|
||||
role: nfs
|
||||
spec:
|
||||
containers:
|
||||
- name: nfs-server
|
||||
image: cpuguy83/nfs-server
|
||||
securityContext:
|
||||
privileged: true
|
||||
args:
|
||||
# Pass the paths to share to the Docker image
|
||||
- /exports
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1005
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.14.2
|
||||
ports:
|
||||
- containerPort: 80
|
||||
volumeMounts:
|
||||
- name: nfs-pv
|
||||
mountPath: /usr/share/nginx/html
|
||||
volumes:
|
||||
- name: nfs-pv
|
||||
persistentVolumeClaim:
|
||||
claimName: nfs-pvc
|
||||
Loading…
Reference in New Issue