All Products
Search
Document Center

Container Service for Kubernetes:Deploy a WordPress application by using Helm

Last Updated:Jul 19, 2024

This topic describes how to deploy a WordPress application in a Container Service for Kubernetes (ACK) cluster by using Helm.

Prerequisites

Step 1: Deploy the WordPress application

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane, choose Applications > Helm.

  3. 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.

  4. In the Parameters step, configure the Chart Version parameter and click OK.

Step 2: Access the WordPress application

  1. 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 is 118.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
  2. 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
  3. 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
  4. 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.

    image