iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 13
0
Software Development

Microservices in Action: with example in Node.js系列 第 13

微服務自動擴展 - 整合 Deployment 和 Service 物件

這裡我們用 labels 將 Service 物件跟 Deployment 物件綁在一起。

labels:
  app: auth-server
selector:
  app: auth-server

建立物件

kubectl apply -f auth-deployment.yaml
kubectl apply -f auth-service.yaml

設定自動擴展

當到達 requests 設定的 CPU 資源的 90% 時,則自動擴展一台 Pod,最少有 3 個 Pod 副本,最多只能有 5 個副本。

kubectl autoscale deployment auth-deployment --cpu-percent=90 --min=3 --max=5

延伸閱讀


上一篇
微服務自動擴展 - 建立 Deployment 和 Service 物件
下一篇
透過 Ingress 處理外部路由
系列文
Microservices in Action: with example in Node.js24
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言