KEMBAR78
Containarized Gluster Storage in Kubernetes | PDF
Gluster Storage in Kubernetes
Saravanakumar Arumugam
25 August 2018
Joint meetup by:
Docker and Kubernetes community,
Bangalore
2
Agenda
● GlusterFS Storage
● Kubernetes Storage Concepts
● GlusterFS in Kubernetes
● Demo
● Scale-out distributed storage system.
● Aggregates storage exports over network interconnects to provide
an unified namespace.
● Layered on disk file systems that support extended attributes.
● Provides file, object and block interfaces for data access.
GlusterFS
GlusterFS Demo
5
Openshift (Kubernetes)
OpenShift - Enterprise Kubernetes for Developers
Openshift Container Platform(OCP) is Red Hat’s PaaS offering that offers customers
a full stack platform for creating/maintaining micro-services.
Upstream: https://github.com/openshift/origin
PODPOD
containers are wrapped in pods which are
units of deployment and management
6
CONTAINER CONTAINERCONTAINER
IP: 10.1.0.11 IP: 10.1.0.55
pods configuration is defined
in a deployment
7
image name
replicas
labels
cpu
memory
storage
POD
CONTAINER
POD
CONTAINER
POD
CONTAINER
DEPLOYMENT
POD
services provide internal load-balancing and
service discovery across pods
8
CONTAINER
POD
CONTAINER
POD
CONTAINER
BACKEND SERVICE
POD
CONTAINER
role: backend
role: backendrole: backendrole: backendrole: frontend
POD
apps can talk to each other via services
9
CONTAINER
POD
CONTAINER
POD
CONTAINER
BACKEND SERVICE
POD
CONTAINER
role: backend
role: backendrole: backendrole: backendrole: frontend
Invoke
Backend API
POD
routes add services to the external load-balancer
and provide readable urls for the app
10
CONTAINER
POD
CONTAINER
POD
CONTAINER
BACKEND SERVICE
ROUTE
app-prod.mycompany.com
> curl http://app-prod.mycompany.com
projects isolate apps across environments,
teams, groups and departments
11
POD
C
POD
C
POD
C
PAYMENT DEV
POD
C
POD
C
POD
C
PAYMENT PROD
POD
C
POD
C
POD
C
CATALOG
POD
C
POD
C
POD
C
INVENTORY
❌
❌❌
● What are Containers and images, and how are they different
○ Image = Binary Artifact
○ Container = Running Instantiation of an image
● What are Pods, Services, Route
○ Pods are the baseline unit, used in defining an application or process
○ Services are discovery/routing objects used to interact with pods/containers
○ Routes are for external world to access the pods.
● What is a Project/Namespace
○ A logical grouping / workspace for resources
○ Aso acts as an isolation boundary for networking and permissions
Recap..
Containers are ephemeral by nature, but many applications
require storage that is persistent beyond the life cycles of the
application containers.
Use cases:
● persistent storage for application containers
● Registry
Storage in containers
● StorageClass
● PVC - PersistentVolumeClaim
● PV - PersistentVolume
Some more at background:
● Provisioner
● Mount plugin
Storage concepts in Kubernetes
● created by admin
● describes the storage
● references a (dynamic) provisioner
Example:
https://github.com/gluster/gluster-kubernetes/blob/master/deploy/kube-templates/gluster-s3-s
torageclass.yaml#L2
StorageClass
- created by user
- references Storageclass
- says which provisioner to use ( answer: glusterfs)
Example:
https://github.com/gluster/gluster-kubernetes/blob/423b0c4d50e299e8f
429a5a820ba0389e365d005/deploy/ocp-templates/gluster-s3-pvcs.ya
ml#L5
PersistentVolumeClaim - PVC
ReadWriteOnce RWO
The volume can be mounted as read-write by a single node.
ReadOnlyMany ROX
The volume can be mounted read-only by many nodes.
ReadWriteMany RWX
The volume can be mounted as read-write by many nodes.
Access modes in PVC
● when user creates a PVC(with storageclass referenced) PV is
created.
● PV is the actual volume to be mounted in the application.
● PV is bound to PVC.
❖ Creating PVC automatically creates PV.
❖ The PVC controls the lifecycle of the storage, not the PV.
PersistentVolume - PV
Workflow
PVC
(Size)
PV
User
Admin
StorageClass
The workflow for dynamically provisioning storage is as follows:
1. An administrator sets up some storage, then defines a storage class
(SC) that describes the storage.
2. A user creates a persistent volume claim (PVC) to request some
storage of a given size, access type, and SC
3. A persistent volume (PV) is dynamically created of the requested size
on some storage that matches the SC.
4. The matched PV is then bound to the PVC and can be used by the
user in pods. The data in the PV persists beyond the lifecycle of the pod.
When the PVC is deleted, the PV is released.
Lifecycle of Volume creation
Demo
Gluster-Kubernetes
https://github.com/gluster/gluster-kubernetes
Gluster containers
https://github.com/gluster/gluster-containers
GlusterFS
https://github.com/gluster/glusterfs
Credits to : GlusterFS and OpenShift Community
References:
Thank you!
https://github.com/SaravanaStorageNetwork

