在實體機上跑 K8s 的記錄

Hacker News 上翻到「Bare-Metal Kubernetes, Part I: Talos on Hetzner (datavirke.dk)」,看起來作者試著記錄下實體機器上跑 K8s 的各種事情,系列文章的第一篇在「Bare-metal Kubernetes, Part I: Talos on Hetzner」這邊。

跟朋友聊天的時候會聊到 K8s 就是個 mini AWS,裡面包括了雲端基本該有的 building blocks,對於有自己地端機房的人可以用純軟體的方式把這些東西組出來,不用去買特殊的硬體設備來架設 (像是 F5 的 load balancer)。

另外一種用 K8s 的情境是需要真正的跨環境 (像是 container 可以自由的切來切去),像是地端與雲端的整合,或是雙雲端系統的整合。

但畢竟是自己架設一套 mini AWS,複雜度當然就不是一般架設服務可以比擬的。作者用了八篇把各個角落都帶過一次,還寫了一篇炸掉的處理:「Bare-metal Kubernetes: First Incident」。

一般的情況下應該是不需要用到這個東西,但記錄一下。

Amazon EC2 有 Mac (M1) 機種可以租用了

2020 年年底的時候 AWS 推出用 Mac mini 配合搭建出 Mac (Intel) 機種:「Amazon EC2 推出 Mac Instance」,當初有計畫在 2021 年推出 M1 的版本:

Apple M1 Chip – EC2 Mac instances with the Apple M1 chip are already in the works, and planned for 2021.

不過就沒什麼意外的 delay 了,這次則是推出了 M1 的版本:「New – Amazon EC2 M1 Mac Instances」。

依照說明看起來還是 Mac mini,掛上 AWS Nitro System

EC2 Mac instances are dedicated Mac mini computers attached through Thunderbolt to the AWS Nitro System, which lets the Mac mini appear and behave like another EC2 instance.

然後跟 Intel 版本一樣,因為是掛進 Dedicated Hosts 的計價方式,雖然是以秒計費,但還是設定最低 24 小時的租用時間限制:

Amazon EC2 Mac instances are available as Dedicated Hosts through both On Demand and Savings Plans pricing models. The Dedicated Host is the unit of billing for EC2 Mac instances. Billing is per second, with a 24-hour minimum allocation period for the Dedicated Host to comply with the Apple macOS Software License Agreement. At the end of the 24-hour minimum allocation period, the host can be released at any time with no further commitment.

Intel 版本代號是 mac1,只有一種機種 mac1.metal,M1 版本代號是 mac2,也只有一種機種 mac2.metal

以最經典的美東一區 us-east-1 來看,mac1.metal 的 on-demand 價錢是 US$1.083/hour,mac2.metal 則是 US$0.65/hour,差不多是 60% 的價錢,便宜不少,大概是反應在硬體攤提與電費成本上了。

另外目前大家用 M1 的經驗來看,Rostta 2 未必會比原生的機器慢多少,雖然 mac1.metal 是 12 cores,mac2.metal 是 8 core,但以雲上面一定要用 Mac 跑的應用來說,馬上想的到的還是綁在 Apple 環境裡 CI 類的應用?

目前看起來主要的問題還是 24 小時的最小計費單位讓彈性低不少...

EC2 的 ARM 也支援 bare metal 版本了...

AWSARM 平台的採用速度比想像中快,昨天發表了 bare metal 版本 a1.metal:「Now Available: Bare Metal Arm-Based EC2 Instances」。

相較於 x86 系列提供的 bare metal,ARM 這邊提供的機器不算大台,只有 16 核心與 32 GB 的記憶體,所以主要的用途應該是在於可以存取系統底層的資訊,或是因為軟體的授權不支援虛擬化而需要租用 bare metal:

  • need access to physical resources and low-level hardware features, such as performance counters, that are not always available or fully supported in virtualized environments,
  • are intended to run directly on the hardware, or licensed and supported for use in non-virtualized environments.

這次的 a1.metal 共八區可以用:

You can start using a1.metal instances today in US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland), Europe (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Mumbai), and Asia Pacific (Sydney).

