Coder Social home page Coder Social logo

efs-eks's Introduction

How to configure EKS Persistent Storage with EFS Amazon service for your Kubernetes cluster to use

What鈥檚 In This Document

Alt Text

Alt Text

Alt Text

Alt Text

Get important elements after creating EFS

  • File System ID: fs-5cc93c7c
  • DNS Name: fs-5cc93c7c.efs.us-east-1.amazonaws.com

Source: https://github.com/vumdao/efs-eks

2.1 Create EFS provisioner

root@ctl:~/efs-eks-demo# kubectl apply -f efs-provisioner-deployment.yaml 
namespace/demo created
serviceaccount/efs-provisioner created
clusterrole.rbac.authorization.k8s.io/efs-provisioner created
clusterrolebinding.rbac.authorization.k8s.io/efs-provisioner created
role.rbac.authorization.k8s.io/leader-locking-efs-provisioner created
rolebinding.rbac.authorization.k8s.io/leader-locking-efs-provisioner created
deployment.apps/efs-provisioner created
configmap/efs-provisioner-config created

root@ctl:~/efs-eks-demo# kubectl get pod -n demo
NAME                               READY   STATUS    RESTARTS   AGE
efs-provisioner-84bbf9b5fc-zx5hs   1/1     Running   0          30s

root@ctl:~/efs-eks-demo# kubectl get configmap -n demo
NAME                     DATA   AGE
efs-provisioner-config   4      62s

2.2 Create PVC

root@ctl:~/efs-eks-demo# kubectl apply -f efs-pvc.yaml 
storageclass.storage.k8s.io/efs-sc created
persistentvolumeclaim/efs-demo-claim created

root@ctl:~/efs-eks-demo# kubectl get pvc -n demo
NAME             STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
efs-demo-claim   Bound    pvc-e00f83c9-4168-41ba-ae8b-08bc57f466e4   100Mi      RWX            aws-efs        10s

root@ctl:~/efs-eks-demo# kubectl get storageclass
NAME            PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
efs-sc          aws-efs                 Delete          Immediate           false                  27s

2.3 Deploying the stateful services writer and reader the EFS volume

root@ctl:~/efs-eks-demo# kubectl apply -f efs-writer.yaml 
pod/efs-writer created

root@ctl:~/efs-eks-demo# kubectl apply -f efs-reader.yaml 
pod/efs-reader created

root@ctl:~/efs-eks-demo# kubectl get pod -n demo
NAME                               READY   STATUS    RESTARTS   AGE
efs-provisioner-84bbf9b5fc-zx5hs   1/1     Running   0          3m6s
efs-reader                         1/1     Running   0          7s
efs-writer                         1/1     Running   0          14s

2.4 Verify that the efs-reader pod is able to successfully read the same data from the shared persistent volume

root@ctl:~/efs-eks-demo# kubectl exec -it efs-writer -n demo -- tail /shared/out.txt
efs-writer.demo - Sun Dec 13 16:59:04 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:09 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:14 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:19 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:24 UTC 2020

root@ctl:~/efs-eks-demo# kubectl exec -it efs-reader -n demo -- tail /shared/out.txt
efs-writer.demo - Sun Dec 13 16:59:04 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:09 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:14 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:19 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:24 UTC 2020
efs-writer.demo - Sun Dec 13 16:59:29 UTC 2020

Visit wwww.cloudopz.co to get more

efs-eks's People

Contributors

vumdao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 馃搳馃搱馃帀

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google 鉂わ笍 Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.