Containarized Gluster Storage in Kubernetes

  • 1.
    Gluster Storage inKubernetes Saravanakumar Arumugam 25 August 2018 Joint meetup by: Docker and Kubernetes community, Bangalore
  • 2.
    2 Agenda ● GlusterFS Storage ●Kubernetes Storage Concepts ● GlusterFS in Kubernetes ● Demo
  • 3.
    ● Scale-out distributedstorage system. ● Aggregates storage exports over network interconnects to provide an unified namespace. ● Layered on disk file systems that support extended attributes. ● Provides file, object and block interfaces for data access. GlusterFS
  • 4.
  • 5.
    5 Openshift (Kubernetes) OpenShift -Enterprise Kubernetes for Developers Openshift Container Platform(OCP) is Red Hat’s PaaS offering that offers customers a full stack platform for creating/maintaining micro-services. Upstream: https://github.com/openshift/origin
  • 6.
    PODPOD containers are wrappedin pods which are units of deployment and management 6 CONTAINER CONTAINERCONTAINER IP: 10.1.0.11 IP: 10.1.0.55
  • 7.
    pods configuration isdefined in a deployment 7 image name replicas labels cpu memory storage POD CONTAINER POD CONTAINER POD CONTAINER DEPLOYMENT
  • 8.
    POD services provide internalload-balancing and service discovery across pods 8 CONTAINER POD CONTAINER POD CONTAINER BACKEND SERVICE POD CONTAINER role: backend role: backendrole: backendrole: backendrole: frontend
  • 9.
    POD apps can talkto each other via services 9 CONTAINER POD CONTAINER POD CONTAINER BACKEND SERVICE POD CONTAINER role: backend role: backendrole: backendrole: backendrole: frontend Invoke Backend API
  • 10.
    POD routes add servicesto the external load-balancer and provide readable urls for the app 10 CONTAINER POD CONTAINER POD CONTAINER BACKEND SERVICE ROUTE app-prod.mycompany.com > curl http://app-prod.mycompany.com
  • 11.
    projects isolate appsacross environments, teams, groups and departments 11 POD C POD C POD C PAYMENT DEV POD C POD C POD C PAYMENT PROD POD C POD C POD C CATALOG POD C POD C POD C INVENTORY ❌ ❌❌
  • 12.
    ● What areContainers and images, and how are they different ○ Image = Binary Artifact ○ Container = Running Instantiation of an image ● What are Pods, Services, Route ○ Pods are the baseline unit, used in defining an application or process ○ Services are discovery/routing objects used to interact with pods/containers ○ Routes are for external world to access the pods. ● What is a Project/Namespace ○ A logical grouping / workspace for resources ○ Aso acts as an isolation boundary for networking and permissions Recap..
  • 13.
    Containers are ephemeralby nature, but many applications require storage that is persistent beyond the life cycles of the application containers. Use cases: ● persistent storage for application containers ● Registry Storage in containers
  • 14.
    ● StorageClass ● PVC- PersistentVolumeClaim ● PV - PersistentVolume Some more at background: ● Provisioner ● Mount plugin Storage concepts in Kubernetes
  • 15.
    ● created byadmin ● describes the storage ● references a (dynamic) provisioner Example: https://github.com/gluster/gluster-kubernetes/blob/master/deploy/kube-templates/gluster-s3-s torageclass.yaml#L2 StorageClass
  • 16.
    - created byuser - references Storageclass - says which provisioner to use ( answer: glusterfs) Example: https://github.com/gluster/gluster-kubernetes/blob/423b0c4d50e299e8f 429a5a820ba0389e365d005/deploy/ocp-templates/gluster-s3-pvcs.ya ml#L5 PersistentVolumeClaim - PVC
  • 17.
    ReadWriteOnce RWO The volumecan be mounted as read-write by a single node. ReadOnlyMany ROX The volume can be mounted read-only by many nodes. ReadWriteMany RWX The volume can be mounted as read-write by many nodes. Access modes in PVC
  • 18.
    ● when usercreates a PVC(with storageclass referenced) PV is created. ● PV is the actual volume to be mounted in the application. ● PV is bound to PVC. ❖ Creating PVC automatically creates PV. ❖ The PVC controls the lifecycle of the storage, not the PV. PersistentVolume - PV
  • 19.
  • 20.
    The workflow fordynamically provisioning storage is as follows: 1. An administrator sets up some storage, then defines a storage class (SC) that describes the storage. 2. A user creates a persistent volume claim (PVC) to request some storage of a given size, access type, and SC 3. A persistent volume (PV) is dynamically created of the requested size on some storage that matches the SC. 4. The matched PV is then bound to the PVC and can be used by the user in pods. The data in the PV persists beyond the lifecycle of the pod. When the PVC is deleted, the PV is released. Lifecycle of Volume creation
  • 21.
  • 22.
  • 23.