Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 19, 2021 01:43 pm GMT

DEPLOYING A WORDPRESS APPLICATION WITH MYSQL DATABASE IN K8S Cluster USING HELM ON AWS

Welcome to back in my another article. You will see all about the integration of WordPress, MySQL, Helm etc, in this article. So let's get started without delay.

Pre-requisite

To perform this scenario you will need mentioned tools and platform.

Kubernetes Setup

To demonstrate this scenario, first of all we have to install the Kubernetes setup then we can move ahead for farther part. I am installing the Kubernetes Kubernetes cluster on the top of AWS. So launch the instance with mentioned configuration.

  • Ubuntu Server 18.04 LTS (HVM), SSD Volume Type
  • t2.xlarge Instance type
  • Minimum Storage 30 GiB

After launching AWS Instance, connect with it with the help of any remote software eg. putty etc or ssh protocol and then run the following commands.

  • login with root power.
sudo su -
  • Install kubectl.
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectlchmod +x ./kubectlsudo mv ./kubectl /usr/local/bin/kubectl
  • Update the instance and install docker.
sudo apt-get update -ysudo apt-get install docker.io -y
  • Install curl software to install Minikube.
sudo apt-get install curl -y

What's Minikube ?

Minikube is a utility you can use to run Kubernetes (k8s) on your local machine. It creates a single node cluster contained in a virtual machine (VM). This cluster lets you demo Kubernetes operations without requiring the time and resource-consuming installation of full-blown K8s.

  • Install Minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64sudo chmod +x minikubesudo mv minikube /usr/local/bin/sudo apt install conntrack
  • Go into sudo if not gone.
sudo -i
  • Start the Minikube
minikube start --vm-driver=none
  • Now our single node cluster is ready to use and you can use with below command.
minikube status

and you will get output such as;

root@ip-172-31-39-130:~# minikube statusminikubetype: Control Planehost: Runningkubelet: Runningapiserver: Runningkubeconfig: Configured

What's Helm ?

So let's try to understand what helm is?

  • Helm is package manager for Kubernetes
  • Helm packages are called Charts.
  • Helm Charts help define, install and upgrade complex Kubernetes application.
  • Helm Charts can be versioned, shared, and published.
  • Helm Charts can accept input parameter.
    • Kubectl need template engine to do this (Kubernetes, jinja etc)
  • Popular packages already available.

What's Grafana ?

Grafana is a multi-platform open source analytics and interactive visualization web application. It provides charts, graphs, and alerts for the web when connected to supported data sources. A licensed Grafana Enterprise version with additional capabilities is also available as a self-hosted installation or an account on the Grafana Labs cloud service. It is expandable through a plug-in system. End users can create complex monitoring dashboards using interactive query builders. Grafana is divided into a front end and back end, written in TypeScript and Go, respectively.

Dockerfile for grafana


minikube status

clone the repo

git clone https://github.com/hackcoderr/Grafana.git

go inside the Grafana then install

wget https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz

then run

tar -xvzf helm-v3.5.2-linux-amd64.tar.gz

then copy

cp linux-amd64/helm /usr/bin/

then run helm

cd


curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm


root@ip-172-31-47-112:~# helm install grafana Grafana/
NAME: grafana
LAST DEPLOYED: Sun Apr 18 14:25:28 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

``

root@ip-172-31-47-112:~# kubectl get pods
NAME READY STATUS RESTARTS AGE
graf-7f76fcd8b6-fxvwl 1/1 Running 0 71s


root@ip-172-31-47-112:~# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
graf NodePort 10.107.249.248 3000:30683/TCP 2m17s
kubernetes ClusterIP 10.96.0.1 443/TCP 11m
``

root@ip-172-31-47-112:~# kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
graf NodePort 10.107.249.248 3000:30683/TCP 4m1s
kubernetes ClusterIP 10.96.0.1 443/TCP 13m
root@ip-172-31-47-112:~#

``


Original Link: https://dev.to/hackcoderr/deploying-a-wordpress-application-with-mysql-database-in-k8s-cluster-using-helm-on-aws-4lpn

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To