Updated pics-wordpress
Signed-off-by: adakisme <serenashe@yunify.com>
|
|
@ -34,29 +34,29 @@ The environment variable `WORDPRESS_DB_PASSWORD` is the password to connect to t
|
|||
|
||||
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.
|
||||
|
||||

|
||||

|
||||
|
||||
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.
|
||||
2. Enter the basic information (e.g. name it `mysql-secret`) and click **Next**. On the next page, select **Opaque (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.
|
||||
|
||||

|
||||

|
||||
|
||||
#### 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:
|
||||
|
||||

|
||||

|
||||
|
||||
### Step 2: Create a volume
|
||||
|
||||
1. Go to **Volumes** under **Storage** and click **Create**.
|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||
4. For **Advanced Settings**, you do not need to add extra information for this step and click **Create** to finish.
|
||||
|
||||
|
|
@ -64,31 +64,31 @@ Follow the same steps above to create a WordPress Secret `wordpress-secret` with
|
|||
|
||||
#### Add MySQL backend components
|
||||
|
||||
1. Navigate to **Applications** under **Application Workloads**, select **Composing App** and click **Create Composing Application**.
|
||||
1. Navigate to **Apps** under **Application Workloads**, select **Composing Apps** and click **Create Composing App**.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Enter the basic information (e.g. input `wordpress` for Application Name) and click **Next**.
|
||||
|
||||

|
||||

|
||||
|
||||
3. In **Components**, click **Add Service** to set a component in the app.
|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||
6. In **Container Image**, click **Add Container Image**.
|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||
{{< notice note >}}
|
||||
|
||||
|
|
@ -98,31 +98,31 @@ In **Advanced Settings**, make sure the memory limit is no less than 1000 Mi or
|
|||
|
||||
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.
|
||||
|
||||

|
||||

|
||||
|
||||
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:
|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||
11. The MySQL component has beed added as shown below:
|
||||
|
||||

|
||||

|
||||
|
||||
#### Add the WordPress frontend component
|
||||
|
||||
12. Click **Add Service** again and select **Stateless Service** this time. Enter the name `wordpress` and click Next.
|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||
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.
|
||||
|
||||
|
|
@ -136,49 +136,49 @@ For the second environment variable added here, the value must be exactly the sa
|
|||
|
||||
{{</ notice >}}
|
||||
|
||||

|
||||

|
||||
|
||||
Click **√** to save it and **Next** to continue.
|
||||
|
||||
15. In **Mount Volumes**, click **Add Volume** and select **Choose an existing volume**.
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||
17. In **Advanced Settings**, you can click **Add** directly or select other options based on your needs.
|
||||
|
||||

|
||||

|
||||
|
||||
18. The frontend component is also set now. Click **Next** to continue.
|
||||
|
||||

|
||||

|
||||
|
||||
19. You can set route rules (Ingress) here or click **Create** directly.
|
||||
|
||||

|
||||

|
||||
|
||||
20. The app will display in the list below after you create it.
|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
### Step 5: Access WordPress through a 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**.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Select `NodePort` for **Access Method** and click **OK**.
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ In **Workloads**, check the status of `wordpress-v1` and `mysql-v1` in **Deploym
|
|||
|
||||
3. Click the Service and you can see the port is exposed.
|
||||
|
||||

|
||||

|
||||
|
||||
4. Access this application at `{Node IP}:{NodePort}` and you can see an image as below:
|
||||
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 148 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 277 KiB |
|
After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 159 KiB |
|
After Width: | Height: | Size: 264 KiB |
|
After Width: | Height: | Size: 217 KiB |
|
After Width: | Height: | Size: 172 KiB |
|
After Width: | Height: | Size: 219 KiB |
|
After Width: | Height: | Size: 281 KiB |
|
After Width: | Height: | Size: 213 KiB |
|
After Width: | Height: | Size: 214 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 158 KiB |
|
After Width: | Height: | Size: 151 KiB |
|
After Width: | Height: | Size: 244 KiB |
|
After Width: | Height: | Size: 169 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 285 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 220 KiB |
|
After Width: | Height: | Size: 248 KiB |
|
After Width: | Height: | Size: 241 KiB |