当前位置: 首页 > Web前端 > HTML

使用Kubernetes快速启用静态页面

时间:2023-04-02 21:08:52 HTML

使用Kubernetes快速开启一个静态页面,将html静态页面放在nfs目录下,在Deployment启动时挂到nginx页面目录下查看yaml内容root@hello:~#catcby.yamlapiVersion:apps/v1kind:deploymentMetadata:名称:Chenbyspec:副本:3选择器:MatchLabels:App:Chenby模板:元数据:元数据:标签:App:App:ChenbySpec:ChandersSpec:-名称:ChenbyImage:nginxResources:limits:limits:limits:memory:memory:morement:moremen“端口:-容器端口:80卷挂载:-名称:CBY-NFS安装路径:/USR/Share/Nginx/HTML/VOLUMES:-名称:CBY-NFSNFS:服务器:192.168.1.123路径:/CBY-3/NFS/HTML----------apiVersion:v1kind:Servicemetadata:name:chenbyspec:type:NodePortselector:app:chenbyports:-port:80targetPort:80检查验证root@hello:~#kubectlgetdeployments.appschenby-owideNAMEUP-READYAVAILABLEAGECONTAINERS图像SELECTORchenby3/3334m44schenbynginxapp=chenbyroot@hello:~#root@hello:~#kubectlgetpod-owide|grep?chenbychenby-77b57649c7-qv2ps??????????????????1/1?????Running???0??????????5m2s???172.17.125.19????k8s-node01????????????????chenby-77b57649c7-rx98c??????????????????1/1?????Running???0??????????5m2s???172.25.214.207???k8s-node03????????????????chenby-77b57649c7-tx2dz1/1正在运行005m2s172.25.244.209k8s-master01root@hello:~#kubectlgetsvc|-owidegrepchenbychenbyNodePort10.109.222.080:30971/TCP5m8sapp=chenbyroot@hello:~#表演在线体验:https://www.oiox.cn/https://www.chenby/.cn//blog.oiox.cn/https://www.oiox.cn/https://www.chenby.cn/https://blog.oiox.cn/https://cby-chen.github.io/https://blog.csdn.net/qq_3392...https://my.oschina.net/u/3981543https://www.zhihu.com/people/…https://segmentfault.com/u/hp…https://juejin.cn/user/331578...https://cloud.tencent.com/dev...https://www.jianshu.com/u/0f8...https://www.toutiao.com/c/use...CSDN,GitHub。