簡介

大概在 2015,我剛上大學的時候,容器化的概念開始崛起,什麼設定都要手動來,裝 kubernetes 得撞好多 dependency。到了 2017,學會使用 cloudera、rancher 來裝 k8s cluster。而 2024 的現在,建立 kubernetes 毫無難度,一鍵就能安裝完成還不會出錯,甚至出現各種「內建 kubernetes 的作業系統」,而這篇文想使用的 Talos 就是其中一種。

Talos 是一個很有趣的作業系統,他有幾個特性

  1. Container OS:內建 kubernetes
  2. Minimal:作業系統的 ISO 檔不到 100M!除了主要作業系統、kubernetes,沒有其他多餘的工具,資源佔用低
  3. Secure:精簡的作業系統,攻擊面小
  4. Immutable OS:root filesystem 唯讀不可變,無法自行寫入和修改,保證系統完整性
  5. 一個設定檔 (declarative configuration file) 搞定一台機器
  6. 沒有 ssh 登入,全使用 gRPC API talosctl 來控制機器,就如使用 kubectl 控制 kubernetes 叢集一樣的概念

當然,特殊用途的作業系統也有些不方便的地方:

  1. 沒有像是 aptyum 的 package 管理工具。不過官方有 repo 可以安裝,如 iSCSI 驅動、qemu guest 等等
  2. 學習成本高,不是大眾熟悉的作業系統,要花時間學寫設定檔

這是一個系列文,目錄 在此。

實驗環境

示範環境是 VM,在 Proxmox 8.2、ESXi 6.7 上,作業系統為 macOS,使用 talos 1.7

節點列表

NameIPRoleHypervisor
control-e0110.2.7.11/23Control PlaneProxmox
control-e0210.2.7.12/23Control PlaneESXi
control-e0310.2.7.13/23Control PlaneProxmox
---10.2.7.15/23Control Plane (VIP)---
worker-e0110.2.7.16/23Worker NodeProxmox
worker-e0210.2.7.17/23Worker NodeESXi

機器規格

節錄:System Requirements | Talos Linux

最低需求(Minimum):

RoleMemoryCoresSystem Disk
Control Plane2 GiB210 GiB
Worker1 GiB110 GiB

建議規格(Recommended):

RoleMemoryCoresSystem Disk
Control Plane4 GiB4100 GiB
Worker2 GiB2100 GiB

安裝 talosctl

$ curl -sL https://talos.dev/install | sh
# macOS 亦可使用 homebrew 安裝
$ brew install siderolabs/tap/talosctl

安裝 kubectl

可參考 kubernetes 官方教學文


下一步,我們來撰寫安裝用設定檔: 我的 Talos 安裝紀錄 (2) - 撰寫設定檔