Skip to content
Drupal operator for Kubernetes (In Development)
Branch: master
Clone or download

Drupal Operator

Drupal Operator generated via KubeBuilder to enable managing multiple Drupal installs.


The main goals of the operator are:

  1. Ability to deploy Drupal sites on top of Kubernetes
  2. Provide best practices for application lifecycle
  3. Facilitate proper devops (backups, monitoring and high-availability)

Project is currently under active development.


  1. Drupal Operator (this project)
  2. Drupal Container Image (

Installation of Controller (CRD)

helm repo add sylus
helm --name drupal-operator install sylus/drupal-operator


First we need to install the mysql-operator as well as default role bindings.

# Create our namespace
kubectl create ns mysql-operator

# Install via Helm
helm install --name mysql-operator -f values.yaml --namespace mysql-operator .

# Install RoleBindings for appropriate namespace
cat <<EOF | kubectl create -f -
kind: RoleBinding
  name: mysql-agent
  namespace: default
  kind: ClusterRole
  name: mysql-agent
- kind: ServiceAccount
  name: mysql-agent
  namespace: default

Next we can start to utilize the Drupal operator!

# Deploy the operator (helm chart still being tested)
make deploy

# Leverage our example spec
kubectl apply -f config/samples/drupal_v1beta1_droplet.yaml

# Create initial database
kubectl run mysql-client --image=mysql:5.7 -it --rm --restart=Never -- mysql -h mysite-mysql -uroot -pmy-super-secret-pass -e 'create database drupal;'

# Run Drush and install our site
export POD_NAME=$(kubectl get pods --namespace default -l "" -o jsonpath="{.items[0]}")
kubectl exec -it $POD_NAME -n default -- drush si wxt \
    --sites-subdir=default \
    --account-name=admin \
    --account-pass=Drupal@2019 \ \
    --site-name="Drupal Install Profile (WxT)" \
    install_configure_form.update_status_module='array(FALSE,FALSE)' \
You can’t perform that action at this time.