我正在尝试使用 Ubuntu 16.04 OS 上的 kubespray 工具运行一个 Ansible 剧本来部署 Kubernetes 集群。我有一台安装了 Ansible 和克隆的 kubespray Git 存储库的基础机器。一个主节点和两个工作节点包含在集群中。
我的主机(更新)文件如下图所示,
[all]
MILDEVKUB020 ansible_ssh_host=MILDEVKUB020 ip=192.168.16.173 ansible_user=uName ansible_ssh_pass=pwd
MILDEVKUB030 ansible_ssh_host=MILDEVKUB030 ip=192.168.16.176 ansible_user=uName ansible_ssh_pass=pwd
MILDEVKUB040 ansible_ssh_host=MILDEVKUB040 ip=192.168.16.177 ansible_user=uName ansible_ssh_pass=pwd
[kube-master]
MILDEVKUB020
[etcd]
MILDEVKUB020
[kube-node]
MILDEVKUB020
MILDEVKUB030
MILDEVKUB040
[k8s-cluster:children]
kube-master
kube-node
hosts.ini 文件的位置是 /inventory/sample。我正在尝试以下 Ansible 命令
sudo ansible-playbook -i inventory/sample/hosts.ini cluster.yml --user=uName --extra-vars "ansible_sudo_pass=pwd"
我正在使用以下链接中的剧本“cluster.yml”
https://github.com/kubernetes-sigs/kubespray/blob/master/cluster.yml
我的 /etc/hosts 包含条目的文件,
127.0.0.1 MILDEVDCR01.Milletech.us MILDEVDCR01
192.168.16.173 MILDEVKUB020.Milletech.us MILDEVKUB020
192.168.16.176 MILDEVKUB030.Milletech.us MILDEVKUB030
192.168.16.177 MILDEVKUB040.Milletech.us MILDEVKUB040
更新错误
TASK [adduser : User | Create User Group]
Thursday 04 April 2019 11:34:55 -0400 (0:00:00.508) 0:00:33.383 ********
fatal: [MILDEVKUB040]: FAILED! => {"changed": false, "msg": "groupadd: Permission denied.\ngroupadd: cannot lock /etc/group; try again later.\n", "name": "kube-cert"}
fatal: [MILDEVKUB020]: FAILED! => {"changed": false, "msg": "groupadd: Permission denied.\ngroupadd: cannot lock /etc/group; try again later.\n", "name": "kube-cert"}
fatal: [MILDEVKUB030]: FAILED! => {"changed": false, "msg": "groupadd: Permission denied.\ngroupadd: cannot lock /etc/group; try again later.\n", "name": "kube-cert"}
即使我能够使用 ssh 从基础机器连接所有机器,我也会收到这样的错误。如何跟踪运行此命令以部署 Kubernetes 集群的问题?