k8s使用glusterfs

glusterfs-endpoints.json

{
  "kind": "Endpoints",
  "apiVersion": "v1",
  "metadata": {
    "name": "glusterfs-cluster",
    "namespace": "app-bi"
  },
  "subsets": [
    {
      "addresses": [
        {
          "ip": "100.20.111.145"
        }
      ],
      "ports": [
        {
          "port": 2990
        }
      ]
    },
    {
      "addresses": [
        {
          "ip": "1o0.20.111.146"
        }
      ],
      "ports": [
        {
          "port": 2990
        }
      ]
    },
    {
      "addresses": [
        {
          "ip": "100.20.111.148"
        }
      ],
      "ports": [
        {
          "port": 2990
        }
      ]
    }
  ]
}

kubectl create -f glusterfs-endpoints.json

glusterfs-service.json

{
  "kind": "Service",
  "apiVersion": "v1",
  "metadata": {
    "name": "glusterfs-cluster",
    "namespace": "app-bi"
  },
  "spec": {
    "ports": [
      {"port": 2990}
    ]
  }
}

kubectl create -f glusterfs-service.json

app-server-data-pv.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-app-server-data
  namespace: app-bi
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteMany
  glusterfs:
    endpoints: glusterfs-cluster
    path: app-server-data
    readOnly: false

kubectl create -f app-server-data-pv.yaml

上一篇:Glusterfs的超级缺陷


下一篇:k8s使用glusterfs存储报错type 'features/utime'