k8s部署nginx使用nfs挂载路径以及configmap加载nginx.conf

相关yaml和配置文件已上传github,参考链接 https://github.com/fengshunli/k8s-related/tree/master/nginx

安装nfs参考链接 https://blog.51cto.com/passed/2160149?source=dra

使用nfs作为动态storageClass存储参考链接 https://www.iyunw.cn/archives/kubernetes-shi-yong-nfs-zuo-wei-dong-tai-storageclass-cun-chu/

创建namespace
kubectl create namespace fsl
删除namespace
kubectl delete namespace fsl
创建configmap
kubectl create configmap nginxconfig --from-file /nfs/data/nginx/nginx.conf -n fsl
查看cm
kubectl describe cm nginxconfig -n fsl
删除cm
kubectl delete configmap nginxconfig -n fsl

运行yaml
持久卷方式: kubectl apply -f ng-deployment.yaml
查看: kubectl get pv -n fsl
删除: kubectl delete -f ng-deployment.yaml
sc方式 : kubectl apply -f ng-deployment-sc.yaml
查看: kubectl get sc -n fsl
删除: kubectl delete -f ng-deployment-sc.yaml

你可能感兴趣的:(k8s部署nginx使用nfs挂载路径以及configmap加载nginx.conf)