{"id":16060833,"url":"https://github.com/geerlingguy/drupal-operator","last_synced_at":"2025-03-17T16:32:18.162Z","repository":{"id":44380285,"uuid":"197839307","full_name":"geerlingguy/drupal-operator","owner":"geerlingguy","description":"Drupal Operator for Kubernetes, built with Ansible and the Operator SDK.","archived":false,"fork":false,"pushed_at":"2023-07-10T23:02:15.000Z","size":68,"stargazers_count":31,"open_issues_count":7,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-10T04:06:44.960Z","etag":null,"topics":["ansible","containers","drupal","k8s","kubernetes","operator","operator-sdk"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geerlingguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"geerlingguy","patreon":"geerlingguy"}},"created_at":"2019-07-19T20:42:13.000Z","updated_at":"2024-05-28T13:32:25.000Z","dependencies_parsed_at":"2022-07-14T12:30:54.505Z","dependency_job_id":null,"html_url":"https://github.com/geerlingguy/drupal-operator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fdrupal-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fdrupal-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fdrupal-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fdrupal-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geerlingguy","download_url":"https://codeload.github.com/geerlingguy/drupal-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221697063,"owners_count":16865534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","containers","drupal","k8s","kubernetes","operator","operator-sdk"],"created_at":"2024-10-09T04:06:43.036Z","updated_at":"2024-10-27T15:18:27.557Z","avatar_url":"https://github.com/geerlingguy.png","language":"Dockerfile","funding_links":["https://github.com/sponsors/geerlingguy","https://patreon.com/geerlingguy"],"categories":[],"sub_categories":[],"readme":"# Drupal Operator for Kubernetes\n\n[![Build Status](https://travis-ci.com/geerlingguy/drupal-operator.svg?branch=master)](https://travis-ci.com/geerlingguy/drupal-operator)\n\nThis is a Drupal Operator, which makes management of Drupal instances running inside Kuberenetes clusters easy. It was built with the [Operator SDK](https://github.com/operator-framework/operator-sdk) using [Ansible Operator](https://www.ansible.com/blog/ansible-operator).\n\n## Usage\n\nThis Kubernetes Operator is meant to be deployed in your Kubernetes cluster(s) and can manage one or more Drupal instances in any namespace.\n\nFirst you need to deploy Drupal Operator into your cluster:\n\n    kubectl apply -f https://raw.githubusercontent.com/geerlingguy/drupal-operator/master/deploy/drupal-operator.yaml\n\nThen you can create instances of Drupal in any namespace, for example:\n\n  1. Create a file named `my-drupal-site.yml` with the following contents:\n\n     ```\n     ---\n     apiVersion: drupal.drupal.org/v1alpha1\n     kind: Drupal\n     metadata:\n       name: my-drupal-site\n       namespace: default\n     spec:\n       # The container image to use for the Drupal deployment.\n       drupal_image: 'drupal:8.8-apache'\n\n       # Set this to 'true' to use a single-pod database managed by this operator.\n       manage_database: true\n       database_image: mariadb:10\n       database_pvc_size: 1Gi\n       database_password: change-me\n       \n       # Set this to 'true' to have this operator manage Ingress for the site.\n       manage_ingress: true\n       drupal_hostname: mysite.com\n     ```\n\n  2. Use `kubectl` to create the Drupal site in your cluster:\n\n     ```\n     kubectl apply -f my-drupal-site.yml\n     ```\n\nThere are many other options you can provide in the `spec`, to control the deployment and how it integrates with external services (e.g. set `manage_database` to `false` and override the `database_` options to integrate with a separate database backend).\n\n\u003e You can also deploy `Drupal` applications into other namespaces by changing `metadata.namespace`, or deploy multiple `Drupal` instances into the same namespace by changing `metadata.name`.\n\n## Development\n\n### Release Process\n\nThere are a few moving parts to this project:\n\n  1. The Docker image which powers Drupal Operator.\n  2. The `drupal-operator.yaml` Kubernetes manifest file which initially deploys the Operator into a cluster.\n\nEach of these must be appropriately built in preparation for a new tag:\n\n#### Build a new release of the Operator for Docker Hub\n\nRun the following command inside this directory:\n\n    operator-sdk build geerlingguy/drupal-operator:0.1.1\n\nThen push the generated image to Docker Hub:\n\n    docker push geerlingguy/drupal-operator:0.1.1\n\n#### Build a new version of the `drupal-operator.yaml` file\n\nVerify the `build/chain-operator-files.yml` playbook has the most recent version/tag of the Docker image, then run the playbook in the `build/` directory:\n\n    ansible-playbook chain-operator-files.yml\n\nAfter it is built, test it on a local cluster:\n\n    minikube start\n    minikube addons enable ingress\n    kubectl apply -f deploy/drupal-operator.yaml\n    kubectl create namespace example-drupal\n    kubectl apply -f deploy/crds/drupal_v1alpha1_drupal_cr.yaml\n    \u003ctest everything\u003e\n    minikube delete\n\nIf everything is deployed correctly, commit the updated version and push it up to GitHub, tagging a new repository release with the same tag as the Docker image.\n\n### Testing\n\n#### Testing in Docker (standalone)\n\n    molecule test -s test-local\n\nThis environment is meant for headless testing (e.g. in a CI environment, or when making smaller changes which don't need to be verified through a web interface). It is difficult to test things like Drupal's front-end or connecting other applications on your local machine to services running inside the cluster, since it is inside a Docker container with no static IP address.\n\n#### Testing in Minikube\n\n    minikube start\n    minikube addons enable ingress\n    molecule test -s test-minikube\n\n[Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) is a more full-featured test environment running inside a full VM on your computer, with an assigned IP address. This makes it easier to test things like NodePort services and Ingress from outside the Kubernetes cluster (e.g. in a browser on your computer).\n\nOnce the operator is deployed, you can visit the Drupal in your browser by following these steps:\n\n  1. Make sure you have an entry like `IP_ADDRESS  example-drupal.test` in your `/etc/hosts` file. (Get the IP address with `minikube ip`.)\n  2. Visit `http://example-drupal.test/` in your browser.\n\n## Authors\n\nThis is a fork of the original [drupal-operator](https://github.com/thom8/drupal-operator/) by [Thom Toogood](https://github.com/thom8). We have long collaborated on Drupal DevOps-related projects and Thom's work is impeccable.\n\nThis fork is maintained by [Jeff Geerling](https://www.jeffgeerling.com), author of [Ansible for DevOps](https://www.ansiblefordevops.com) and [Ansible for Kubernetes](https://www.ansibleforkubernetes.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fdrupal-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeerlingguy%2Fdrupal-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fdrupal-operator/lists"}