Seminar Research — Creating Cluster Environment
Amazon Elastic Kubernetes + Kubectl
Task
- Launch a Kubernetes cluster.
2. Then Create pods within cluster.
3. And Then host NEXTCLOUD on it.
All using CLI.
Pre-requisites
- AWS CLI
- EKSCTL
- KUBECTL
Also set their individual paths in environment variables.
Steps:
- Create your IAM User with appropriate permissions and download the credential file. Login using the command aws configure and then enter appropriate details.
- Creating a Kubernetes cluster. Save the file in same working directory of cmd as cluster.yml.
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
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
5. Now we Deploy NextCLoud.
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.
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 -