想定環境

手順

マスター側のVMですべて操作

m=192.168.33.11  # IPアドレス of マスターVM
a=192.168.33.12  # IPアドレス of エージェントVM
u="https://$m:6443"  # マスターのエンドポイント

# マスター構築
sudo ufw disable
curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644 --node-ip=$m


# エージェント接続用トークン取得
t=$(sudo cat /var/lib/rancher/k3s/server/node-token | tee /dev/stderr)

# ssh経由でエージェント構築
ssh $a sh -x <<...
sudo ufw disable
curl -sfL https://get.k3s.io | K3S_URL=$u K3S_TOKEN=$t sh -s - --node-ip=$a
...

参考

さらに・・・

helm入れる(masterで実行)

#eval $(echo export KUBECONFIG=/etc/rancher/k3s/k3s.yaml | tee -a ~/.bashrc)  # これだと helm version でエラーが出る
mkdir ~/.kube 2>/dev/null; sudo cat /etc/rancher/k3s/k3s.yaml >~/.kube/config; chmod 600 ~/.kube/config
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash -x

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-09-01 (金) 11:02:18