wordpress-operator

module
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2020 License: Apache-2.0

README

wordpress-operator Build Status

WordPress operator enables managing multiple WordPress installments at scale.

Goals and status

The main goals of the operator are:

  1. Easily deploy scalable WordPress sites on top of kubernetes
  2. Allow best practices for en masse upgrades (canary, slow rollout, etc.)
  3. Friendly to devops (monitoring, availability, scalability and backup stories solved)

The project is actively developed and maintained and has reached stable beta state. Check here the project releases.

Components

  1. WordPress operator - this project
  2. WordPress runtime - container image supporting the project goals (https://github.com/presslabs/runtime)

Controller deploy

Install helm. New to helm? Check https://github.com/helm/helm#install

Install kubectl. For more details, see: https://kubernetes.io/docs/tasks/tools/install-kubectl/

To deploy this controller, use the provided helm chart, by running:

helm repo add presslabs https://presslabs.github.io/charts
helm install presslabs/wordpress-operator --name wordpress-operator

Deploying a Wordpress Site

apiVersion: wordpress.presslabs.org/v1alpha1
kind: Wordpress
metadata:
  name: mysite
spec:
  replicas: 3
  domains:
    - example.com
  # image: quay.io/presslabs/wordpress-runtime
  # tag: latest
  code: # where to find the code
    # contentSubpath: wp-content/
    # by default, code get's an empty dir. Can be one of the following:
    git:
      repository: https://github.com/example.com
      # reference: master
      # env:
      #   - name: SSH_RSA_PRIVATE_KEY
      #     valueFrom:
      #       secretKeyRef:
      #         name: mysite
      #         key: id_rsa

    # persistentVolumeClaim: {}
    # hostPath: {}
    # emptyDir: {} (default)

  media: # where to find the media files
    # by default, code get's an empty dir. Can be one of the following:
    gcs: # store files using Google Cloud Storage
      bucket: calins-wordpress-runtime-playground
      prefix: mysite/
      env:
        - name: GOOGLE_CREDENTIALS
          valueFrom:
            secretKeyRef:
              name: mysite
              key: google_application_credentials.json
        - name: GOOGLE_PROJECT_ID
          value: development
    # persistentVolumeClaim: {}
    # hostPath: {}
    # emptyDir: {}
  bootstrap: # wordpress install config
    env:
      - name: WORDPRESS_BOOTSTRAP_USER
        valueFrom:
          secretKeyRef:
            name: mysite
            key: USER
      - name: WORDPRESS_BOOTSTRAP_PASSWORD
        valueFrom:
          secretKeyRef:
            name: mysite
            key: PASSWORD
      - name: WORDPRESS_BOOTSTRAP_EMAIL
        valueFrom:
          secretKeyRef:
            name: mysite
            key: EMAIL 
      - name: WORDPRESS_BOOTSTRAP_TITLE
        valueFrom:
          secretKeyRef:
            name: mysite
            key: TITLE
  # extra volumes for the Wordpress container
  volumes: []
  # extra volume mounts for the Wordpress container
  volumeMounts: []
  # extra env variables for the Wordpress container
  env:
    - name: DB_HOST
      value: mysite-mysql
    - name: DB_USER
      valueFrom:
        secretKeyRef: mysite-mysql
        key: USER
    - name: DB_PASSWORD
      valueFrom:
        secretKeyRef: mysite-mysql
        key: PASSWORD
    - name: DB_NAME
      valueFrom:
        secretKeyRef: mysite-mysql
        key: DATABASE
  envFrom: []

  # secret containg HTTPS certificate
  tlsSecretRef: mysite-tls
  # extra ingress annotations
  ingressAnnotations: {}

License

This project is licensed under Apache 2.0 license. Read the LICENSE file in the top distribution directory, for the full license text.

Directories

Path Synopsis
cmd
pkg
apis
Package apis contains Kubernetes API groups.
Package apis contains Kubernetes API groups.
apis/wordpress
Package wordpress contains wordpress API versions
Package wordpress contains wordpress API versions
apis/wordpress/v1alpha1
Package v1alpha1 contains API Schema definitions for the wordpress v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/presslabs/wordpress-operator/pkg/apis/wordpress +k8s:defaulter-gen=TypeMeta +groupName=wordpress.presslabs.org Package v1alpha1 contains API Schema definitions for the wordpress v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/presslabs/wordpress-operator/pkg/apis/wordpress +k8s:defaulter-gen=TypeMeta +groupName=wordpress.presslabs.org
Package v1alpha1 contains API Schema definitions for the wordpress v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/presslabs/wordpress-operator/pkg/apis/wordpress +k8s:defaulter-gen=TypeMeta +groupName=wordpress.presslabs.org Package v1alpha1 contains API Schema definitions for the wordpress v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/presslabs/wordpress-operator/pkg/apis/wordpress +k8s:defaulter-gen=TypeMeta +groupName=wordpress.presslabs.org

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL