Difference between revisions of "MediaWiki on Kubernetes"

From Freephile Wiki
Jump to navigation Jump to search
(add 12-factor info)
(Add section titles)
 
Line 8: Line 8:
 
To do so, we'll need to implement [[Kubernetes]].
 
To do so, we'll need to implement [[Kubernetes]].
  
 +
== Ansible with Kubernetes ==
 
We will almost certainly leverage [[Ansible]] as an orchestration tool. In a recent blog post on ansible.com, Jeff Geerling (@geerlingguy) answers the question: "[https://www.ansible.com/blog/how-useful-is-ansible-in-a-cloud-native-kubernetes-environment How Useful is Ansible in a Cloud-native Kubernetes Environment?] The short answer is that Ansible can be used for:
 
We will almost certainly leverage [[Ansible]] as an orchestration tool. In a recent blog post on ansible.com, Jeff Geerling (@geerlingguy) answers the question: "[https://www.ansible.com/blog/how-useful-is-ansible-in-a-cloud-native-kubernetes-environment How Useful is Ansible in a Cloud-native Kubernetes Environment?] The short answer is that Ansible can be used for:
 
# Container Build ([[Ansible-bender]])
 
# Container Build ([[Ansible-bender]])
Line 15: Line 16:
 
Here's more information about [[Ansible with Kubernetes]]
 
Here's more information about [[Ansible with Kubernetes]]
  
 +
== At WikiMedia Foundation ==
 
We also want to leverage the work being done at WMF. See [[Automated deployment of MediaWiki]]
 
We also want to leverage the work being done at WMF. See [[Automated deployment of MediaWiki]]
  
 +
== Twelve-Factor App ==
 
One of the challenges, especially since it involves potential changes to MediaWiki itself, is the notion of "[https://12factor.net/ The Twelve-Factor App]" and how MediaWiki currently does not meet the criteria in one way or another.  There's an open issue: [https://phabricator.wikimedia.org/T173955 Allow DefaultSettings.php be overridden by environment variables] that would help with the config aspect of things.  The guys at Roots.io created an alternate WordPress system starting back in 2013 "[https://roots.io/twelve-factor-wordpress/ Twelve-Factor WordPress App]", inspired by an even older post [http://www.darrenmothersele.com/blog/2013/05/29/twelve-factor-drupal/ The Twelve-Factor Drupal Web App]. A more recent presentation on [https://docs.google.com/presentation/d/1AZIq628GEquvljmjSDAqvP0KkgkBWATWHWM39rat66c/edit#slide=id.p Twelve-Factor Drupal] was made at Drupal Camp Colorado in 2019.
 
One of the challenges, especially since it involves potential changes to MediaWiki itself, is the notion of "[https://12factor.net/ The Twelve-Factor App]" and how MediaWiki currently does not meet the criteria in one way or another.  There's an open issue: [https://phabricator.wikimedia.org/T173955 Allow DefaultSettings.php be overridden by environment variables] that would help with the config aspect of things.  The guys at Roots.io created an alternate WordPress system starting back in 2013 "[https://roots.io/twelve-factor-wordpress/ Twelve-Factor WordPress App]", inspired by an even older post [http://www.darrenmothersele.com/blog/2013/05/29/twelve-factor-drupal/ The Twelve-Factor Drupal Web App]. A more recent presentation on [https://docs.google.com/presentation/d/1AZIq628GEquvljmjSDAqvP0KkgkBWATWHWM39rat66c/edit#slide=id.p Twelve-Factor Drupal] was made at Drupal Camp Colorado in 2019.
  
Line 29: Line 32:
 
# Add metrics with the [https://github.com/helm/charts/tree/master/stable/prometheus-operator helm chart prometheus-operator]
 
# Add metrics with the [https://github.com/helm/charts/tree/master/stable/prometheus-operator helm chart prometheus-operator]
  
 
+
== Container Runtime ==
Docker (default in kublet <ref>https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/container-runtime-interface.md</ref>) is one of the container runtimes that can be used with Kubernetes. The others include containerd and CRI-O.
+
[[Docker]] (default in kublet <ref>https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/container-runtime-interface.md</ref>) is one of the container runtimes that can be used with Kubernetes. The others include containerd and CRI-O.
  
 
[[Category:Virtualization]]
 
[[Category:Virtualization]]

Latest revision as of 08:47, 6 August 2020

We will provide a MediaWiki platform with the following characteristics:

  • self-healing infrastructure
  • auto-scaling
  • high-availability with multi-server failover
  • flexible storage backends
  • multi-cloud compatibility

To do so, we'll need to implement Kubernetes.

Ansible with Kubernetes[edit | edit source]

We will almost certainly leverage Ansible as an orchestration tool. In a recent blog post on ansible.com, Jeff Geerling (@geerlingguy) answers the question: "How Useful is Ansible in a Cloud-native Kubernetes Environment? The short answer is that Ansible can be used for:

  1. Container Build (Ansible-bender)
  2. Cluster Management (Kubespray)
  3. Application Lifecycle (Use Ansible to build Operators with the Operator SDK to handle deployment, upgrades, backups, etc.)

Here's more information about Ansible with Kubernetes

At WikiMedia Foundation[edit | edit source]

We also want to leverage the work being done at WMF. See Automated deployment of MediaWiki

Twelve-Factor App[edit | edit source]

One of the challenges, especially since it involves potential changes to MediaWiki itself, is the notion of "The Twelve-Factor App" and how MediaWiki currently does not meet the criteria in one way or another. There's an open issue: Allow DefaultSettings.php be overridden by environment variables that would help with the config aspect of things. The guys at Roots.io created an alternate WordPress system starting back in 2013 "Twelve-Factor WordPress App", inspired by an even older post The Twelve-Factor Drupal Web App. A more recent presentation on Twelve-Factor Drupal was made at Drupal Camp Colorado in 2019.

High-level outline[edit | edit source]

  1. Build image. The WMF official images at Docker Hub do not even include a true database; never mind the extensions we need.
    1. With ansible-bender we can use ansible-playbook + buildah to create our image.
  2. Publish images to Docker Hub
    1. Create organization account at Docker Hub; add freephile
    2. Create service account at GitHub - to prevent access to private repos through Docker Hub
    3. Add automated builds and automated testing
  3. Create a Kubernetes Operator for MediaWiki.
  4. Add metrics with the helm chart prometheus-operator

Container Runtime[edit | edit source]

Docker (default in kublet [1]) is one of the container runtimes that can be used with Kubernetes. The others include containerd and CRI-O.