Sign in

Just a tech enthusiast… Research, implement and share is what I like to do

Abstract:


What we are going to do?

  1. WordPress in Kubernetes Cluster (Local Minikube used here)
  2. Database for WordPress is deployed in AWS Relational Database Service (RDS)
  3. Mentioned things are done using Infrastructure as a Code (Terraform used here)

This task has been done on the following resources:

  1. Windows 10 as WorkStation
  2. AWS Account (Free-tier)
  3. Terraform v0.12.29
  4. Kubectl v1.18.0
  5. Minikube v1.12.3 (in a Virtual Machine)

Let’s fire up the code and deploy it.


Terraform || Helm || Kubernetes || Amazon EKS || Amazon EFS || Prometheus || Grafana

What we will be doing?

  1. Provisioning Elastic Kubernetes Service(EKS) via Terraform
  2. Provisioning Elastic File System(EFS) via Terraform
  3. Provisioning Kube State Metrics on EKS via Manifests
  4. Provisioning Prometheus on EKS via Terraform
  5. Provisioning Grafana on EKS via Helm Charts

What do we aim to reach?

We will require the following things installed in our local system before we start :

  1. AWS Account
  2. Terraform v0.12.26 (https://www.terraform.io/downloads.html)
  3. Kubectl v1.18.0 (https://kubernetes.io/docs/tasks/tools/install-kubectl/)
  4. Helm v2.16.9


WordPress || AWS || MariaDB
  1. AWS-CLI v2 (https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-windows.html)
  2. Terraform v0.12 (https://www.terraform.io/downloads.html)
main.tf


  1. Create a Key Pair and security group which allow the port 80, 22 and ICMP protocol for ingress.
  2. Launch multiple EC2 instances.
  3. In the created EC2 instances, use the key and security group which we have created in step 1.
  4. Launch Elastic File System (EFS) and mount that volume into /var/www/html on all the instances.
  5. The developer has uploaded the code into GitHub repo and other repo with some images. Copy the GitHub repo code into /var/www/html.
  6. Create an S3 bucket, and copy/deploy the images from GitHub repo into the S3 bucket and…


Prometheus + Kubernetes + Grafana


Jenkins + Kubernetes
  1. Seed Job: This job is configured with a webhook. It will download the groovy script pushed by developers and create jobs and views as required by the operations team.
  2. The created jobs in our case have been specified to us and will be explained in the…




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store