Drupal-k8s docs - index

Overview

In a nutshell, this charmed operator implements the following:

  1. Start drupal workload containter.
  2. Install drush in the workload container.
  3. Wait for the relation with database.
  4. Once the relation with database is created, install Drupal with
    drush site-install ...
  5. Drupal is installed and ready to use.
  6. Provide juju action get-admin-password so that a user can learn admin password generated by this operator.

State machine

For the initial implementation, the lifecycle of the operator is based on four states, controled by the following data:

  • is Drupal installed? Yes / No
  • is database connection ready? Yes / No

All four combinations of the above flags create four states for the operator:

  1. Drupal is already installed and database relation is present.

    This is a normal operation. drupal service (default entrypoint for the drupal container) should be started, if it is not running already.

  2. Drupal is already installed but the database is not ready.

    Most likely the database relation has been broken. Drupal cannot operate without a backing database, so we need to stop drupal service and set Blocked status of the operator. Once the database relation is brought back, drupal service will be restarted in state 1.

  3. Drupal is not installed yet but the database is ready.

    The operator is now ready to install Drupal. The installation is implemented by executing drush site-install ... CLI command inside the workload container.

    The operator creates a new Pebble layer, with an entrypoint pointing to the script that runs drush with necessary arguments. The parameters for the script, (e.g. specifying database connection string) are passed as environment variables. Then Pebbles starts this new layer.

    Once the Drupal installation is finished, config-changed event is emitted, so that the operator can handle actions from step 1.

  4. Drupal is not yet installed and the database relation has not been created yet.

    Database connection is not ready. Therefore the operator cannot proceed with Drupal installation. Set Blocked state and wait for database relation.

Database

This charm requires a relation with postgresql-k8s.

Although Drupal container image supports integration with MySQL / MariaDB or it can use a local SQLite, this is not implemented by this operator. At the time of the initial implementation, MySQL / MariaDB charmed operators for Kuberenes were not available. A local SQLite however does not fit for a production-grade, HA deployment.

# Navigation

| Level | Path     | Navlink                         |
| ----- | -------- | ------------------------------- |
| 1     |          | [Overview](/t/drupal-k8s-docs-index/4722) |
# Redirects

[details=Mapping table]
| Path | Location |
| ---- | -------- |
[/details]