0

I am playing with Kubespray and want to add GlusterFS persistent volumes. My inventory.ini looks like this:

[all] 
k8s-master    ansible_host=x.x.x.x
k8s-node-1    ansible_host=y.y.y.y disk_volume_device_1=/media/125GB_HDD.img

[kube-master] 
k8s-master

[etcd] 
k8s-master

[kube-node] 
k8s-master 
k8s-node-1

[k8s-cluster:children] 
kube-node 
kube-master

[gfs-cluster] 
k8s-node-1

[network-storage:children] 
gfs-cluster

But I would like to add more devices than just disk_volume_device_1. I tried disk_volume_device_2=/media/20GB_HDD.img but it did not work.

Mariyo
  • 486
  • 7
  • 15

1 Answers1

1

Kubespray is for deploying a cluster.

If you want to change the capacity of deployed Persistent Volumes, you can edit (kubectl edit pv <name_of_pv>) the PersistenVolume.spec and change the capacity.storage value.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: glusterfs 
spec:
  capacity:
      storage: "150Gi"
  accessModes:
    - ReadWriteMany
  glusterfs:
    endpoints: glusterfs
    path: gluster
    readOnly: false
  persistentVolumeReclaimPolicy: Retain

I recommend reading Resizing Persistent Volumes using Kubernetes.

Also you can read these docs Deploying a Kubespray Kubernetes Cluster with GlusterFS.

If you would be interested in using Heketi, please check this guide Increase GlusterFS volume size in Kubernetes.

Crou
  • 10,232
  • 2
  • 26
  • 31
  • There is contrib to deploy glusterFs using Kubespray too: https://github.com/kubernetes-sigs/kubespray/tree/master/contrib/network-storage/glusterfs – Mariyo Feb 14 '20 at 14:02