MCPcopy Index your code
hub / github.com/bitpoke/wordpress-operator

github.com/bitpoke/wordpress-operator @v0.13.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.13.0 ↗ · + Follow
119 symbols 448 edges 34 files 82 documented · 69%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

wordpress-operator Build Status

Bitpoke 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.

The minimum supported Kubernetes version is 1.19.

Components

  1. WordPress operator - this project
  2. WordPress runtime - container image supporting the project goals (https://github.com/bitpoke/stack-runtimes/tree/master/wordpress)

Deploy

Install CRDs

This step is optional. By default helm will install CRDs.

Install kustomize. New to kustomize? Check https://kustomize.io/ Install kubectl. For more details, see: https://kubernetes.io/docs/tasks/tools/install-kubectl/

To install CRDs use the following command:

kubectl apply -f https://raw.githubusercontent.com/bitpoke/wordpress-operator/master/config/crd/bases/wordpress.bitpoke.io_wordpresses.yaml

Install controller

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

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

helm repo add bitpoke https://helm-charts.bitpoke.io
helm install wordpress-operator bitpoke/wordpress-operator

Deploying a WordPress Site

apiVersion: wordpress.bitpoke.io/v1alpha1
kind: Wordpress
metadata:
  name: mysite
spec:
  replicas: 3
  domains:
    - example.com
  # image: docker.io/bitpoke/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.

Core symbols most depended-on inside this repo

Unwrap
called by 14
pkg/internal/wordpress/wordpress.go
ComponentName
called by 12
pkg/internal/wordpress/wordpress.go
WebPodTemplateSpec
called by 9
pkg/internal/wordpress/pod_template.go
HomeURL
called by 8
pkg/internal/wordpress/wordpress.go
ComponentLabels
called by 7
pkg/internal/wordpress/wordpress.go
MainDomain
called by 7
pkg/internal/wordpress/wordpress.go
upsertPath
called by 4
pkg/controller/wordpress/internal/sync/ingress.go
securityContext
called by 4
pkg/internal/wordpress/pod_template.go

Shape

Method 64
Function 36
Struct 16
TypeAlias 3

Languages

Go100%

Modules by API surface

pkg/apis/wordpress/v1alpha1/zz_generated.deepcopy.go26 symbols
pkg/internal/wordpress/pod_template.go20 symbols
pkg/apis/wordpress/v1alpha1/wordpress_types.go16 symbols
pkg/internal/wordpress/wordpress.go13 symbols
pkg/controller/wordpress/wordpress_controller.go10 symbols
pkg/controller/wp-cron/wpcron_controller.go9 symbols
pkg/controller/wordpress/wordpress_controller_suite_test.go3 symbols
pkg/controller/wordpress/internal/sync/ingress.go2 symbols
pkg/cmd/options/options.go2 symbols
pkg/internal/wordpress/pod_template_test.go1 symbols
pkg/internal/wordpress/pod_template_suite_test.go1 symbols
pkg/internal/wordpress/defaults.go1 symbols

For agents

$ claude mcp add wordpress-operator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact