Seminar Research — Creating Cluster Environment

Mohit Verma
3 min readJan 6, 2021

Amazon Elastic Kubernetes + Kubectl

Task

  1. Launch a Kubernetes cluster.

2. Then Create pods within cluster.

3. And Then host NEXTCLOUD on it.

All using CLI.

Pre-requisites

  1. AWS CLI
  2. EKSCTL
  3. KUBECTL

Also set their individual paths in environment variables.

Steps:

  1. Create your IAM User with appropriate permissions and download the credential file. Login using the command aws configure and then enter appropriate details.
  2. Creating a Kubernetes cluster. Save the file in same working directory of cmd as cluster.yml.
cluster.yaml

Then to create cluster cluster use command

eksctl create cluster -f cluster.yml

It will take around 10 minutes to create the cluster. You can verify output by using command

eksctl get cluster

verify
Verify

3. Configuring Kubectl

Inorder to use Kubectl on AWS we need to configure the config file of Kubectl.

aws eks update-kubeconfig — name myclusters

We can confirm the updated configuration by using command

kubectl config view

4. Now we, deploy MariaDB

mariadb_deploy.yml

5. Now we Deploy NextCLoud.

nextcloud_deploy.yml

6. Now both the mariadb_deploy.yml and nextcloud_deploy.yml has been created. We will now create the kustomization.yml file to deploy the whole setup with just one command.

Kustomization.yml

7. Deploy the whole setup using command.

kubectl create -k .

And Done..

Now you are all done here…

To check the outputuse the command.

kubectl get all

You can open the deployment by public ip stated using above command.

8. To Destroy the whole command use the commands.

kubectl delete nextcloud

kubectl delete nextcloud-mariadb

eksctl delete cluster — name myclusters

Thanks!!

All suggestions are welcome to make the article and code better. You can get detailed picturized steps on my GITHUB Repo.

GITHUB REPO :

Below you can find the complete code -

Connect with me on LinkedIn -

--

--

Mohit Verma
0 Followers

Hybrid Multi CLoud | Amazon EKS | Flutter