diff --git a/nfs-pv-pod.yaml b/nfs-pv-pod.yaml new file mode 100644 index 0000000..bd4d63c --- /dev/null +++ b/nfs-pv-pod.yaml @@ -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 + + diff --git a/pod-secret-as-var.yaml b/pod-secret-as-var.yaml new file mode 100644 index 0000000..d342d73 --- /dev/null +++ b/pod-secret-as-var.yaml @@ -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 + diff --git a/pod-secret.yaml b/pod-secret.yaml new file mode 100644 index 0000000..b763348 --- /dev/null +++ b/pod-secret.yaml @@ -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 + diff --git a/pv-nfs.yaml b/pv-nfs.yaml new file mode 100644 index 0000000..be0c3b3 --- /dev/null +++ b/pv-nfs.yaml @@ -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 + diff --git a/pv-pod.yaml b/pv-pod.yaml new file mode 100644 index 0000000..380a75b --- /dev/null +++ b/pv-pod.yaml @@ -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 + diff --git a/pv.yaml b/pv.yaml new file mode 100644 index 0000000..a2c87b4 --- /dev/null +++ b/pv.yaml @@ -0,0 +1,14 @@ +kind: PersistentVolume +apiVersion: v1 +metadata: + name: pv-volume + labels: + type: local +spec: + capacity: + storage: 2Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/mydata" + diff --git a/pvc-nfs.yaml b/pvc-nfs.yaml new file mode 100644 index 0000000..559814d --- /dev/null +++ b/pvc-nfs.yaml @@ -0,0 +1,10 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: nfs-pv-claim +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 100Mi diff --git a/pvc.yaml b/pvc.yaml new file mode 100644 index 0000000..6480c02 --- /dev/null +++ b/pvc.yaml @@ -0,0 +1,10 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: pv-claim +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/shared-storage.yaml b/shared-storage.yaml new file mode 100644 index 0000000..1eb6719 --- /dev/null +++ b/shared-storage.yaml @@ -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: {}