Kubernetes

De Hacklab La Paz - r00thouse

Hello Community! I Deployed a WordPress Application on a Minikube Cluster with Ingress, Cert-Manager, and Helm.

0 pILkx0wdBVj3z8L.webp

Requirements:

- minikube

- helm

Introduction

Deploying a WordPress application with the right tools and approach, it can be accomplished effectively.

Kubernetes cluster using Ingress, Cert-Manager, and Helm.

Setting up a Kubernetes Cluster on Minikube:

minikube start

Install Ingress Nginx

To manage external access to Kubernetes services in a cluster, we need a reverse proxy and load balancer, allowing for the routing of external traffic to the appropriate internal service.

helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace

Install Cert Manager

Cert-manager is an open-source tool for automating the management and issuance of TLS certificates in Kubernetes clusters.

Point 0. of this gist

Configure secrets on Kubernetes using Kustomize

Create a kustomization.yaml file using any text editor you like.

To save the secret values

Point 1. of this gist

Creating the WordPress, and MySQL volumes

What is Persistent Volume?

It's a storage resource in the Kubernetes cluster that can be accessed by multiple pods.

- Piece of network-attached storage that can be mounted to a pod.

- Lifecycle independent of any individual pod.

What is Persistent Volume Claim?

It's a request for a specific amount of storage from a PV.

- PVC looks for an available PV that meets those requirements and binds to it.

- When a pod requests storage, it creates a PVC object that specifies the desired capacity, access mode, and other requirements.

Point 2. of this gist for wordpress and mysql

Services and Deployments

We need to create the Deployment, and Service before the Persistent Volume.

Point 3. MySQL and Point 4. Wordpress of this gist

Create a ClusterIssuer

Point 5. of this  gist

Configure Ingress HTTPS and Deploy WordPress

Let's setting up secure access to a WordPress website.

Point 6. of this gist 

Lastly

kubectl apply -f <folder> 
kubectl apply -k <folder>

Verify

kubectl get secrets
kubectl get pvc
kubectl get pods
kubectl get services wordpress
minikube service wordpress --url

Good ;) We almost made it, but there is a part missing. I will wait to complete. I need to configure my domain provider.

Don't forget

kubectl delete -k ./

Resources that help me.

k8s wordpress mysql

minikube docs