message
This commit is contained in:
parent
eda51e93a9
commit
a99dd482f4
11
nfs-provisioner-pvc-test.yaml
Normal file
11
nfs-provisioner-pvc-test.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: nfs-pvc-test
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-client # SAME NAME AS THE STORAGECLASS
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany # must be the same as PersistentVolume
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 50Mi
|
||||||
62
resize_pvc.yaml
Normal file
62
resize_pvc.yaml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: myvol
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: mystorageclass
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
provisioner: kubernetes.io/no-provisioner
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: mypv
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Recycle
|
||||||
|
storageClassName: mystorageclass
|
||||||
|
hostPath:
|
||||||
|
path: /tmp/pv1
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mypvc
|
||||||
|
namespace: myvol
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 100Mi
|
||||||
|
storageClassName: mystorageclass
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: pv-pod
|
||||||
|
namespace: myvol
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: busybox
|
||||||
|
image: busybox
|
||||||
|
args:
|
||||||
|
- sleep
|
||||||
|
- "3600"
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: "/vol1"
|
||||||
|
name: myvolume
|
||||||
|
volumes:
|
||||||
|
- name: myvolume
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mypvc
|
||||||
@ -1,5 +1,5 @@
|
|||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: staff-role-binding
|
name: staff-role-binding
|
||||||
namespace: staff
|
namespace: staff
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: students-role-binding
|
name: students-role-binding
|
||||||
namespace: students
|
namespace: students
|
||||||
|
|||||||
38
sidecar-logging.yaml
Normal file
38
sidecar-logging.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: logdemo
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: message generator
|
||||||
|
image: busybox
|
||||||
|
args:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
i=0;
|
||||||
|
while true;
|
||||||
|
do
|
||||||
|
echo "$i: $(date)" >> /var/log/1.log;
|
||||||
|
echo "$(date) INFO $i" >> /var/log/2.log;
|
||||||
|
i=$((i+1));
|
||||||
|
sleep 10;
|
||||||
|
done
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
- name: count-log-1
|
||||||
|
image: busybox
|
||||||
|
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/1.log']
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
- name: count-log-2
|
||||||
|
image: busybox
|
||||||
|
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/2.log']
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
volumes:
|
||||||
|
- name: varlog
|
||||||
|
emptyDir: {}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
kind: Role
|
kind: Role
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
namespace: staff
|
namespace: staff
|
||||||
name: staff
|
name: staff
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
kind: Role
|
kind: Role
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
namespace: students
|
namespace: students
|
||||||
name: students
|
name: students
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user