/wordpress-mysql-helm-chart

The simplest example of a helm chart for WordPress and MySQL.

Primary LanguageSmartyMIT LicenseMIT

Kubernetes WordPress + MySQL helm chart

The simplest example of a helm chart for WordPress and MySQL (chart directory).

Also, original manifests provided for using via kubectl (original-manifests directory).

This demo was used with GCP Kubernetes cluster.

Dependencies

Setup cluster

To start using gcloud utility execute next command

gcloud init

Execute the next command to sign in

gcloud auth login

Select your GCP project (if you have one) or create a new one (you can do it via GCP Web Interface)

gcloud projects list
gcloud config set project <YOUR_PROJECT_ID>

Finally, we can setup demo cluster

gcloud container clusters create demo-cluster --zone europe-west4-a

kubectl will be automatically configured to your created cluster

You can check your demo-cluster status with next command

kubectl get nodes

Usage

  1. Clone this git repository
git clone git@github.com:ltblueberry/wordpress-mysql-helm-chart.git
  1. Execute next commands from repository directory

check that all templates are valid

helm template .

install chart

helm install . --generate-name
  1. Check your WordPress service External IP address with next command (may take some time)
kubectl get service -n demo-application

By-default namespace that used in the chart called demo-application. If you changed it, make sure you define the proper namespace in kubectl get command.

Now you can check this IP address with web-browser

Helm Variables

Defined in values.yaml

Name Default Value Difinition
namespace demo-application Kubernetes namespace

wordpress:

Name Default Value Difinition
deployment.image wordpress:4.8-apache Docker image for Wordpress
deployment.replicaCount 1 Number of Pods to run
service.type LoadBalancer Kubernetes Service type
service.port 80 Publishing port

mysql:

Name Default Value Difinition
deployment.image mysql:5.6 Docker image for MySQL
deployment.replicaCount 1 Number of Pods to run
service.type ClusterIP Kubernetes Service type
service.port 3306 Publishing port
pvc.accessMode ReadWriteOnce PVC Access mode
pvc.storage 2Gi PVC Storage size

Uninstall

  1. Execute the next command to get the list of helm releases
helm list
  1. Execute the next command to uninstall helm release by RELEASE_NAME
helm uninstall RELEASE_NAME

License

MIT License

Copyright (c) 2020 ltblueberry