[HOMELAB] Talos安装指南
本站字数:108k 本文字数:740 预计阅读时长:3min 访问次数:次Talos 是一个不可变的Linux发行版,专门为K8S做了优化,国内暂时还没有系统的教程安装,这里给一个教程进行安装。
安装 Brew
国内的 Homebrew 镜像有很多,但是阿里云镜像的方便安装,可以按照下面的教程进行安装。
- 设置镜像为阿里源,并且设置环境变量
1
2
3
4
5
6# 临时替换
export HOMEBREW_INSTALL_FROM_API=1
export HOMEBREW_API_DOMAIN="https://mirrors.aliyun.com/homebrew-bottles/api"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.aliyun.com/homebrew/homebrew-bottles" - 安装 Homebrew
1
2
3
4
5
6
7# 从阿里云下载安装脚本并安装 Homebrew
git clone https://mirrors.aliyun.com/homebrew/install.git brew-install
/bin/bash brew-install/install.sh
rm -rf brew-install
# 验证是否完成安装了
brew -v - 设置homebrew安装源为阿里源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17# 永久替换
# bash 用户
echo 'export HOMEBREW_API_DOMAIN="https://mirrors.aliyun.com/homebrew-bottles/api"' >> ~/.bash_profile
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/brew.git"' >> ~/.bash_profile
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/homebrew-core.git"' >> ~/.bash_profile
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.aliyun.com/homebrew/homebrew-bottles"' >> ~/.bash_profile
source ~/.bash_profile
brew update
# zsh 用户
echo 'export HOMEBREW_API_DOMAIN="https://mirrors.aliyun.com/homebrew-bottles/api"' >> ~/.zshrc
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/brew.git"' >> ~/.zshrc
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/homebrew-core.git"' >> ~/.zshrc
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.aliyun.com/homebrew/homebrew-bottles"' >> ~/.zshrc
source ~/.zshrc
brew update - 将 Brew 添加到 PATH 中
1
2
3
4
5
6
7
8
9# 如果是 Bash 执行下面的命令
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bashrc
# 如果是 ZSH 需要执行下面的命令
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.zshrc - 卸载 brew (如果后续需要的话)
1
2
3
4# 从阿里云下载安装脚本并安装 Homebrew
git clone https://mirrors.aliyun.com/homebrew/install.git brew-install
/bin/bash brew-install/uninstall.sh
rm -rf brew-install
安装 Talos
使用 Brew 安装
1 | brew install siderolabs/tap/talosctl |
部署 Kubernetes 到 Docker
安装 kubectl
1 | sudo apt install kubectl |
在本地启动一个 K8S 集群
1 | talosctl cluster create \ |
1 | talosctl cluster create \ |
检查是否安装完成
1 | # 查看当前集群的节点信息 |