EC2 的 C5 系列機器推出 12x、24x 以及 metal 類別

EC2c5 系列主機推出了 12xlarge24xlarge 以及 metal 三種新的類別:「Now Available: New C5 instance sizes and bare metal instances」。

本來的 c5largexlarge2xlarge4xlarge9xlarge (這邊有一些不規則了),現在多了 12xlarge24xlarge,應該是大到需要依照硬體規格對齊數字了?

另外一個是,c5.24xlargec5.metal 其實是一樣的硬體規格 (以及價錢),主要的差異在 c5.metal 沒有虛擬化,所以除了壓榨效能以外,還可以看到很多硬體資訊:

  • do not want to take the performance hit of nested virtualization,
  • need access to physical resources and low-level hardware features, such as performance counters and Intel VT that are not always available or fully supported in virtualized environments,
  • are intended to run directly on the hardware, or licensed and supported for use in non-virtualized environments.

AWS 推出新的 Bare Metal Instances

AWS 針對各個 family type 都推出 Bare Metal 版本:「Now Available – Five New Amazon EC2 Bare Metal Instances: M5, M5d, R5, R5d, and z1d」。

AWS 第一次推出 Bare Metal 版本是在 2017 年年末推出的 i3.metal:「Amazon EC2 推出第一款 Bare Metal 的 Instance」,這樣算一算也一年多了,這次算是補產品線...

要注意的是,這次推出依照區域有不同的機種,像是 Ohio 沒有 z1d.metal 但有其他四種,N. California 則是沒有 m5d.metal 但有其他四種... 要先看一下表格才能確認每一區的情況 @_@

Vultr 也推出 Bare Metal 的機器了

AWS 推出 Bare Metal 版本的 Instance 後 (參考「Amazon EC2 推出第一款 Bare Metal 的 Instance」),Vultr 也推出 Bare Metal 機器了:「Deploy Bare Metal Cloud Servers With Vultr!」。

目前先在新加坡推出,之後會再往其他地區推出 :

We are first introducing bare metal in Singapore and more locations will be rolled out in the coming weeks.

在「Vultr Bare Metal - Dedicated servers with hourly billing. - Vultr.com」頁可以看到目前只提供一種機器,E3-1270v6 + 32GB RAM + 2*240GB SSD,一個月 USD$300 ($0.446/hr)。

對照 AWS 提供的 E5-2686v4 + 512GB RAM + 15.2TB SSD,Vultr 的這個規格很微妙... 會有 bare metal 需求通常是因為效能上的不足,但你給的這個規格感覺就鳥鳥的,對效能的幫助好像不大啊...

Amazon EC2 推出第一款 Bare Metal 的 Instance

Amazon EC2 直接租整台主機出來了:「Amazon EC2 Bare Metal Instances with Direct Access to Hardware」。

Bare Metal 怎麼翻譯比較好啊?雖然知道是拔掉虛擬化的主機... 裸奔機?

We knew that other customers also had interesting use cases for bare metal hardware and didn’t want to take the performance hit of nested virtualization. They wanted access to the physical resources for applications that take advantage of low-level hardware features such as performance counters and Intel® VT that are not always available or fully supported in virtualized environments, and also for applications intended to run directly on the hardware or licensed and supported for use in non-virtualized environments.

反正這種機器就是要壓榨整台機器的效能,所以不會拿小台機器出來給大家玩。這次推出的是 i3 系列,叫做 i3.metal

Today we are launching a public preview the i3.metal instance, the first in a series of EC2 instances that offer the best of both worlds, allowing the operating system to run directly on the underlying hardware while still providing access to all of the benefits of the cloud. The instance gives you direct access to the processor and other hardware, and has the following specifications:

Processing – Two Intel Xeon E5-2686 v4 processors running at 2.3 GHz, with a total of 36 hyperthreaded cores (72 logical processors).
Memory – 512 GiB.
Storage – 15.2 terabytes of local, SSD-based NVMe storage.
Network – 25 Gbps of ENA-based enhanced networking.

走了十年總算走到這塊了... 不過應該花了不少時間解決各種安全性的問題,像是 network isolation 以及反刷韌體的問題 XD