Wordpress operator for Kubernetes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Vladimir Smagin 06e9370411 helm пре 1 месец
build bootstrap пре 10 месеци
cmd/manager bootstrap пре 10 месеци
deploy helm пре 1 месец
pkg strategy can be changed now, default recreate пре 1 месец
vendor use vendoring, add jenkins pipeline пре 6 месеци
version add pvc access mode пре 1 месец
.gitignore bootstrap пре 10 месеци
Dockerfile add helm chart пре 1 месец
Jenkinsfile Изменить 'Jenkinsfile' пре 1 месец
README.md Изменить 'README.md' пре 1 месец
VERSION add pvc access mode пре 1 месец
go.mod add helm chart пре 1 месец
go.sum add helm chart пре 1 месец
logo.png add logo пре 10 месеци
tools.go bootstrap пре 10 месеци

README.md

Wordpress operator for Kubernetes

Run multiple Wordpress instances in your Kubernetes cluster.

Build sources

Prebuilt images

You can find images here https://hub.docker.com/r/iam21h/wordpress-operator

Deploy operator

Edit files and run:

kubectl -f deploy/raw_resources/clusterrole.yaml
kubectl -f deploy/raw_resources/clusterrole_binding.yaml
kubectl -n operators -f deploy/raw_resources/service_account.yaml
kubectl -n operators -f deploy/raw_resources/operator.yaml

or use Helm:

helm repo add 21h https://charts.blindage.org
helm repo update
helm install wordpress-operator 21h/wordpress-operator -n operators

Your first Wordpress deployment

Use internal or external database. Internal database means a single pod with MariaDB without any replication or clusterization, my Wordpress operator is NOT MySQL operator. If you need database high availability use specific MySQL operator to create cluster.

Think scalability before first start, because you can’t mount ReadWriteOnce persistent volume to multiple pods (replicas > 1), so you need storage class with ReadWriteMany feature.

Changed: now PVCs not purging after custom resource deletion. To delete PVCs use special flags.

This sample resource can help you run your first instance with many pods:

apiVersion: blindage.org/v1alpha1
kind: Wordpress
metadata:
  name: my-test-wordpress
spec:
  replicas: 3
  databaseVolumeSize: 1Gi
  wordpressVolumeSize: 2Gi
  # set storage class with ReadWriteMany feature
  wordpressStorageClass: nfs
  # purge PVCs after use
  databaseVolumeCleanup: true
  wordpressVolumeCleanup: true
  podDisruptionBudget:
    maxUnavailable: 1

podDisruptionBudget supports maxUnavailable and minAvailable, rules only Wordpress pods.

Or if you want to use external database. For example, TiDB as database used:

apiVersion: blindage.org/v1alpha1
kind: Wordpress
metadata:
  name: another
spec:
  database:
    database: wordpress
    hostname: tidb-wordpress-database:4000
    password: wordpress
    username: wordpress
  replicas: 1
  wordpressVolumeSize: 1Gi

Look to pkg/apis/blindage/v1alpha1/wordpress_types.go to find more parameters like affinity or annotations.


Copyright by Vladimir Smagin (21h) 2019
http://blindage.org email: 21h@blindage.org
Project page: https://git.blindage.org/21h/wordpress-operator