AWS KUBERNETES SERVICE
TASK :
=> We are going to going create a kubernetes cluster using EKS and by using kubernetes we deploy two deployments say, drupal (For CMS site..) and Mysql database(to store ) to store your drupal sites data.
=>Next we integrate our EKS cluster with further aws services such ELB , EFS to make to balance the load and make our Deployment's data persistent.
=>Next we are going to create a serverless architecture provided by EKS with kubernetes.
REQUIREMENT:
=>AWS user account - with Administration access or IAM user with administrative service.
=>Kubernetes environment
=>AWS cli
Some basic terms :
What is KUBERNETES?
Kubernetes (commonly stylized as k8s) is an open-source container - orchestration system for automating application deployment, scaling, and management. It was originally designed by Google and is now maintained by the Cloud Native Computing Foundation.
What is AWS kubernetes?
Kubernetes on AWS Open source container management and orchestration Kubernetes is open source software that allows you to deploy and manage containerized applications at scale. Kubernetes manages clusters of Amazon EC2 compute instances and runs containers on those instances with processes for deployment, maintenance, and scaling.
Solution:
1.go to browser and search minikube and install it.
2.than set the path and configure kubernetes kubectl command
3.than login to AWS account and create a user who have administrative services(bad practice because of security reason)
4.than go CLI and type "aws configure" write the access and secret key .
5.you can create cluster using CLI or GUI ,eksctl command ~GUI=EKS ->give cluster name ->create cluster ->configure cluster ->create role or select role->next and review, your cluster is created using gui. ~CLI=write the command "aws eks create-cluster" and configure it. ~As for fully automation eksctl command is very effective from view community. And for creating cluster using eksctl command we have to write the code .yml file.
i)download eksctl command and set the path.
ii)write the code in cluster.yml file and run it "eksctl create cluster -f cluster.yml.
iii)check our cluster
6After cluster is created we willl update kubeconfig file so that we can access cluster from our local system using kubectl command .
7.now creating a namespace where we will launch wordpress and mysql pods and integrate them, also it’s good practice to separate every work by created there specific namespace.
i)creating an namespace using command "kubectl create ns wp-mysql"
ii)now to config the namespace and in this article i am using default config by using command "kubectl config set-context --current --namespace=wp-mysql"
8.For mounting our storage to nodes in any region we create an EFS storage.
8.creating efs-provisioner following is the YAML code:
9.creating cluster-roll-binding using following YAML code:
9.creting PVC which will be needed for data persistency inside pods we have to create a Storage Class from where EFS will manage providing data to PVC for this run the following YAML code:
10.install the amazon-efs-util in all the running instances
11.now attach the efs to all the instances we will run a Pod using YAML code and configure the Database which will provide service as we run the code. A PVC has been attached to the Deployment Service Provided by the code. The MySQL_Deployment.yml code is follows:
12.After this we will create a wordpress_Deployment which will directly communicate with Client and linked with MySQL pod to store data there.
13.for managing the Model of MySQL and Wordpress in which both are incomplete without each other we have to create a Kustomization code and to run it we will run command : "kubectl apply –k" .
Using ELB DNS name we can login to the WordPress Account and start creating blog.
thanku you
Student at Poornima University
4 年Great work????
DevOps Engineer @ Paytm | RHCA Level 1 Certified | Infrastructure Development, Machine Learning and AI
4 年Amazing...????