This topic describes how to deploy a WordPress application in a Container Service for Kubernetes (ACK) cluster by using Helm.
Prerequisites
The CSI plug-in is installed in the cluster and runs as expected. For more information, see Manage the CSI plug-in.
Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
Step 1: Deploy the WordPress application
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane, choose .
On the Helm page, click Deploy. In the Basic Information step, configure the parameters based on the following table.
Parameter
Example
Application Name
wordpress
Namespace
default
Source
Marketplace
Chart
Use Scenarios: Select All.
Supported Architecture: Select amd64.
Search box: Search for ack-wordpress-sample.
Select ack-wordpress-sample, and click Next.
In the Parameters step, configure the Chart Version parameter and click OK.
Step 2: Access the WordPress application
After WordPress is installed, run the following command to query the external IP address
EXTERNAL-IP
:kubectl get svc --namespace default
The expected output is as follows, where
EXTERNAL-IP
is118.xx.xx.10
.NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE wordpressabc-ack-wordpress-sample LoadBalancer 172.16.86.22 118.190.xx.xx 80:30837/TCP,443:32433/TCP 33m wordpressabc-mariadb ClusterIP 172.16.70.108 <none> 3306/TCP 33m
Use the
kubectl get pod
command to find the name of the WordPress pod, and then run the following command to obtain the username:kubectl get pod <wordpress-ack-wordpress-sample-name> -o=jsonpath='{.spec.containers[*].env[?(@.name=="WORDPRESS_USERNAME")].value}'
Expected output:
user
Run the following command to obtain the password:
kubectl get secret --namespace default wordpress-ack-wordpress-sample -o jsonpath="{.data.wordpress-password}" | base64 --decode
Expected output:
ps**jRx**V
Enter
/login
into the address bar of your browser and press Enter to access WordPress. On the logon page, enter the obtained username and password to log on to the application.