diff --git a/content/en/docs/quick-start/wordpress-deployment.md b/content/en/docs/quick-start/wordpress-deployment.md index 5d481a3e6..82b208d09 100644 --- a/content/en/docs/quick-start/wordpress-deployment.md +++ b/content/en/docs/quick-start/wordpress-deployment.md @@ -2,7 +2,6 @@ title: "Compose and Deploy WordPress" keywords: 'KubeSphere, Kubernetes, app, WordPress' description: 'Compose and deploy Wordpress.' - linkTitle: "Compose and Deploy WordPress" weight: 2500 --- @@ -11,7 +10,7 @@ weight: 2500 WordPress is a free and open-source content management system written in PHP, allowing users to build their own websites. A complete WordPress application includes the following Kubernetes objects with MySQL serving as the backend database. -![WordPress](https://pek3b.qingstor.com/kubesphere-docs/png/20200105181908.png) +![WordPress](/images/docs/quickstart/wordpress-deployment/WordPress.png) ## Objective @@ -19,7 +18,7 @@ This tutorial demonstrates how to create an application (WordPress as an example ## Prerequisites -An account `project-regular` is needed with the role `operator` assigned in one of your projects (the user has been invited to the project). For more information, see [Create Workspaces, Projects, Accounts and Roles](../create-workspace-and-project/). +An account `project-regular` is needed with the role of `operator` assigned in one of your projects (the user has been invited to the project). For more information, see [Create Workspaces, Projects, Accounts and Roles](../create-workspace-and-project/). ## Estimated Time @@ -27,173 +26,174 @@ About 15 minutes. ## Hands-on Lab -### Task 1: Create Secrets +### Step 1: Create Secrets #### Create a MySQL Secret -The environment variable `WORDPRESS_DB_PASSWORD` is the password to connect to the database in WordPress. In this step, you need to create a Secret to store the environment variable that will be used in MySQL pod template. +The environment variable `WORDPRESS_DB_PASSWORD` is the password to connect to the database in WordPress. In this step, you need to create a Secret to store the environment variable that will be used in the MySQL Pod template. -1. Log in to KubeSphere console using the account `project-regular`. Go to the detailed page of `demo-project` and navigate to **Configurations**. In **Secrets**, click **Create** on the right. +1. Log in to the KubeSphere console using the account `project-regular`. Go to the detail page of `demo-project` and navigate to **Configurations**. In **Secrets**, click **Create** on the right. -![create-secret](https://ap3.qingstor.com/kubesphere-website/docs/20200903154611.png) + ![create-secrets](/images/docs/quickstart/wordpress-deployment/create-secrets.png) -2. Enter the basic information (e.g. name it `mysql-secret`) and click **Next**. In the next page, select **Default** for **Type** and click **Add Data** to add a key-value pair. Input the Key (`MYSQL_ROOT_PASSWORD`) and Value (`123456`) as below and click `√` in the bottom-right corner to confirm. When you finish, click **Create** to continue. +2. Enter the basic information (e.g. name it `mysql-secret`) and click **Next**. On the next page, select **Default** for **Type** and click **Add Data** to add a key-value pair. Input the Key (`MYSQL_ROOT_PASSWORD`) and Value (`123456`) as below and click **√** in the bottom-right corner to confirm. When you finish, click **Create** to continue. -![key-value](https://ap3.qingstor.com/kubesphere-website/docs/20200903155603.png) + ![key-value](/images/docs/quickstart/wordpress-deployment/key-value.png) #### Create a WordPress Secret -Follow the same steps above to create a WordPress secret `wordpress-secret` with the key `WORDPRESS_DB_PASSWORD` and value `123456`. Secrets created display in the list as below: +Follow the same steps above to create a WordPress Secret `wordpress-secret` with the key `WORDPRESS_DB_PASSWORD` and value `123456`. Secrets created display in the list as below: -![wordpress-secrets](https://ap3.qingstor.com/kubesphere-website/docs/20200903160809.png) +![wordpress-secrets](/images/docs/quickstart/wordpress-deployment/wordpress-secrets.png) -### Task 2: Create a Volume +### Step 2: Create a volume 1. Go to **Volumes** under **Storage** and click **Create**. -![create-volume](https://ap3.qingstor.com/kubesphere-website/docs/20200903162343.png) + ![volumes](/images/docs/quickstart/wordpress-deployment/volumes.png) 2. Enter the basic information of the volume (e.g. name it `wordpress-pvc`) and click **Next**. + 3. In **Volume Settings**, you need to choose an available **Storage Class**, and set **Access Mode** and **Volume Capacity**. You can use the default value directly as shown below. Click **Next** to continue. -![volume-settings](https://ap3.qingstor.com/kubesphere-website/docs/20200903163419.png) + ![volume-settings](/images/docs/quickstart/wordpress-deployment/volume-settings.png) -4. For **Advanced Settings**, you do not need to add extra information for this task and click **Create** to finish. +4. For **Advanced Settings**, you do not need to add extra information for this step and click **Create** to finish. -### Task 3: Create an Application +### Step 3: Create an application -#### Add MySQL backend component +#### Add MySQL backend components 1. Navigate to **Applications** under **Application Workloads**, select **Composing App** and click **Create Composing Application**. -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903164227.png) + ![composing-app](/images/docs/quickstart/wordpress-deployment/composing-app.png) 2. Enter the basic information (e.g. input `wordpress` for Application Name) and click **Next**. -![basic-info](https://ap3.qingstor.com/kubesphere-website/docs/basic-info.png) + ![basic-info](/images/docs/quickstart/wordpress-deployment/basic-info.png) 3. In **Components**, click **Add Service** to set a component in the app. -![add-service](https://ap3.qingstor.com/kubesphere-website/docs/20200903173210.png) + ![add-service](/images/docs/quickstart/wordpress-deployment/add-service.png) 4. Define a service type for the component. Select **Stateful Service** here. + 5. Enter the name for the stateful service (e.g. **mysql**) and click **Next**. -![mysql-name](https://ap3.qingstor.com/kubesphere-website/docs/mysqlname.png) + ![mysqlname](/images/docs/quickstart/wordpress-deployment/mysqlname.png) 6. In **Container Image**, click **Add Container Image**. -![container-image](https://ap3.qingstor.com/kubesphere-website/docs/container-image.png) + ![container-image](/images/docs/quickstart/wordpress-deployment/container-image.png) -7. Enter `mysql:5.6` in the search box, press **Enter** and click **Use Default Ports**. After that, do not click `√` in the bottom-right corner as the setting is not finished yet. +7. Enter `mysql:5.6` in the search box, press **Enter** and click **Use Default Ports**. After that, do not click **√** in the bottom-right corner as the setting is not finished yet. -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903174120.png) + ![add-container](/images/docs/quickstart/wordpress-deployment/add-container.png) -{{< notice note >}} + {{< notice note >}} In **Advanced Settings**, make sure the memory limit is no less than 1000 Mi or MySQL may fail to start due to a lack of memory. {{}} -8. Scroll down to **Environment Variables** and click **Use ConfigMap or Secret**. Input the name `MYSQL_ROOT_PASSWORD` and choose the resource `mysql-secret` and the key `MYSQL_ROOT_PASSWORD` created in the previous step. Click `√` after you finish and **Next** to continue. +8. Scroll down to **Environment Variables** and click **Use ConfigMap or Secret**. Input the name `MYSQL_ROOT_PASSWORD` and choose the resource `mysql-secret` and the key `MYSQL_ROOT_PASSWORD` created in the previous step. Click **√** after you finish and **Next** to continue. -![environment-var](https://ap3.qingstor.com/kubesphere-website/docs/20200903174838.png) + ![environment-var](/images/docs/quickstart/wordpress-deployment/environment-var.png) 9. Select **Add Volume Template** in **Mount Volumes**. Input the value of **Volume Name** (`mysql`) and **Mount Path** (mode: `ReadAndWrite`, path: `/var/lib/mysql`) as below: -![volume-template](https://ap3.qingstor.com/kubesphere-website/docs/vol11.jpg) + ![volume-template](/images/docs/quickstart/wordpress-deployment/volume-template.jpg) -Click `√` after you finish and click **Next** to continue. + Click **√** after you finish and click **Next** to continue. 10. In **Advanced Settings**, you can click **Add** directly or select other options based on your needs. -![advanced-setting](https://ap3.qingstor.com/kubesphere-website/docs/20200903180415.png) + ![advanced-settings](/images/docs/quickstart/wordpress-deployment/advanced-settings.png) -11. At this point, the MySQL component has beed added as shown below: +11. The MySQL component has beed added as shown below: -![mysql-done](https://ap3.qingstor.com/kubesphere-website/docs/20200903180714.png) + ![mysql-finished](/images/docs/quickstart/wordpress-deployment/mysql-finished.png) -#### Add WordPress frontend component +#### Add the WordPress frontend component 12. Click **Add Service** again and select **Stateless Service** this time. Enter the name `wordpress` and click Next. -![](https://ap3.qingstor.com/kubesphere-website/docs/name-wordpress.png) + ![name-wordpress](/images/docs/quickstart/wordpress-deployment/name-wordpress.png) 13. Similar to the step above, click **Add Container Image**, enter `wordpress:4.8-apache` in the search box, press **Enter** and click **Use Default Ports**. -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903171416.png) + ![container-image-page](/images/docs/quickstart/wordpress-deployment/container-image-page.png) 14. Scroll down to **Environment Variables** and click **Use ConfigMap or Secret**. Two environment variables need to be added here. Enter the values according to the screenshot below. -- For `WORDPRESS_DB_PASSWORD`, choose `wordpress-secret` and `WORDPRESS_DB_PASSWORD` created in Task 1. -- Click **Add Environment Variable**, and enter `WORDPRESS_DB_HOST` and `mysql` for the key and value. + - For `WORDPRESS_DB_PASSWORD`, choose `wordpress-secret` and `WORDPRESS_DB_PASSWORD` created in Task 1. -{{< notice warning >}} + - Click **Add Environment Variable**, and enter `WORDPRESS_DB_HOST` and `mysql` for the key and value. + + {{< notice warning >}} For the second environment variable added here, the value must be exactly the same as the name you set for MySQL in step 5. Otherwise, Wordpress cannot connect to the corresponding database of MySQL. {{}} -![environment-varss](https://ap3.qingstor.com/kubesphere-website/docs/20200903171658.png) - -Click `√` to save it and **Next** to continue. + ![environment-varss](/images/docs/quickstart/wordpress-deployment/environment-varss.png) + + Click **√** to save it and **Next** to continue. 15. In **Mount Volumes**, click **Add Volume** and select **Choose an existing volume**. -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903171819.png) + ![add-volume-page](/images/docs/quickstart/wordpress-deployment/add-volume-page.png) + ![choose-existing-volume](/images/docs/quickstart/wordpress-deployment/choose-existing-volume.png) +16. Select `wordpress-pvc` created in the previous step, set the mode as `ReadAndWrite`, and input `/var/www/html` as its mount path. Click **√** to save it and **Next** to continue. -![choose-existing](https://ap3.qingstor.com/kubesphere-website/docs/20200903171906.png) - -16. Select `wordpress-pvc` created in the previous step, set the mode as `ReadAndWrite`, and input `/var/www/html` as its mount path. Click `√` to save it and **Next** to continue. - -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903172021.png) + ![mount-volume-page](/images/docs/quickstart/wordpress-deployment/mount-volume-page.png) 17. In **Advanced Settings**, you can click **Add** directly or select other options based on your needs. -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903172144.png) + ![advanced](/images/docs/quickstart/wordpress-deployment/advanced.png) -18. The frontend component is also set now. Click **Next** to continue. +18. The frontend component is also set now. Click **Next** to continue. -![two-components-done](https://ap3.qingstor.com/kubesphere-website/docs/20200903172222.png) + ![components-finished](/images/docs/quickstart/wordpress-deployment/components-finished.png) 19. You can set route rules (Ingress) here or click **Create** directly. -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903184009.png) + ![ingress-create](/images/docs/quickstart/wordpress-deployment/ingress-create.png) 20. The app will display in the list below after you create it. -![](https://ap3.qingstor.com/kubesphere-website/docs/20200903184151.png) + ![application-created](/images/docs/quickstart/wordpress-deployment/application-created.png) -### Task 4: Verify the Resources +### Step 4: Verify resources In **Workloads**, check the status of `wordpress-v1` and `mysql-v1` in **Deployments** and **StatefulSets** respectively. If they are running as shown in the image below, it means WordPress has been created successfully. -![wordpress-deployment](https://ap3.qingstor.com/kubesphere-website/docs/20200903203217.png) +![wordpress-deployment](/images/docs/quickstart/wordpress-deployment/wordpress-deployment.png) -![wordpress-statefulset](https://ap3.qingstor.com/kubesphere-website/docs/20200903203638.png) +![mysql-running](/images/docs/quickstart/wordpress-deployment/mysql-running.png) -### Task 5: Access WordPress through NodePort +### Step 5: Access WordPress through NodePort -1. To access the service outside the cluster, navigate to **Services** first. Click the three dots on the right of `wordpress` and select **Edit Internet Access**. +1. To access the Service outside the cluster, navigate to **Services** first. Click the three dots on the right of `wordpress` and select **Edit Internet Access**. -![edit-internet-access](https://ap3.qingstor.com/kubesphere-website/docs/20200903204414.png) + ![edit-internet-access](/images/docs/quickstart/wordpress-deployment/edit-internet-access.png) 2. Select `NodePort` for **Access Method** and click **OK**. -![access-method](https://ap3.qingstor.com/kubesphere-website/docs/20200903205135.png) + ![access-method](/images/docs/quickstart/wordpress-deployment/access-method.png) -3. Click the service and you can see the port exposed. +3. Click the Service and you can see the port is exposed. -![nodeport-number](https://ap3.qingstor.com/kubesphere-website/docs/20200903205423.png) + ![nodeport-number](/images/docs/quickstart/wordpress-deployment/nodeport-number.png) -4. Access this application via `{Node IP}:{NodePort}` and you can see an image as below: +4. Access this application at `{Node IP}:{NodePort}` and you can see an image as below: -![wordpress](https://ap3.qingstor.com/kubesphere-website/docs/20200903200408.png) + ![wordpress-page](/images/docs/quickstart/wordpress-deployment/wordpress-page.png) -{{< notice note >}} + {{< notice note >}} -Make sure the port is opened in your security groups before you access the service. +Make sure the port is opened in your security groups before you access the Service. {{}} \ No newline at end of file diff --git a/static/images/docs/quickstart/wordpress-deployment/WordPress.png b/static/images/docs/quickstart/wordpress-deployment/WordPress.png new file mode 100644 index 000000000..46a788ce7 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/WordPress.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/access-method.png b/static/images/docs/quickstart/wordpress-deployment/access-method.png new file mode 100644 index 000000000..a55e8c053 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/access-method.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/add-container.png b/static/images/docs/quickstart/wordpress-deployment/add-container.png new file mode 100644 index 000000000..2b6d98627 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/add-container.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/add-service.png b/static/images/docs/quickstart/wordpress-deployment/add-service.png new file mode 100644 index 000000000..69e01bc07 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/add-service.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/add-volume-page.png b/static/images/docs/quickstart/wordpress-deployment/add-volume-page.png new file mode 100644 index 000000000..e43b71c59 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/add-volume-page.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/advanced-settings.png b/static/images/docs/quickstart/wordpress-deployment/advanced-settings.png new file mode 100644 index 000000000..903937d03 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/advanced-settings.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/advanced.png b/static/images/docs/quickstart/wordpress-deployment/advanced.png new file mode 100644 index 000000000..589b9aecd Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/advanced.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/application-created.png b/static/images/docs/quickstart/wordpress-deployment/application-created.png new file mode 100644 index 000000000..b2259c654 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/application-created.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/basic-info.png b/static/images/docs/quickstart/wordpress-deployment/basic-info.png new file mode 100644 index 000000000..8b4e44e19 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/basic-info.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/choose-existing-volume.png b/static/images/docs/quickstart/wordpress-deployment/choose-existing-volume.png new file mode 100644 index 000000000..d923ce417 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/choose-existing-volume.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/components-finished.png b/static/images/docs/quickstart/wordpress-deployment/components-finished.png new file mode 100644 index 000000000..1f71f2c7e Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/components-finished.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/composing-app.png b/static/images/docs/quickstart/wordpress-deployment/composing-app.png new file mode 100644 index 000000000..3ffd29218 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/composing-app.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/container-image-page.png b/static/images/docs/quickstart/wordpress-deployment/container-image-page.png new file mode 100644 index 000000000..8695849f9 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/container-image-page.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/container-image.png b/static/images/docs/quickstart/wordpress-deployment/container-image.png new file mode 100644 index 000000000..673d4d03b Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/container-image.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/create-secrets.png b/static/images/docs/quickstart/wordpress-deployment/create-secrets.png new file mode 100644 index 000000000..2452f383a Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/create-secrets.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/edit-internet-access.png b/static/images/docs/quickstart/wordpress-deployment/edit-internet-access.png new file mode 100644 index 000000000..7b0886548 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/edit-internet-access.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/environment-var.png b/static/images/docs/quickstart/wordpress-deployment/environment-var.png new file mode 100644 index 000000000..30c9da8a1 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/environment-var.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/environment-varss.png b/static/images/docs/quickstart/wordpress-deployment/environment-varss.png new file mode 100644 index 000000000..2111fab40 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/environment-varss.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/ingress-create.png b/static/images/docs/quickstart/wordpress-deployment/ingress-create.png new file mode 100644 index 000000000..adb8a940a Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/ingress-create.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/key-value.png b/static/images/docs/quickstart/wordpress-deployment/key-value.png new file mode 100644 index 000000000..d458f9db4 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/key-value.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/mount-volume-page.png b/static/images/docs/quickstart/wordpress-deployment/mount-volume-page.png new file mode 100644 index 000000000..b31d960bc Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/mount-volume-page.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/mysql-finished.png b/static/images/docs/quickstart/wordpress-deployment/mysql-finished.png new file mode 100644 index 000000000..408866622 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/mysql-finished.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/mysql-running.png b/static/images/docs/quickstart/wordpress-deployment/mysql-running.png new file mode 100644 index 000000000..76bb9ee24 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/mysql-running.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/mysqlname.png b/static/images/docs/quickstart/wordpress-deployment/mysqlname.png new file mode 100644 index 000000000..b9efc1d76 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/mysqlname.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/name-wordpress.png b/static/images/docs/quickstart/wordpress-deployment/name-wordpress.png new file mode 100644 index 000000000..f248d9f0d Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/name-wordpress.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/nodeport-number.png b/static/images/docs/quickstart/wordpress-deployment/nodeport-number.png new file mode 100644 index 000000000..a3be3cd11 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/nodeport-number.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/volume-settings.png b/static/images/docs/quickstart/wordpress-deployment/volume-settings.png new file mode 100644 index 000000000..f44be0dbb Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/volume-settings.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/volume-template.jpg b/static/images/docs/quickstart/wordpress-deployment/volume-template.jpg new file mode 100644 index 000000000..f11e3e305 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/volume-template.jpg differ diff --git a/static/images/docs/quickstart/wordpress-deployment/volumes.png b/static/images/docs/quickstart/wordpress-deployment/volumes.png new file mode 100644 index 000000000..141b8ef16 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/volumes.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/wordpress-deployment.png b/static/images/docs/quickstart/wordpress-deployment/wordpress-deployment.png new file mode 100644 index 000000000..69c409bc4 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/wordpress-deployment.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/wordpress-page.png b/static/images/docs/quickstart/wordpress-deployment/wordpress-page.png new file mode 100644 index 000000000..d8134a002 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/wordpress-page.png differ diff --git a/static/images/docs/quickstart/wordpress-deployment/wordpress-secrets.png b/static/images/docs/quickstart/wordpress-deployment/wordpress-secrets.png new file mode 100644 index 000000000..863d35ee3 Binary files /dev/null and b/static/images/docs/quickstart/wordpress-deployment/wordpress-secrets.png differ