CentOS 7.4
我使用 Ansible 安装 OpenShift,我必须使用 HTTP_PROXY。
我有这样一个问题: "stderr": "与服务器 master.ctwifi.cn:8443 的连接被拒绝 - 你指定了正确的主机或端口吗?\n",
并且master主机上没有8443端口。master 主机上运行的容器数量只有 5 个。我认为kubernetes master没有启动,但我不知道为什么。
但是我在公有云上使用相同的配置安装除了代理配置之外,没有任何问题。所以我认为这个问题与我的代理配置有关。但我没有找到解决办法。
ansible-playbook ~/openshift-ansible/playbooks/prerequisites.yml -vvv 没问题
问题
ansible-playbook ~/openshift-ansible/playbooks/deploy_cluster.yml -vvv
FAILED - RETRYING: Wait for control plane pods to appear (57 retries left).Result was: {
"attempts": 4,
"changed": false,
"invocation": {
"module_args": {
"all_namespaces": null,
"content": null,
"debug": false,
"delete_after": false,
"field_selector": null,
"files": null,
"force": false,
"kind": "pod",
"kubeconfig": "/etc/origin/master/admin.kubeconfig",
"name": "master-etcd-master.ctwifi.cn",
"namespace": "kube-system",
"selector": null,
"state": "list"
}
},
"msg": {
"cmd": "/usr/bin/oc get pod master-etcd-master.ctwifi.cn -o json -n kube-system",
"results": [
{}
],
"returncode": 1,
**"stderr": "The connection to the server master.ctwifi.cn:8443 was refused - did you specify the right host or port?\n",**
"stdout": ""
},
"retries": 61
```
版本
ansible 2.6.4
#git describe
openshift-ansible-3.10.51-1-16-g1a911c5
#rpm -q openshift-ansible
openshift-ansible-3.10.51-1.git.0.44a646c.el7.noarch
我的hosts文件(各主机间通讯没问题):
10.199.27.49 master.ctwifi.cn
10.199.27.48 node01.ctwifi.cn
10.199.27.46 node02.ctwifi.cn
10.199.27.28 infra-node1.ctwifi.cn
我的 /etc/sysconfig/docker 文件:
HTTP_PROXY='http://'username:password'@proxy.ctwifi.cn:8080'
HTTPS_PROXY='http://'username:password'@proxy.ctwifi.cn:8080' NO_PROXY=10.199.27.49,10.199.27.46,10.199.27.48,10.199.27.28,master.ctwifi.com,node01.ctwifi.cn,node02.ctwifi.cn,infra-node1.ctwifi.cn,.cluster.local,.svc,localhost,127.0.0.1,172.30.0.1
export HTTP_PROXY HTTPS_PROXY NO_PROXY
OPTIONS=' --selinux-enabled --signature-verification=False'
if [ -z "${DOCKER_CERT_PATH}" ]; then
DOCKER_CERT_PATH=/etc/docker
fi
- 我的操作系统和版本:CentOS 7.4
我的库存文件
#Create an OSEv3 group that contains the masters and nodes groups
[OSEv3:children]
masters
nodes
etcd
#Set variables common for all OSEv3 hosts
[OSEv3:vars]
#SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root
#If ansible_ssh_user is not root, ansible_become must be set to true
#ansible_become=true
openshift_deployment_type=origin
#uncomment the following to enable htpasswd authentication; defaults to AllowAllPasswordIdentityProvider
#openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]
#openshift_release=3.10
openshift_disable_check=memory_availability,docker_image_availability,package_availability,package_version
#host group for masters
[masters]
master.ctwifi.cn
#host group for etcd
[etcd]
master.ctwifi.cn
#host group for nodes, includes region info
[nodes]
master.ctwifi.cn openshift_node_group_name='node-config-master'
#node01.ctwifi.cn openshift_node_group_name='node-config-compute'
node02.ctwifi.cn openshift_node_group_name='node-config-compute'
infra-node1.ctwifi.cn openshift_node_group_name='node-config-infra'