Setting up OwnCloud on top ofAWS using EKS

Amazon Web Services or aws

AWS is a subsidiary of amazon that provides cloud computing as services, or in other words Infrastructure as a Service (also called IAAS). AWS provides all the computing power(including cpu, ram, gpu) , storage solutions(like ssd), and networking (includes routers, switches, firewall etc) as a services. It is one of the top cloud infrastructure.

Kubernetes

Kubernetes is a open-source platform for container-orchestration system that is used for automating the process of deploying, scaling, and managing computer applications.

EKS or Elastic Kubernetes Service

In layman terms we can say that eks is the combination of aws and kubernetes. launching kubernetes on top of aws makes it a powerful tool for automation. EKS is a fully managed service provided by aws for container -orchesration. It uses the computing power of aws to launch computer applications. Many top companies like Intel, HSBC, Snap, GoDaddy and AutoDesk relies on eks to launch their sensitive and critical applications because of its reliability, security, and scalability.

OwnCloud

OwnCloud is a free and open-source file hosting software for storing, accessing and sharing files, calendars, contacts and emails on the cloud. Since its development in 2010, ownCloud allows creation of private on-demand cloud that offers similar functionalities like those of Dropbox.

Since, you have understood what is aws, eks and owncloud the without further delay let’s start our deployment.

But before we start, there are some pre-requisites.

Pre-Requisites:

  1. You must have an aws account and an iam user created with AdministratorAccess power.
  2. Installed aws cli and configured the profile
  3. Installed kubectl and eksctl programs.

These are required for creating ownCloud on top of eks.

Steps for creating Cluster

  1. Before we do anything, we have to create our cluster on top of eks. To do this we have to create our own cluster.yml file, that would automatically launch the kubernetes cluster on top of eks.

I have named the file as k8scluster.yml, you can name anything.

2. After creating this yaml file we have to launch our cluster using eksctl. This will create three nodes as the worker nodes. More will be launched if more traffic is inbound.

eksctl command

3. After creating cluster your screen should look like this:

This will take sometime, approximately 10 to 20 mins to create the cluster. After creating cluster it should say

EKS cluster cloudcluster in ap-south-1 region is ready”

4. After creating cluster, we have to setup a database to store our data. Here I am using mariadb. To create database, we have to create a file database.yml which will deploy the database on eks cluster. The file consists of three sections — Service, PVC and Deployment. The first part will create a service with cluster IP for connecting to the database. The second part will create a pvc or persistentVolumeClaim of 1Gib in size(using ebs service in aws )to make our data permanent in case of pod failure. The third part will create a Deployment which will monitor the database pod and launch in case it is terminated. The pvc what we have created will be mounted to the ‘/var/lib/mysql’ directory since it stores all the data.

Here is the database.yml file.

5. After creating the database file, we will now create the file which will launch owncloud as frontend. The file name is owncloud.yml. This file also has 3 parts — Service, PVC and Deployment. The first part or the service part will create a LoadBalancer to control the traffic between the three nodes. The second part will create a PVC of 1 Gib and mount to the folder ‘/var/www/html’ directory to make our data permanent in case of pod failure. The third part will create a Deployment that monitors the pods and a launch in case a pod get terminated. It will also autoscale and create more if traffic increases.

6. After creating the files we have to create a kustomization.yml file to automatically create the deployments, PCV and services. It would also contain the password for mysql database and automatically connects to the database

Here is the file.

7. Now it’s time to finally launch owncloud using kubectl. But before this we have to configure kubectl using this command.

This will update kubectl so that it connects to the eks cluster which can be viewed by using

Now it’s time to launch our ownCloud. It can be run using the command

Also make sure that you are in the same directory that contains all the files.

Voila!! You have successfully created your ownCloud on top of eks. Now use

To get the url of your owncloud.

URL for ownCloud
ownCloud mainpage
Inside ownCLoud

I have done this activity under the mentorship of Mr. Vimal Daga who taught me this in two days in his training on ‘Amazon EKS services’. I would also like to thanks LinuxWorld and Sir for the constant support and the giving us this wonderful opportunity.