Skip to content

Technoob

Migrating Wordpress sites to Kubernetes part 1

March 11, 2020

I have too many old sites that I dumped Wordpress on years ago and forgot about. Eventually PHP ran out of style, or rather php5 which is kind of dead. Wordpress has been asking me to upgrade for awhile which I have casually ignored. “Why fix if not broken”.
Having coded, architect and run 30 million devices and active users for years with 100% uptime as an Engineer for the LAMP stack (ok it was on AWS), I think everything can be as good as we make it to be. If I had any say I would be using Python but I am a team player. My team was PHP and they were bloody good. All I had to do was SRE it.

Current environment

Everything I have is on VPS powered by Linode for over ten years now. Doing sysadmin has always been time spent well for me. I do it to relax or distract myself from a problem I am working on. I try not to undertake big stuff to save on my personal time. Now that I’ve decided to move all my Wordpress/PHP sites to Kubernetes and solve this once and for all, I have to look at how this can be achieved with maximum laziness. Other things like Python apps are already in containers. I am not going to change them for now. I have tried to use LXC in the past and some of the projects are still on LXC. Most of my own code is still PHP5 and wont work on PHP7 anyway so they need to be supported for awhile.
Stuff on my Heroku is going to stay there. Those are Java,Python and Rails apps. There is a lot of MySQL servers that I have mostly consolidated over the years but some may still be lingering.
All my code is on Bitbucket, even if I had a Wordpress I used to push it to a repo. It helped me when my hosting used to get malware attacks. I could simply revert the code and apply the patches.

I use other services like my own SMTP servers, Mailgun, CDN is Cloudflare or Stackpath/MaxCDN plus log management by Scalyr (where I work now)
This is what I got so far in my sketch of what I have setup right now. Its the same stuff 50 times over.

lemp stack 647x1024

Trial setup

  • Docker/minikube/k8s system to test the migration.
  • I would also need a docker repository. Havent decided on that yet.
  • Reliable AWS RDS like service. For trial I might use a container. I do not like to put DB or logs in self managed systems. Both are hard and easy to screw up.
  • CDN. Will stay the same
  • Logs, still Scalyr ;)
  • Email. Existing SMTP servers.

What’s next

Now I have just have to setup a single node k8s cluster to deploy some pods and externalize the filesystems for a start. That’s in part 2


You are welcome to connect with me. Abhishek Dujari
This is my archived blog where you will find content about early days of Cloud Computing, Cybersecurity, Development and Sysadmin.