/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/clare/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to login with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@xxx.xxx.xxx.xxx's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@xxx.xxx.xxx.xxx'" and check to make sure that only the key(s) you wanted were added.
1 2 3 4
# 测试是否可以免密登陆
$ ssh root@$IPs
3.1 安装ansible (也可以使用容器化运行kubeasz,已经预装好ansible)
1 2 3 4 5 6 7 8 9
# 注意pip 21.0以后不再支持python2和python3.5,需要如下安装 # To install pip for Python 2.7 install it from https://bootstrap.pypa.io/2.7/ : curl -O https://bootstrap.pypa.io/2.7/get-pip.py python get-pip.py python -m pip install --upgrade "pip < 21.0"
# 下载安装包 # k 指定kubernetes的版本 $ ./ezdown -D -k v1.18.3
4.2 创建集群配置实例
1 2 3 4 5 6 7 8
ezctl new k8s-01 2021-01-19 10:48:23 DEBUG generate custom cluster files in /etc/kubeasz/clusters/k8s-01 2021-01-19 10:48:23 DEBUG set version of common plugins 2021-01-19 10:48:23 DEBUG cluster k8s-01: files successfully created. 2021-01-19 10:48:23 INFO next steps 1: to config '/etc/kubeasz/clusters/k8s-01/hosts' 2021-01-19 10:48:23 INFO next steps 2: to config '/etc/kubeasz/clusters/k8s-01/config.yml' 然后根据提示配置'/etc/kubeasz/clusters/k8s-01/hosts' 和 '/etc/kubeasz/clusters/k8s-01/config.yml': 根据前面节点规划修改hosts 文件和其他集群层面的主要配置选项;其他集群组件等配置项可以在config.yml 文件中修改。