text stringlengths 0 59.1k |
|---|
Use this command to create the service: |
```sh |
$ kubectl create -f examples/volumes/glusterfs/glusterfs-service.yaml |
``` |
#### Create a Pod |
The following *volume* spec in [glusterfs-pod.yaml](glusterfs-pod.yaml) |
illustrates a sample configuration: |
```yaml |
volumes: |
- name: glusterfsvol |
glusterfs: |
endpoints: glusterfs-cluster |
path: kube_vol |
readOnly: true |
``` |
The parameters are explained as the followings. |
- **endpoints** is the name of the Endpoints object that represents a Gluster |
cluster configuration. *kubelet* is optimized to avoid mount storm, it will |
randomly pick one from the endpoints to mount. If this host is unresponsive, |
the next Gluster host in the endpoints is automatically selected. |
- **path** is the Glusterfs volume name. |
- **readOnly** is the boolean that sets the mountpoint readOnly or readWrite. |
Create a pod that has a container using Glusterfs volume, |
```sh |
$ kubectl create -f examples/volumes/glusterfs/glusterfs-pod.yaml |
``` |
You can verify that the pod is running: |
```sh |
$ kubectl get pods |
NAME READY STATUS RESTARTS AGE |
glusterfs 1/1 Running 0 3m |
``` |
You may execute the command `mount` inside the container to see if the |
GlusterFS volume is mounted correctly: |
```sh |
$ kubectl exec glusterfs -- mount | grep gluster |
10.240.106.152:kube_vol on /mnt/glusterfs type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072) |
``` |
You may also run `docker ps` on the host to see the actual container. |
<|endoftext|> |
# source: k8s_examples/_archived/volumes/glusterfs/glusterfs-pod.yaml type: yaml |
apiVersion: v1 |
kind: Pod |
metadata: |
name: glusterfs |
spec: |
containers: |
- name: glusterfs |
image: nginx |
volumeMounts: |
- mountPath: "/mnt/glusterfs" |
name: glusterfsvol |
volumes: |
- name: glusterfsvol |
glusterfs: |
endpoints: glusterfs-cluster |
path: kube_vol |
readOnly: true |
<|endoftext|> |
# source: k8s_examples/_archived/volumes/storageos/storageos-pv.yaml type: yaml |
apiVersion: v1 |
kind: PersistentVolume |
metadata: |
name: pv0001 |
spec: |
capacity: |
storage: 5Gi |
accessModes: |
- ReadWriteOnce |
persistentVolumeReclaimPolicy: Delete |
storageClassName: fast |
storageos: |
# This volume must already exist within StorageOS |
volumeName: pv0001 |
# volumeNamespace is optional, and specifies the volume scope within |
# StorageOS. Set to `default` or leave blank if you are not using |
# namespaces. |
#volumeNamespace: default |
# The filesystem type to create on the volume, if required. |
fsType: ext4 |
# The secret name for API credentials |
secretName: storageos-secret |
<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.