files for module 06 Managing Storage

This commit is contained in:
Gabun 2020-12-14 18:13:46 +01:00
parent 254b895faa
commit 3b51899071
9 changed files with 158 additions and 0 deletions

28
nfs-pv-pod.yaml Normal file
View File

@ -0,0 +1,28 @@
kind: Pod
apiVersion: v1
metadata:
name: nfs-pv-pod
spec:
volumes:
- name: nfs-pv
persistentVolumeClaim:
claimName: nfs-pv-claim
containers:
- name: nfs-client1
image: centos:latest
command:
- sleep
- "3600"
volumeMounts:
- mountPath: "/nfsshare"
name: nfs-pv
- name: nfs-client2
image: centos:latest
command:
- sleep
- "3600"
volumeMounts:
- mountPath: "/nfsshare"
name: nfs-pv

18
pod-secret-as-var.yaml Normal file
View File

@ -0,0 +1,18 @@
apiVersion: v1
kind: Pod
metadata:
name: mymysql
spec:
containers:
- name: famke-mysql
image: busybox
command:
- sleep
- "3600"
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql
key: password

19
pod-secret.yaml Normal file
View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Pod
metadata:
name: secretbox2
spec:
containers:
- name: secretbox
image: busybox
command:
- sleep
- "3600"
volumeMounts:
- name: secret
mountPath: /secretstuff
volumes:
- name: secret
secret:
secretName: secretstuff

15
pv-nfs.yaml Normal file
View File

@ -0,0 +1,15 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-nfs
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
path: /data
server: myserver
readOnly: false

19
pv-pod.yaml Normal file
View File

@ -0,0 +1,19 @@
kind: Pod
apiVersion: v1
metadata:
name: pv-pod
spec:
volumes:
- name: pv-storage
persistentVolumeClaim:
claimName: pv-claim
containers:
- name: pv-container
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: pv-storage

14
pv.yaml Normal file
View File

@ -0,0 +1,14 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume
labels:
type: local
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mydata"

10
pvc-nfs.yaml Normal file
View File

@ -0,0 +1,10 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nfs-pv-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Mi

10
pvc.yaml Normal file
View File

@ -0,0 +1,10 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pv-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

25
shared-storage.yaml Normal file
View File

@ -0,0 +1,25 @@
apiVersion: v1
kind: Pod
metadata:
name: sharedvolume
spec:
containers:
- name: centos1
image: centos:7
command:
- sleep
- "3600"
volumeMounts:
- mountPath: /centos1
name: test
- name: centos2
image: centos:7
command:
- sleep
- "3600"
volumeMounts:
- mountPath: /centos2
name: test
volumes:
- name: test
emptyDir: {}