Skip to main content

3 posts tagged with "AWS"

View All Tags

AWS Instance Identity Documents

· 3 min read
Ivan Tsai
Backend engineer

Instance Metadata Service

Instance metadata is the information provided by AWS about your EC2 instances, including details like Host Name, Public IP, and more. This information can be accessed through the Metadata Service available at 169.254.169.254. This address is a link-local address that can only be accessed from within the EC2 instance. For example, you can retrieve the current Public IP using the following API:

curl http://169.254.169.254/latest/meta-data/public-ipv4

Kubernetes cluster autoscaler 介紹

· 13 min read
Ivan Tsai
Backend engineer

甚麼是 Cluster Autoscaler (CA)

Cluster Autoscaler (以下簡稱 CA) 是 Kubernetes 官方出的一個工具,讓你的 Cluster 依照需求伸縮,簡單來說就是幫你開/關雲端上的機器。通常會配合上 Horizontal Pod Autoscaler (以下簡稱 HPA) 一起使用,當 Pod 記憶體/CPU 或其他指標達到一定標準後,擴展 Pod,當沒有足夠的機器 (Node) 來執行 Pod 時,CA 就會幫你擴展機器。相反的需求下降時,HPA 降低 Pod 數量,CA 也會關閉不需要的機器,如此一來就可以節省成本又可以達到同樣的運算能力。