主机 | IP | 最低要求(每个节点) |
---|---|---|
master | 10.0.0.21 | CPU:2 核,内存:4 G,硬盘:40 G |
node1 | 10.0.0.22 | CPU:2 核,内存:4 G,硬盘:40 G |
node2 | 10.0.0.23 | CPU:2 核,内存:4 G,硬盘:40 G |
关闭:selinux
,firewalld
和NetworkManager
,postfix
(非必须)
修改IP地址、主机名
hostnamectl set-hostname 主机名
sed -i ‘s/200/IP/g‘ /etc/sysconfig/network-scripts/ifcfg-eth0
sshd
/sudo
/curl
/openssl
可用使用 KubeKey v1.0.1 工具安装
wget https://github.com/kubesphere/kubekey/releases/download/v1.0.1/kubekey-v1.0.1-linux-amd64.tar.gz
tar xf kubekey-v1.0.1-linux-amd64.tar.gz
./kk create config --with-kubernetes v1.18.6 --with-kubesphere v3.0.0
vim config-sample.yaml
# 实际主机名,各节点SSH连接IP,实际IP,SSH登录使用的用户和密码
hosts:
- {name: node1, address: 10.0.0.22, internalAddress: 10.0.0.22, user: root, password: 1
}
# SSH密钥登陆
- {name: master, address: 10.0.0.21, internalAddress: 10.0.0.21, privateKeyPath: "~/.ssh/id_rsa"}
# 实际主机名
roleGroups:
etcd:
- node1
master:
- node1
worker:
- node1
- node2
./kk create cluster -f config-sample.yaml
yes
整个安装过程可能需要 10 到 20 分钟,具体取决于您的计算机和网络环境。
添加nodes节点,修改配置文件,执行
./kk add nodes -f config-sample.yaml
#####################################################
### Welcome to KubeSphere! ###
#####################################################
Console: http://10.0.0.21:30880
Account: admin
Password: P@88w0rd
NOTES:
1. After logging into the console, please check the
monitoring status of service components in
the "Cluster Management". If any service is not
ready, please wait patiently until all components
are ready.
2. Please modify the default password after login.
#####################################################
https://kubesphere.io 20xx-xx-xx xx:xx:xx
#####################################################
# Install bash-completion
apt-get install bash-completion
# Source the completion script in your ~/.bashrc file
echo ‘source <(kubectl completion bash)‘ >>~/.bashrc
# Add the completion script to the /etc/bash_completion.d directory
kubectl completion bash >/etc/bash_completion.d/kubectl
原文:https://www.cnblogs.com/backups/p/k8s_5.html