安装 nfs 服务
mkdir /data -m 777 vi /etc/exports
/data *(rw,insecure,no_root_squash)
service nfs restart
安装 k3s 服务
curl -sfL https://get.k3s.io | sh -s - --kube-apiserver-arg "feature-gates=RemoveSelfLink=false"
如果实现已经安装过,需要手动修改启动文件
ExecStart=/usr/local/bin/k3s \ server \ '--kube-apiserver-arg' \ 'feature-gates=RemoveSelfLink=false' \
安装 helm
https://github.com/helm/helm/releases
curl -O https://get.helm.sh/helm-v3.8.0-linux-amd64.tar.gz tar zxvf helm-v3.8.0-linux-amd64.tar.gz mv linux-amd64/helm /usr/local/bin/ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
安装 nfs-client-provisioner
helm repo add moikot https://moikot.github.io/helm-charts helm -n kube-system install nfs-client-provisioner moikot/nfs-client-provisioner --version 1.3.0 --set nfs.server=192.168.57.11 --set nfs.path=/data
效果测试
helm repo add bitnami https://charts.bitnami.com/bitnami helm install redis bitnami/redis --set global.storageClass=nfs-client