云容器引擎 CCE-通过Helm部署Wordpress:部署Wordpress

时间:2023-11-01 16:18:15

部署Wordpress

  1. 添加Wordpress官方Repo。

    helm repo add bitnami https://charts.bitnami.com/bitnami

  2. 执行如下命令,创建WordPress应用。

    helm install myblog bitnami/wordpress \    --set mariadb.primary.persistence.enabled=true \    --set mariadb.primary.persistence.storageClass=csi-disk \    --set mariadb.primary.persistence.size=10Gi \    --set persistence.enabled=false
    • Mariadb使用持久化存储卷保存数据。持久化存储选用云硬盘,大小为10 GiB,并通过配置StorageClassName自动化创建。
    • WordPress不需要进行数据持久化,数据卷persistence.enabled配置为false。

    命令执行后回显类似如下。

    coalesce.go:223: warning: destination for mariadb.networkPolicy.egressRules.customRules is a table. Ignoring non-table value ([])NAME: myblogLAST DEPLOYED: Mon Mar 27 11:47:58 2023NAMESPACE: defaultSTATUS: deployedREVISION: 1TEST SUITE: NoneNOTES:CHART NAME: wordpressCHART VERSION: 15.2.57APP VERSION: 6.1.1** Please be patient while the chart is being deployed **Your WordPress site can be accessed through the following DNS name from within your cluster:    myblog-wordpress.default.svc.cluster.local (port 80)To access your WordPress site from outside the cluster follow the steps below:1. Get the WordPress URL by running these commands:  NOTE: It may take a few minutes for the LoadBalancer IP to be available.        Watch the status with: 'kubectl get svc --namespace default -w myblog-wordpress'   export SERVICE_IP=$(kubectl get svc --namespace default myblog-wordpress --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")   echo "WordPress URL: http://$SERVICE_IP/"   echo "WordPress Admin URL: http://$SERVICE_IP/admin"2. Open a browser and access WordPress using the obtained URL.3. Login with the following credentials below to see your blog:  echo Username: user  echo Password: $(kubectl get secret --namespace default myblog-wordpress -o jsonpath="{.data.wordpress-password}" | base64 -d)

    回显中告诉了如何获取外部访问地址和登录WordPress后台的用户及密码。

support.huaweicloud.com/qs-cce/cce_qs_0010.html