Deploying OWNCLOUD Workload on Amazon EKS

Deploying OWNCLOUD Workload on Amazon EKS

Amazon EKS?

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes it easy for you to run Kubernetes on AWS without needing to stand up or maintain your own Kubernetes control plane.

Benefits:

High Availability

EKS runs the Kubernetes management infrastructure across multiple AWS Availability Zones, automatically detects and replaces unhealthy control plane nodes, and provides on-demand, zero downtime upgrades and patching.

Serverless option

EKS supports AWS Fargate to provide serverless compute for containers. Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.

Secure

EKS automatically applies the latest security patches to your cluster control plane. AWS also works closely with the community to ensure critical security issues are addressed before new releases and patches are deployed to existing clusters.

No alt text provided for this image

Now here I'm launching owncloud on amazon eks .

Befor the launching to make sure that we have the following components installed and set path of them .

 ? Pre-Process:

1.AWS CLI : AWS cli is easier to create a cluster in EKS. You need preferable aws cli version for it ,after thet set up your path to perform the rest actions.

2.Kubectl: Used for a communication with the cluster API server.

3. eksctl: A simple command line utility for creating and managing Kubernetes clusters on Amazon EKS.eksctl automatically creates several AWS resources for you. Creating the basic cluster in a minutes with one command.

4. AWS Configuration:

AWS Config is a service that enables you to assess, audit, and evaluate the configurations of your AWS resources. Config continuously monitors and records your AWS resource configurations and allows you to automate the evaluation of recorded configurations against desired configurations.

No alt text provided for this image

Project

1.Launching EKS Cluster and IAM role policy attachment:

? Here I'm create a terraform file for creating EKS cluster , you can create yml file aslo.

eksctl has support for spot instances through the MixedInstancesPolicy for Auto Scaling Groups.Spot instances usually cost around 30-70% less than an on-demand instance. So using them for your EKS workloads can save a lot of money but requires some special considerations as they could be terminated with only 2 minutes warning.

No alt text provided for this image


No alt text provided for this image

 ? But before going to create this file check in your aws console there is nothing in our concole (cluster ,nodes,load balancers,volumes)

No alt text provided for this image
No alt text provided for this image

 ?Yes there is no pre-cluster in our console ,so now we can go to forward. This is terraform file so we need to plugins for it before the apply .

No alt text provided for this image

 ? Yes there is a successfully initialization of terraform code , now we hit the terraform apply command to create our entire cluster .

No alt text provided for this image

 ? Go to the concole and check whether your cluster create or not.

No alt text provided for this image

 ? Here is successfully cluster created.

? Update your cluster kubeconfig file by using " aws eks update-kubeconfig --name < cluster name>

 ? Eks behind the scene contacts to EC2 instance to launch slave nodes.

 ? When we required multiple nodes to have different configuration and some with same configuration ,then that time we define them our terraform file (yml file) ,this concept known as Node Cluster.

 ? Here we also create node groups using terraform file

No alt text provided for this image
No alt text provided for this image

 ? Pods in a cluster do have network connectivity but nobody from the outside world can connect to it because pods run in it's own private isolated world.Thus, we need a LB service here, that can be either a NodePort or a LoadBalancer.

? Amazon EFS : Amazon EFS provides the scalability, elasticity, availability, and durability to be the file store for enterprise applications and for applications delivered as a service. Its standard file system interface, file system permissions, and directory hierarchy make it easy to migrate enterprise applications from on-premises to the AWS cloud, and to build new ones. Move your business critical, Linux-based applications to managed file systems with Amazon EFS, while lowering your total cost of ownership (TCO).

No alt text provided for this image

? we create this efs file also by using terraform code .In future we need file id for mount our volume of that created efs file.

No alt text provided for this image
No alt text provided for this image

2.Creating efs-provisioner yml file:

No alt text provided for this image

3. Creating rbac yml file for security so that we can get more security and all.

No alt text provided for this image

4.Creating Yml file to launch Owncloud using the MySQL database.

? mysql-deployment.yml file

No alt text provided for this image
No alt text provided for this image

? owncloud-deployment.yml file

No alt text provided for this image
No alt text provided for this image

? The storage of pods is of empheral storage so many modifications is done in pod get undome once pod gets restarted,so to overcome this issue,we attach a persistent volume along with the pod to store changes done in a particular folder by mounting the folder to external storage .

? Use persistent volume claim to create a hard disk to store data permanently.A pod, when needs storage ,ask it from the PVC which gets it from PV.PV in turn brings it from a storage class that has various sources to get the storage from EBS.Thus our data will not lost when if our pods is deleted.

5.kustomization.yml file

No alt text provided for this image

 ? Kustomize is a tool that lets you create an entire Kubernetes application out of individual pieces — without touching the YAML for the individual components. For example, you can combine pieces from different sources, keep your customizations — or kustomizations, as the case may be — in source control, and create overlays for specific situations. 

 ? Kustomize enables you to do that by creating a file that ties everything together, or optionally includes “overrides” for individual parameters.

# kubectl create -k .

This command create the entire setup from creating the replicaset,creating pods, external volume,deployment ,creating load balancer.Both the owncloud and mysql have their own persistent storage.

PVC create the elastic block storage provided by aws.While service use in owncloud provide us external load balancer and in case of mysql we provide cluster IP, so no one can access it.

No alt text provided for this image
No alt text provided for this image

 ? Load Balancer has been created

A load balancer distributes workloads across multiple compute resources, such as virtual servers. Using a load balancer increases the availability and fault tolerance of your applications.

You can add and remove compute resources from your load balancer as your needs change, without disrupting the overall flow of requests to your applications.

No alt text provided for this image
No alt text provided for this image


No alt text provided for this image

  ? Volume created:

No alt text provided for this image

 ? Mounted volume

No alt text provided for this image

 ? Login to Owncloud.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

You can do any thing over here i.e. you can store your credentials data , some of your local data whatever you want .

6.After doing all things deleting cluster by using terraform destroy command

No alt text provided for this image

Thank you for giving your valuable time to read my article.And please suggest me if there is any improvement .

 I hope the above article will help to all readers.

GitHub:https://github.com/Nilesh1206/EKS-Task









Yash Walke

SDE-II at HashedIn (Deloitte-USI) | JAVA | Cloud ?? | DevOps | BITS Pilani '25

4 年

Great ??

Ninad Deogaonkar

SDE-I at Hewlett Packard Enterprise

4 年

Great

Sanket Bendale

Associate Consultant at Capgemini

4 年

Great work ?

要查看或添加评论,请登录

社区洞察

其他会员也浏览了