WordPress with Single Pod

Last updated: 2019-10-18 16:02:21

PDF

Operation Scenario

WordPress is a blogging platform developed with PHP. You can use it as a content management system, or use it to create websites on services that support PHP and MySQL databases.

This document describes how to use the tutum/wordpress image to create a publicly accessible WordPress website.

Prerequisites

  • The tutm/wordpress image includes all operating environments for WordPress, allowing you to pull and create the service directly.
  • Creating WordPress with single pod is for testing purposes only, and persistent data storage cannot be ensured. It is recommended that you use a self-built MySQL or TencentDB to store your data. For more information, please see WordPress Using TencentDB.

Steps

Creating WordPress Service

  1. Log in to the TKE console.
  2. In the left sidebar, click Clusters to go to the Cluster Management page.
  3. Click on the cluster ID for which the service is to be created, and go to the Deployment details page. Select Create. See the figure below:
  4. Set up the workload basic information on the Create Workload page according to the following instructions. See the figure below:
    • Workload Name: The name of the workload to be created. Here, wordpress is used as an example.
    • Description: Fill in the related workload information.
    • Tag: Key = value. This is a key value pair, and the tag in this example is set by default as k8s-app = wordpress.
    • Namespace: To be selected based on your requirements.
    • Type: To be selected based on your requirements.
    • Volume: Set up the workload volumes mounted based on your requirements. For more details, see Volume Management.
  5. Set up Containers in Pod according to the following instructions. See the figure below:
    • Name: Enter the custom container name. Here, test is used as an example.
    • Image: Enter tutum/wordpress.
    • Image Tag: Enter latest.

      Keep default settings for other options.

  6. Set up the service’s pod number according to the following instructions. See the figure below:
    • Manual adjustment: Set the number of pods. The number of pods in this example is set as 1. You can click + or - to change the number of pods.
    • Auto adjustment: Automatically adjust the number of pods if any of the setting conditions are met. For more details, see Auto Scaling.
  7. Configure the workload access settings (service) according to the following instructions. See the figure below:
    • Service: Check Enable.
    • Service Access: Select Via Internet.
    • Load balancer: Select according to your requirements.
    • Port mapping: Select TCP protocol, and set both the container port and service port to 80.

      The security group of the service’s cluster must open the node network and container network to the Internet. It is also required to open ports 30000 to 32768 to the Internet. Otherwise, the problem of TKE being unusable could occur. For more details, see TKE Security Group Settings.

  8. Click Create workload to complete the creation of the wordpress service.

Accessing WordPress Service

WordPress service can be accessed using the following two methods.

Accessing WordPress Service Through Cloud Load Balancer IP

  1. In the left sidebar, click Clusters to go to the Cluster Management page.
  2. Click on the WordPress service’s cluster ID and select Service > Service.
  3. Enter the service management page and copy the WordPress service’s load balancer IP. See the figure below:
  4. Enter the load balancer IP in the browser’s address bar and press Enter to access the service.

Accessing Service Using Service Name

Other services or containers in the cluster can be accessed directly by the service name.

Verifying WordPress Service

When the service is successfully created, you can directly enter the WordPress server configuration page when accessing the service. See the figure below:

More WordPress Settings

If creation of the container failed, you can read the Event FAQs.