EKSDeploying Wordpress And MySQL on Elastic Kuberneties Service (EKS)

Miteshdhruv
4 min readJul 15, 2020

what is EKS?

Amazon EKS is a managed service that helps make it easier to run Kubernetes on AWS. Through EKS, organizations can run Kubernetes without installing and operating a Kubernetes control plane or worker nodes. Simply put, EKS is a managed containers-as-a-service (CaaS) that drastically simplifies Kubernetes deployment on AWS.

To understand Amazon EKS better, let’s take a step back. Here’s a quick overview of Kubernetes.

What is Kubernetes?

Kubernetes is an open-source system that allows organizations to deploy and manage containerized applications like platforms as a service (PaaS), batch processing workers, and microservices in the cloud at scale. Through an abstraction layer created on top of a group of hosts, development teams can let Kubernetes manage a host of functions — including load balancing, monitoring and controlling resource consumption by team or application, limiting resource consumption and leveraging additional resources from new hosts added to a cluster, and other workflows.

Through Amazon EKS, organizations using AWS can get the full functions of Kubernetes without having to install or manage Kubernetes itself.

Benefits of Amazon EKS: Why use EKS?

Through EKS, normally cumbersome steps are done for you, like creating the Kubernetes master cluster, as well as configuring service discovery, Kubernetes primitives, and networking. Existing tools will more than likely work through EKS with minimal mods, if any.

With Amazon EKS, the Kubernetes control plane — including the backend persistence layer and the API servers — is provisioned and scaled across various AWS availability zones, resulting in high availability and eliminating a single point of failure. Unhealthy control plane nodes are detected and replaced, and patching is provided for the control plane. The result is a resilient AWS-managed Kubernetes cluster that can withstand even the loss of an availability zone.

Organizations can choose to run EKS using AWS Fargate — a serverless compute engine for containers. With Fargate, there’s no longer a need to provision and manage servers; organizations can specify and pay for resources per application. Fargate, through application isolation by design, also improves security.

And of course, as part of the AWS landscape, EKS is integrated with various AWS services, making it easy for organizations to scale and secure applications seamlessly. From AWS Identity Access Management (IAM) for authentication to Elastic Load Balancing for load distribution, the straightforwardness and convenience factor of using EKS can’t be understated.

Let’s get started with our project

first of all we need

  1. eksctl
  2. kubectl
  3. aws cli

We will configure our aws account using our command prompt.

using “aws configure” command

This is the code for creating cluster in eks using YML file

we used “eksctl create -f cluster.yml” to create the cluster using the code we wrote in yml file

After successfully creating a cluster in our aws cloud.

we will go to aws and check if all the intances are launched or not.

Now For connecting to the master, kubectl cmd require config file (.kube) having IP , username and password.

Update config file to allow kubectl to send instructions to master node.

aws eks update-kubeconfig --name ekcluster

Now , we’ll create namespace

using “kubectl create namespace mitesh”

Now, we’ll launch a pod in the namespace we created.

using “kubectl config set-context — current — namespace=mitesh”

Now we’ll write the code for Mysql and wordpress in yml file and attaching PVC in it.

Wordpress code below

Now we will launch all the files using

“kubectl create -k”

Thank you so much for reading.

I am thankful to linuxWorld informatics Pvt. Ltd.

I am grateful to Mr. Vimal Daga sir for such a great opportunities.

--

--