Kubernetes——自動擴充容器!假設你突然需要增加你的應用;你只需要告訴deployment一個新的 pod 副本總數即可

來源:互聯網
上載者:User

標籤:瀏覽器   alt   .com   start   tar   class   png   pre   desire   

參考:http://kubernetes.kansea.com/docs/hellonode/

 

現在你應該可以通過這個地址來訪問這個service: http://EXTERNAL_IP:8080 或者運行 curl http://EXTERNAL_IP:8080

如果通過瀏覽器或者 CURL 來訪問新的 web 服務, 你應該可以看到一些作業記錄:

kubectl logs <POD-NAME>

Kubernetes 的強大功能之一就是他可以很容易的擴容你的應用程式。假設你突然需要增加你的應用;你只需要告訴deployment一個新的 pod 副本總數即可:

kubectl scale deployment hello-node --replicas=4

現在你有4個應用副本了, 每個都在群集上獨立運行,並能負載平衡他們之間的流量。

kubectl get deploymentNAME         DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGEhello-node   4         4         4            3           40m
kubectl get podsNAME                         READY     STATUS    RESTARTS   AGEhello-node-714049816-g4azy   1/1       Running   0          1mhello-node-714049816-rk0u6   1/1       Running   0          1mhello-node-714049816-sh812   1/1       Running   0          1mhello-node-714049816-ztzrb   1/1       Running   0          41m

Kubernetes——自動擴充容器!假設你突然需要增加你的應用;你只需要告訴deployment一個新的 pod 副本總數即可

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.