#wordpress
部署业务应用
首先,我们需要添加 WordPress 官方Repo地址:
helm3 repo add bitnami https://charts.bitnami.com/bitnami
执行 Helm Install 部署 WordPress:
helm3 install wordpress bitnami/wordpress \--set mariadb.primary.persistence.enabled=true \--set mariadb.primary.persistence.storageClass=alicloud-disk-ssd \--set mariadb.primary.persistence.size=20Gi \--set persistence.enabled=false
其中:
- 为了实现数据的持久化,mariadb 使用持久化存储卷保存数据;
- 持久化存储选用阿里云 ssd 云盘,大小为 20Gi,并通过配置 StorageClassName 自动化创建;
- WordPress 不需要进行数据持久化,数据卷选项可配置为 false
执行成功后,应该有如下返回:
NAME: wordpressLAST DEPLOYED: Wed Jan 20 15:09:45 2021NAMESPACE: handsonackSTATUS: deployedREVISION: 1NOTES:** Please be patient while the chart is being deployed **Your WordPress site can be accessed through the following DNS name from within your cluster:wordpress.handsonack.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 handsonack -w wordpress'export SERVICE_IP=$(kubectl get svc --namespace handsonack 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: userecho Password: $(kubectl get secret --namespace handsonack wordpress -o jsonpath="{.data.wordpress-password}" | base64 --decode)
也可以通过以下命令查看部署状态:
helm3 status wordpress
