==================================================
wordpress
The WordPress application demonstrates how you can configure a WordPress site powered by GCP MySQL database and using Workload Identity for authentication.
-
Clone GoogleCloudPlatform/cloud-foundation-toolkit repository
git clone https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit.git
-
Go to the wordpress folder:
cd cloud-foundation-toolkit/config-connector/solutions/apps/helm/wordpress
-
GKE Cluster with Config Connector and Workload Identity.
-
Cloud Resource Manager API needs to be enabled on the project to use ServiceUsage Resource. You can enable it by running:
gcloud services enable cloudresourcemanager.googleapis.com --project [PROJECT_ID]
All steps are run from this directory.
-
Review and update the values in
./charts/wordpress-gcp/values.yaml
.Note: Please ensure the value of
database.instanceName
(defaults towp-db
) is unique and hasn't been used as an SQL instance name in the last 7 days. -
Validate and install the sample with Helm.
# validate your chart helm lint ./charts/wordpress-gcp/ --set google.projectId=[PROJECT_ID] # check the output of your chart helm template ./charts/wordpress-gcp/ --set google.projectId=[PROJECT_ID] # install your chart helm install ./charts/wordpress-gcp/ --set google.projectId=[PROJECT_ID] --generate-name
-
The wordpress creation can take up to 10-15 minutes. Throughout the process you can check the status of various components:
# check the status of sqlinstance kubectl describe sqlinstance [VALUE of database.instanceName] # check the status of wordpress pod (the output should show that both containers are ready) kubectl get pods wordpress-0
Note: If the pods can't be scheduled because of
Insufficient CPU
issue, please increase the size of nodes in your cluster. Once the pods are ready, obtain the external IP address of your WordPress application by checking:kubectl get svc wordpress-external
Navigate to this address and validate that you see WordPress installation page.
-
Clean up the installation:
# list Helm releases to obtain release name helm list # delete release specifying release name from the previous command output. Note that can take a few minutes before all K8s resources are fully deleted. helm delete [release_name]
Apache 2.0 - See LICENSE for more information.