这是我目前的情况。我现在有一个独立的 OKD 集群正在运行。
[jay@okd-master-oel:~ ]$ oc cluster status
Web console URL: https://10.176.5.2.nip.io:8443/console/
Config is at host directory
Volumes are at host directory
Persistent volumes are at host directory /home/jay/openshift.local.clusterup/openshift.local.pv
Data will be discarded when cluster is destroyed
[jay@okd-master-oel:~ ]$ oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://127.0.0.1:8443
kubernetes v1.11.0+d4cacc0
[jay@okd-master-oel:~ ]$ docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-103.git7f2769b.el7.centos.x86_64
Go version: go1.10.3
Git commit: 7f2769b/1.13.1
Built: Sun Sep 15 14:06:47 2019
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-103.git7f2769b.el7.centos.x86_64
Go version: go1.10.3
Git commit: 7f2769b/1.13.1
Built: Sun Sep 15 14:06:47 2019
OS/Arch: linux/amd64
Experimental: false
[jay@okd-master-oel:~ ]$ ansible --version
ansible 2.6.5
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/jay/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
我跟着 doc 和 git clone https://github.com/openshift/openshift-ansible.git和 cd openshift-ansible 和 git checkout release-3.11
我通过了 ansible-playbook 的先决条件.yml 就好了;但是当我尝试运行“ ansible-playbook deploy_cluster.yml ”时,似乎希望将 origin-node 安装在主节点上。请检查 ansible-playbook deploy-cluster.yml -vvv 中的详细错误:
任务 [openshift_node_group : 更新 sysconfig 到组“node-config-master”] ************************************ ****************************************************** ****************************************************** ******************************
task path: /home/jay/new_playbooks/openshift-ansible/roles/openshift_node_group/tasks/bootstrap_config.yml:12
<okd-master-oel> ESTABLISH SSH CONNECTION FOR USER: jay
<okd-master-oel> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jay -o ConnectTimeout=10 -o ControlPath=/home/jay/.ansible/cp/8ba586f32f okd-master-oel '/bin/sh -c '"'"'echo ~jay && sleep 0'"'"''
<okd-master-oel> (0, '/home/jay\n', '')
<okd-master-oel> ESTABLISH SSH CONNECTION FOR USER: jay
<okd-master-oel> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jay -o ConnectTimeout=10 -o ControlPath=/home/jay/.ansible/cp/8ba586f32f okd-master-oel '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860 `" && echo ansible-tmp-1576750542.05-272544100349860="` echo /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860 `" ) && sleep 0'"'"''
<okd-master-oel> (0, 'ansible-tmp-1576750542.05-272544100349860=/home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860\n', '')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/files/lineinfile.py
<okd-master-oel> PUT /home/jay/.ansible/tmp/ansible-local-113140c5lfJr/tmpIR985a TO /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860/lineinfile.py
<okd-master-oel> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jay -o ConnectTimeout=10 -o ControlPath=/home/jay/.ansible/cp/8ba586f32f '[okd-master-oel]'
<okd-master-oel> (0, 'sftp> put /home/jay/.ansible/tmp/ansible-local-113140c5lfJr/tmpIR985a /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860/lineinfile.py\n', '')
<okd-master-oel> ESTABLISH SSH CONNECTION FOR USER: jay
<okd-master-oel> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jay -o ConnectTimeout=10 -o ControlPath=/home/jay/.ansible/cp/8ba586f32f okd-master-oel '/bin/sh -c '"'"'chmod u+x /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860/ /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860/lineinfile.py && sleep 0'"'"''
<okd-master-oel> (0, '', '')
<okd-master-oel> ESTABLISH SSH CONNECTION FOR USER: jay
<okd-master-oel> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jay -o ConnectTimeout=10 -o ControlPath=/home/jay/.ansible/cp/8ba586f32f -tt okd-master-oel '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ycuntzeethnrnvfamqnsasscycnnazwz; /usr/bin/python /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860/lineinfile.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
<okd-master-oel> (1, '\r\n\r\n{"msg": "Destination /etc/sysconfig/origin-node does not exist !", "failed": true, "rc": 257, "invocation": {"module_args": {"directory_mode": null, "force": null, "remote_src": null, "backrefs": false, "insertafter": null, "path": "/etc/sysconfig/origin-node", "owner": null, "follow": false, "line": "BOOTSTRAP_CONFIG_NAME=node-config-master", "group": null, "insertbefore": null, "unsafe_writes": null, "create": false, "state": "present", "content": null, "serole": null, "setype": null, "dest": "/etc/sysconfig/origin-node", "selevel": null, "regexp": "^BOOTSTRAP_CONFIG_NAME=.*", "validate": null, "src": null, "seuser": null, "delimiter": null, "mode": null, "firstmatch": false, "attributes": null, "backup": false}}}\r\n', 'Shared connection to okd-master-oel closed.\r\n')
<okd-master-oel> ESTABLISH SSH CONNECTION FOR USER: jay
<okd-master-oel> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jay -o ConnectTimeout=10 -o ControlPath=/home/jay/.ansible/cp/8ba586f32f okd-master`enter code here`-oel '/bin/sh -c '"'"'rm -f -r /home/jay/.ansible/tmp/ansible-tmp-1576750542.05-272544100349860/ > /dev/null 2>&1 && sleep 0'"'"''
<okd-master-oel> (0, '', '')
fatal: [okd-master-oel]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"attributes": null,
"backrefs": false,
"backup": false,
"content": null,
"create": false,
"delimiter": null,
"dest": "/etc/sysconfig/origin-node",
"directory_mode": null,
"firstmatch": false,
"follow": false,
"force": null,
"group": null,
"insertafter": null,
"insertbefore": null,
"line": "BOOTSTRAP_CONFIG_NAME=node-config-master",
"mode": null,
"owner": null,
"path": "/etc/sysconfig/origin-node",
"regexp": "^BOOTSTRAP_CONFIG_NAME=.*",
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": null,
"state": "present",
"unsafe_writes": null,
"validate": null
}
},
"msg": "Destination /etc/sysconfig/origin-node does not exist !",
"rc": 257
}
我尝试手动创建此文件,但一个错误导致另一个错误。仍然需要获取原始节点服务才能正确安装。
下面是我的清单文件 - /etc/ansible/hosts(我完全按照文档中的说明进行操作):
[OSEv3:children]
masters
etcd
nodes
new_nodes
[OSEv3:vars]
ansible_ssh_user=jay
ansible_become=true
openshift_deployment_type=origin
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]
[masters]
okd-master-oel
[etcd]
okd-master-oel
[nodes]
okd-master-oel openshift_node_group_name='node-config-master'
# add definition for new node (add Infra node feature on this example below)
[new_nodes]
okd-centos-2 openshift_node_group_name='node-config-infra'
你能提供建议吗?