This document will lead you to containerize MediaWiki with help of Kubernetes and Helm chart.
- AWS
- Kubernetes
- Helm Chart
- Terraform
- Shell
Here, I have used AWS & Terraform to provision 3 node private Kubernetes cluster, Bastion server and few roles to enable access from the cluster.
- we have a server with role attached. the role or keys should have access for EC2 and EKS.
- make sure the role eks-admin should be available with full eks access and a keypair called a101 already should be there or you can name it anything you want. don't forget to change it in variable file.
- make sure Terraform installed on the server, then navigate into terraform_templates path and then execute the terraform init and terraform apply.
- once everything provisioned, goahead and check aws cli, kubectl and helm has been installed. those are configured in the user data.
- then run a command to update k8s cluster config aws eks update-kubeconfig --name
- once updated test the nodes details to verify
- I have used official mediawiki docker image and mysql 5.6 image
- for mediawiki, have created deployment, service, storage class and persistent volume claim.
- for mysql, deployment, servcie and persistent volume claim.
- once you execute the helm install(there are 3 charts here, mysql, storage and wiki), it will create all the above resources and check mediawiki service to get loadbalancer URL.
- once all pods up and running hit the URL and you can see the mediawiki setup page.
- goahead and do all the installation setup. use mysql.mediawiki-ns.svc.cluster.local for DB host and root/password for DB credentials.
- once setup completed, you will get LocalSettings.php. download it and move it to bastion server.
- from bastion server copy it to mediawiki pod by running kubectl cp LocalSettings.php mediawiki-ns/:/var/www/html/
- now we got the mediawiki up and running.
Planned well to make this. due to low time I couldn't acheive all my thoughts. I can explain in discussion if it's possible.
** Thanks for reading! **