kubernetes: using Petset in bare metal environment

8/11/2016

I was trying to setup Cassandra cluster by kubernetes 1.3.4 new alpha feature - Petset. Following the yaml file posted here: http://blog.kubernetes.io/2016/07/thousand-instances-of-cassandra-using-kubernetes-pet-set.html

My kubernetes cluster is based on 1.3.4 on bare metal environment with 10 powerful physical machines. However, after I created the Petset, I can get nothing from kubectl get pv.

run kubectl get pvc, i get following:

NAME STATUS VOLUME CAPACITY ACCESSMODES AGE cass-volume-cassandra-0 Pending 4h cass-volume-cassandra-1 Pending 4h cass-volume-cassandra-2 Pending 4h

Reading the README here: https://github.com/kubernetes/kubernetes/blob/b829d4d4ef68e64b9b7ae42b46877ee75bb2bfd9/examples/experimental/persistent-volume-provisioning/README.md

saying the persistent volume will be automatically created if the kubenetes is running on asw, gce or Cinder. Wondering any way I can create such persistent volume and pvc on bare metal environment?

Another question: as long as I run kubernetes cluster on a few EC2 machines in aws, above persistent volume from aws EBS will be automatically created with these clauses in yaml file? or I have to allocate EBS first?

  volumeClaimTemplates:
  - metadata:
      name: cassandra-data
      annotations:
        volume.alpha.kubernetes.io/storage-class: anything
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 380Gi
-- Gordon Jiang
amazon-web-services
cassandra
kubernetes

2 Answers

8/13/2016

petset using Dynamic volume provisioning, this means volumeClaimTemplates in the petset definition request for storage from kubernetes, if storage available pvc bound and pod(petset) is running! but for now kubernetes only support "Dynamic volume provisioning" in cloud provider like gce or aws.

if you use kubernetes in bare metal cluster, other way is using network storage like ceph or gluster that need setup network storage in your cluster.

if you want using bare metal hard disk, existen solution is using hostPath type of persistent volume.

-- arastu
Source: StackOverflow

8/11/2016

By default, the host path provisioner is set to false in the cluster/local-up-cluster.sh. You can enable it by running ENABLE_HOSTPATH_PROVISIONER=true cluster/local-up-cluster.sh. This enables the provisioner and the PV gets created.

-- Venkat
Source: StackOverflow