This repository contains a convenience script for deploying Drupal on Kubernetes. The script simplifies the process of setting up and managing a Drupal instance on a Kubernetes cluster.
These instructions will guide you on how to deploy Drupal on Kubernetes using the convenience script.
Before using the convenience script, make sure you have the following prerequisites installed:
- Docker
- Kubernetes cluster
- kubectl command-line tool
- method of authenticating against the kubernetes cluster
This script is meant to be included within our devops pipeline. Examples for common DevOps platforms are below
-
Create directory where you want to house this script
mkdir .azure-devops && cd .azure-devops
-
Download convenience script
wget https://raw.githubusercontent.com/mobomo/kubernetes_drupal_deployscript/main/deploy.sh -O deploy.sh
-
Add "Shell Exec" task to Release Definition
-
Add following code in order to push prebuilt image (via your CI pipeline) to your remote registry
export BUILD_ID=$(Build.BuildID) export NAMESPACE=dev export CONTAINER_REGISTRY=somecontainerregistry.azurecr.us export REPO=drupal export SUBSCRIPTION_ID=1234 cd $(System.DefaultWorkingDirectory)/CI/CI/s/ chmod +x .azure-devops/deploy.sh .azure-devops/deploy.sh push \ --build-id=$BUILD_ID \ --namespace=$NAMESPACE \ --container-registry=$CONTAINER_REGISTRY \ --repo=$REPO \ --subscription-id=$SUBSCRIPTION_ID
-
Add following code to your deploy task
export BUILD_ID=$(Build.BuildID) export NAMESPACE=dev export CONTAINER_REGISTRY=somecontainerregistry.azurecr.us export REPO=drupal export SUBSCRIPTION_ID=1234 export REPLICA_COUNT=3 cd $(System.DefaultWorkingDirectory)/CI/CI/s/ chmod +x .azure-devops/deploy.sh .azure-devops/deploy.sh deploy \ --build-id=$BUILD_ID \ --namespace=$NAMESPACE \ --container-registry=$CONTAINER_REGISTRY \ --repo=$REPO \ --subscription-id=$SUBSCRIPTION_ID \ --replica-count=$REPLICA_COUNT \ --maintenance-window=1 \ --delete-cron=1
These examples assume your Pipeline is set as an Artifact for the release definition and is labeled CI