Ravi Reddy
Ravi Reddy

Reputation: 186

Kubernetes cluster - use of EC2 instance storage for pods

  1. I am starting an EC2 test cluster of 3-minions of type 'm3.large'
  2. want to use 32G SSD storage available on these machine for a pod running on it
  3. want to use using 'hostPath' to mount some portion of this storage to pod so that it is available for the life of minions

However the issue is majority of this storage is allocated for "/mnt/ephemeral/docker" not available on host for 'hostPath' use. On minion it looks like

          $ df -h
          Filesystem                            Size  Used Avail Use% Mounted on
          udev                                  3.7G     0  3.7G   0% /dev
          tmpfs                                 748M   75M  674M  10% /run
          /dev/xvda1                            7.8G  2.0G  5.5G  27% /
          tmpfs                                 3.7G  828K  3.7G   1% /dev/shm
          tmpfs                                 5.0M     0  5.0M   0% /run/lock
          tmpfs                                 3.7G     0  3.7G   0% /sys/fs/cgroup
          /dev/mapper/vg--ephemeral-docker       30G  5.0G   23G  18% /mnt/ephemeral/docker
          /dev/mapper/vg--ephemeral-kubernetes  1.4G  1.4G     0 100% /mnt/ephemeral/kubernetes
          tmpfs                                 748M     0  748M   0% /run/user/1000

Here 30G is allocated to "/mnt/ephemeral/docker" and is only available in docker container as a transient storage. I understand the EBS volumes for persistent store, however the SSD/ephemeral storage is persistent for the life of the EC2 instance and can be used for needs like data store for a Cassandra pod running in Kubernetes

The main issue is not being able to use the instance storage from within pods as instance persistence storage.

  1. Configuring 'emptyDir' in pod uses 1.4G from '/mnt/ephemeral/kubernetes' and fills quickly

        volumes:
             - name: data
             -  emptyDir: {}
    
  2. Configuring 'hostPath' in pod uses 7.8G from '/' and fills quickly

        volumes:
             - name: data
             -  hostPath: 
                path: /cassandra_data
    

Major chunk of instance storage 30G is allocated to '/mnt/ephemeral/docker' and is not avilable for Kubernates pods as instance persistent storage. What is the best way to use (Kubernetes volumes) the SSD storage that comes built-in with the EC2 instances.

Upvotes: 0

Views: 1759

Answers (1)

DavidO
DavidO

Reputation: 1763

There's discussion on https://github.com/kubernetes/kubernetes/issues/15055 so I'm going to mark this answered.

Upvotes: 1

Related Questions