kubectl create ns nginx-test
kubectl delete ns nginx-test
創(chuàng)建Deployment并暴露為Servicekubectl create deployment deployment-nginx --image=nginx -n nginx-test # 創(chuàng)建deployment,會(huì)自動(dòng)創(chuàng)建一個(gè)相應(yīng)的Pod
kubectl scale deployment deployment-nginx --replicas=2 -n nginx-test # 將deployment下的pod擴(kuò)容到2個(gè)
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
宿主機(jī)通過master1節(jié)點(diǎn)訪問Nginx:http://192.168.111.30:32163
宿主機(jī)通過node1節(jié)點(diǎn)訪問Nginx:http://192.168.111.33:32163
宿主機(jī)通過node2節(jié)點(diǎn)訪問Nginx:http://192.168.111.34:32163
kubectl delete deployment deployment-nginx -n nginx-test # 刪除deployment,級(jí)聯(lián)刪除其下的所有pod
刪除服務(wù)kubectl delete service service-nginx -n nginx-test
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購,新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧
新聞標(biāo)題:K8S(v1.26.0)部署Nginx應(yīng)用-創(chuàng)新互聯(lián)
當(dāng)前URL:http://jinyejixie.com/article4/djeeie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動(dòng)態(tài)網(wǎng)站、網(wǎng)站排名、網(wǎng)頁設(shè)計(jì)公司、自適應(yīng)網(wǎng)站、域名注冊(cè)、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容