NextCloud Deployment on Amazon EKS

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.

No alt text provided for this image

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.

No alt text provided for this image

How EKS works??

No alt text provided for this image

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.

No alt text provided for this image

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

  1. You must have AWS account Aws cli installed.
  2. You must have eksctl installed in your system.
  3. You must have kubectl installed in your system.
No alt text provided for this image

Step 1:- Login to Aws through CLI using “aws configure” command . And launch your EKS cluster using the yaml file.

No alt text provided for this image

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.

No alt text provided for this image

Since your configuration file is ready ….Now launch the cluster using command

“eksctl create cluster -f name.yml”

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

You can check if your cluster is successfully launched using command

“eksctl get cluster”

No alt text provided for this image

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.

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

Step 2:- Configure Kubectl command in local system and update the config file so that kubectl can contact the master node of EKS cluster.

No alt text provided for this image

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.

No alt text provided for this image

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.

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

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”.

No alt text provided for this image

Step 6:- Create the configuration files for MYSQL and Nextcloud website.

  1. 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.
No alt text provided for this image

2. Rbac file will provide extra security for the website.

No alt text provided for this image

3. Storage file will provide PVC storage to Mysql and Nextcloud website

No alt text provided for this image

4. Deployment file for MYSQL and Nextcloud

No alt text provided for this image

Step7:- You need to create all the Yaml files in the next step.

No alt text provided for this image

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.

No alt text provided for this image

FINALLY YOUR WEBSITE IS LAUNCHED !!!!!💥😀

No alt text provided for this image

Last But Not The Least — Dont’t forget to delete your cluster….

No alt text provided for this image

Thank You For Reading This article!!!!!Hope you liked it.😊😊

To view or add a comment, sign in

Others also viewed

Explore content categories