Helm 的简单使用 wordpress install

概述

尝试使用Helm部署wordpress博客服务

Helm | Helm

Helm命令

bash自动补全

Helm | Helm补全 - bash

wordpress案例

install

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

helm install wordpress bitnami/wordpress \
--namespace=wordpress \
--create-namespace \
--set global.storageClass=nfs-client \
--set wordpressUsername=admin \
--set wordpressPassword=password \
--set replicaCount=2 \
--set service.type=NodePort \
--set service.nodePorts.http=30808 \
--set persistence.enabled=true \
--set persistence.size=10Gi \
--set volumePermissions.enabled=true \
--set mariadb.enabled=true \
--set mariadb.architecture=standalone \
--set mariadb.auth.rootPassword=password \
--set mariadb.auth.password=password \
--set mariadb.primary.persistence.enabled=true \
--set mariadb.primary.persistence.size=8Gi \
--set memcached.enabled=true \
--set wordpressConfigureCache=true



NAME: wordpress
LAST DEPLOYED: Sat Sep 23 22:01:43 2023
NAMESPACE: wordpress
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: wordpress
CHART VERSION: 17.1.10
APP VERSION: 6.3.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:

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

   export NODE_PORT=$(kubectl get --namespace wordpress -o jsonpath="{.spec.ports[0].nodePort}" services wordpress)
   export NODE_IP=$(kubectl get nodes --namespace wordpress -o jsonpath="{.items[0].status.addresses[0].address}")
   echo "WordPress URL: http://$NODE_IP:$NODE_PORT/"
   echo "WordPress Admin URL: http://$NODE_IP:$NODE_PORT/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: admin
  echo Password: $(kubectl get secret --namespace wordpress wordpress -o jsonpath="{.data.wordpress-password}" | base64 -d)

 登录后端mariadb数据库

部署成功后端:

网页验证(非网页管理员访问):User's Blog!icon-default.png?t=N7T8http://192.168.164.14:30808/

登录页面:

NODE_PORT=$(kubectl get --namespace wordpress -o jsonpath="{.spec.ports[0].nodePort}" services wordpress)
NODE_IP=$(kubectl get nodes --namespace wordpress -o jsonpath="{.items[0].status.addresses[0].address}")


echo "WordPress URL: http://$NODE_IP:$NODE_PORT/"
#WordPress URL: http://192.168.164.14:30808/


echo "WordPress Admin URL: http://$NODE_IP:$NODE_PORT/admin"
#WordPress Admin URL: http://192.168.164.14:30808/admin

网站管理员访问: http://192.168.164.14:30808/admin

修改中文:

uninstall

 helm uninstall wordpress -n wordpress

查看名称空间并强制删除对应资源才能算删除干净

kubectl delete ns wordpress --force

查看nfs服务器内的文件内容

参考文档

Helm | 使用Helm

kubernetes部署nfs-subdir-external-provisioner_willops的博客-CSDN博客

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用Helm部署WordPress,你可以按照以下步骤进行操作: 1. 首先,确保已经安装了Helm。你可以通过运行以下命令来验证Helm的安装情况: ``` helm version ``` 确保能够正确显示Helm的版本信息。 2. 下载WordPress的Helm chart。你可以使用以下命令来下载: ``` helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update ``` 3. 创建一个命名空间来部署WordPress: ``` kubectl create namespace wordpress ``` 4. 使用以下命令部署WordPress: ``` helm install wordpress bitnami/wordpress --namespace wordpress --set mariadb.master.persistence.enabled=true --set mariadb.master.persistence.storageClass=nfs-client --set persistence.storageClass=nfs-client ``` 在上述命令中,我们指定了命名空间为`wordpress`,并且启用了持久化存储,并设置了存储类型为`nfs-client`。你可以根据自己的需求进行调整。 5. 等待部署完成后,你可以使用以下命令获取WordPress的访问地址: ``` kubectl get svc -n wordpress ``` 在输出结果中,你将看到WordPress的服务IP和端口号。你可以使用该地址在浏览器中访问WordPress。 通过以上步骤,你可以使用Helm轻松地部署WordPress应用。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [helm部署Wordpress](https://blog.csdn.net/weixin_43616190/article/details/126380008)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [基于 Helm 快速部署 Wordpress](https://blog.csdn.net/weixin_47371144/article/details/121743554)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值