glusterfs 3.12.3
操作步骤
这里的配置步骤都是基于前几篇文章来的,就不详细说明了
PV&PVC配置
1.编写mysql pv yaml文件如下:
[root@k8s-master yaml]# vi glusterfs-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: wordpress-mysql
labels:
name: mysql
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
glusterfs:
endpoints: "glusterfs-cluster"
path: "mysql-volume"
readOnly: false2.编写mysql pvc yaml文件如下:
[root@k8s-master yaml]# vi glusterfs-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wordpress-mysql-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
selector:
matchLabels:
name: "mysql"3.启动上述2 文件
[root@k8s-master yaml]# kubectl apply -f glusterfs-pv.yaml
persistentvolume "wordpress-mysql" configured
[root@k8s-master yaml]# kubectl apply -f glusterfs-pvc.yaml
persistentvolumeclaim "wordpress-mysql-pvc" configured4.编写wordpress pv & pvc yaml配置文件,这里将2个写在一起
[root@k8s-master yaml]# vi wordpress-pvc.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: wordpress-html
<