1. k3s安装
time curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -s - --system-default-registry=registry.cn-hangzhou.aliyuncs.com
1.1 traefik面板暴露
通过定义和应用 IngressRoute CRD (kubectl apply -f dashboard.yaml):
# dashboard.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
spec:
entryPoints:
- web
routes:
- match: Host(`traefik.example`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
kind: Rule
services:
- name: api@internal
kind: TraefikService
2. helm安装
# helm的GitHub地址
https://github.com/helm/helm
#下载helm
wget https://get.helm.sh/helm-v3.16.1-linux-amd64.tar.gz
tar xf helm-v2.16.9-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
3. 安装wordpress
# 添加bitnami仓库
helm repo add bitnami https://charts.bitnami.com/bitnami
# 下载wordprdss chart
helm install pull bitnami/wordpress
tar xf wordpress-23.1.16.tgz
#修改配置
vim wordpress/values.yaml
#安装wordpress
kubectl create namespace wordpress
helm install -n wordpress wordpress .