kubectl create ns nginx-test
kubectl delete ns nginx-test
创建Deployment并暴露为Servicekubectl create deployment deployment-nginx --image=nginx -n nginx-test # 创建deployment,会自动创建一个相应的Pod
kubectl scale deployment deployment-nginx --replicas=2 -n nginx-test # 将deployment下的pod扩容到2个
kubectl expose deployment deployment-nginx --name=service-nginx --type=NodePort --port=80 --target-port=80 -n nginx-test # 暴露为Servie
kubectl get deployment,pod,service -n nginx-test -o wide
宿主机通过master1节点访问Nginx:http://192.168.111.30:32163
宿主机通过node1节点访问Nginx:http://192.168.111.33:32163
宿主机通过node2节点访问Nginx:http://192.168.111.34:32163
kubectl delete deployment deployment-nginx -n nginx-test # 删除deployment,级联删除其下的所有pod
删除服务kubectl delete service service-nginx -n nginx-test
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧
新闻标题:K8S(v1.26.0)部署Nginx应用-创新互联
当前URL:https://www.cdcxhl.com/article4/djeeie.html
成都网站建设公司_创新互联,为您提供动态网站、网站排名、网页设计公司、自适应网站、域名注册、Google
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联