Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes Storage on bare-metal/private cloud

I'm just starting with Kubernetes on 2 node (master-minion) setup on 2 private cloud servers. I've installed it, did basic config and got it running some simple pods/services from the master to the minion.

My question is:

How can I use persistent storage with the pods when not using Google Cloud?

For my first tests I got a Ghost Blog pod running, but if i tear the pod the changes are lost. Tried adding volume to the pod, but can't actually find any documentation about how it is done when not on GC.

My try:

apiVersion: v1beta1
id: ghost
kind: Pod
desiredState:
  manifest:
    version: v1beta1
    id: ghost
    containers:
      - name: ghost
        image: ghost
        volumeMounts:
          - name: ghost-persistent-storage
            mountPath: /var/lib/ghost
        ports:
          - hostPort: 8080
            containerPort: 2368
    volumes:
      - name: ghost-persistent-storage
        source:
          emptyDir: {}

Found this: Persistent Installation of MySQL and WordPress on Kubernetes

Can't figure it out how to add storage (NFS?) to my testing install.

like image 214
plamer Avatar asked Apr 25 '15 11:04

plamer


2 Answers

In the new API (v1beta3), we've added many more volume types, including NFS volumes. The NFS volume type assumes you already have an NFS server running somewhere to point the pod at. Give it a shot and let us know if you have any problems!

like image 86
Alex Robinson Avatar answered Nov 15 '22 10:11

Alex Robinson


NFS Example: https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/nfs

GlusterFS Example: https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/glusterfs

Hope that helps!

like image 41
Brendan Burns Avatar answered Nov 15 '22 11:11

Brendan Burns