NextCloud Deployment on Amazon EKS
It follows a client-server architecture with a server node (master) composed of etcd cluster, kube-apiserver, kube-controller-manager, cloud-controller-manager, scheduler and Client (worker) nodes are composed of kube-proxy and kubelet components.
Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service. Customers such as Intel, Snap, Intuit, GoDaddy, and Autodesk trust EKS to run their most sensitive and mission critical applications because of its security, reliability, and scalability.
EKS is the best place to run Kubernetes for several reasons. First, you can choose to run your EKS clusters using AWS Fargate , which is 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.
How EKS works??
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.
Kubernetes Architecture
It follows a client-server architecture with a server node (master) composed of etcd cluster, kube-apiserver, kube-controller-manager, cloud-controller-manager, scheduler and Client (worker) nodes are composed of kube-proxy and kubelet components.
Building Web Application on EKS
The aim of the task is to build aws eks cluster and deploy NextCloud and mysql on top of the cluster.
NextCloud
It is a suite of client-server software for creating and using file hosting services. Nextcloud is free and open-source, which means that anyone is allowed to install and operate it on their own private server devices.
MySql
It is an open-source relational database management system.
Prerequisite
- You must have AWS account Aws cli installed.
- You must have eksctl installed in your system.
- You must have kubectl installed in your system.
Step 1:- Login to Aws through CLI using “aws configure” command . And launch your EKS cluster using the yaml file.
The configuration Yaml file for cluster is given below. This Yaml file will launch the Eks cluster which is fully managed by AWS cloud in just one click.!!!!!!😀 In this Yaml file I have launched three node groups and the name of my cluster is ekscluster . This cluster will run in ap-south-1 (Mumbai) region and it has four ec2 instances including one spot instance.
Since your configuration file is ready ….Now launch the cluster using command
“eksctl create cluster -f name.yml”
You can check if your cluster is successfully launched using command
“eksctl get cluster”
As my cluster is launched and its running on AWS I can see in WEBUI that my instance is in running state and several resources formed.
Step 2:- Configure Kubectl command in local system and update the config file so that kubectl can contact the master node of EKS cluster.
Step 3:- Create a separate namespace where you can launch your website in the cluster. I have created mycluster namespace and set that as my default namespace.
Creating Storage For your Website
Amazon EFS — Elastic File Storage is a service of amazon that provides storage for the website and it can be accessed from different datacenter. We have used EFS storage because our nodes are running in 1a ,1b and 1c datacenter of Mumbai region.
Step 4:- Create EFS and make sure you enter the same VPC in which your cluster is running and enter the same security group.
Step 5:- You need to install Software in all the instances to support EFS storage through ssh or directly connecting to web browser . The command is
“sudo yum install amazon-efs-utils -y”.
Step 6:- Create the configuration files for MYSQL and Nextcloud website.
- Efs-Provisioner will provide the provision and the efs storage to launch the website. Here File_System_Id is the id of my EFS created and Server is my DNS server of EFS. Provisioner_Name is mycluster/aws-efs.
2. Rbac file will provide extra security for the website.
3. Storage file will provide PVC storage to Mysql and Nextcloud website
4. Deployment file for MYSQL and Nextcloud
Step7:- You need to create all the Yaml files in the next step.
Step 8:- Run the the command “kubectl get all” . You can see in the below picture Mysql and Nextcloud is running . Use the link to open the Website.
FINALLY YOUR WEBSITE IS LAUNCHED !!!!!💥😀
Last But Not The Least — Dont’t forget to delete your cluster….
Thank You For Reading This article!!!!!Hope you liked it.😊😊