一.配置
[OSEv3:children]
masters
nodes
etcd
[OSEv3:vars]
ansible_ssh_user=root
# Ifansible_ssh_user is not root, ansible_become must be set to true
#ansible_become=true
openshift_deployment_type=openshift-enterprise
openshift_master_identity_providers=[{'name':'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind':'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}] #外部认证方式选择htpassd
openshift_disable_check=memory_availability,disk_availability,docker_image_availability,package_availability,docker_storage
openshift_docker_options="--selinux-enabled--insecure-registry 172.30.0.0/16 --log-driver json-file --log-opt max-size=10M--log-opt max-file=3 --insecure-registry harborone.ultraapp.com --add-registryharborone.ultraapp.com"
openshift_master_default_subdomain=apps.develop.com
openshift_hosted_router_selector='infra=true'
openshift_hosted_registry_selector='infra=true'
openshift_release=3.7.9
oreg_url=harborone.ultraapp.com/openshift3/ose-${component}:${version}
[masters]
master.develop.com
[etcd]
master.develop.com
[nodes]
master.develop.com
node1.develop.comopenshift_node_labels="{'region': 'primary', 'zone':'node1','infra':'true'}"
node2.develop.comopenshift_node_labels="{'region': 'primary', 'zone': 'node2'}"
二.命令
ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/byo/config.yml
三.基于rpm安装包的高级安装部署openshift报错总结
1. 无法解析域名;错误的ip地址。有明显的报错指示
2. ssh问题(报错也有明显的提示):安装过程中远程node失败,ssh-keygen;ssh-copy-idmaster/node的IP
注意:本主机与本主机也必须互信,自己ssh远程自己也不能出现“yes/no”,否则也会报错。
3.Master服务器没有启动(待解,嘻嘻)。
Jan 02 12:57:14master.develop.com dockerd-current[1408]: time="2018-01-02T12:57:14....
Jan 02 12:58:23master.develop.com oci-register-machine[93545]: 2018/01/02 12:58:23 ...
Jan 02 12:58:23master.develop.com oci-umount[93552]: umounthook
Jan 02 12:58:24master.develop.com oci-register-machine[93583]: 2018/01/02 12:58:24 ...
Jan 02 13:03:39master.develop.com oci-register-machine[94207]: 2018/01/02 13:03:39 ...
Jan 02 13:03:39master.develop.com oci-register-machine[94233]: 2018/01/02 13:03:39 ...
Jan 02 15:25:50master.develop.com oci-register-machine[94808]: 2018/01/02 15:25:50 ...
Jan 02 15:25:50master.develop.com oci-umount[94814]: umounthook
Jan 02 15:25:50master.develop.com oci-umount[94814]: umounthook
Jan 02 15:25:50master.develop.com oci-register-machine[94833]: 2018/01/02 15:25:50 ...
Hint: Some lineswere ellipsized, use -l to show in full.
2.catalog installfailed
TASK[ansible_service_broker : create ansible-service-broker service]*****************
fatal: [master.develop.com]: FAILED! =>{"changed": false, "failed": true, "msg":{"cmd": "/usr/bin/oc replace -f /tmp/asb-OVCnHW -nopenshift-ansible-service-broker", "results": {},"returncode": 1, "stderr": "The Service\"asb\" is invalid: spec.clusterIP: Invalid value: \"\":field is immutable\n", "stdout": ""}}
toretry, use: --limit @/usr/share/ansible/openshift-ansible/playbooks/byo/config.retry
PLAY RECAP****************************************************************************
localhost : ok=12 changed=0 unreachable=0 failed=0
master.develop.com : ok=567 changed=83 unreachable=0 failed=1
node1.develop.com : ok=184 changed=27 unreachable=0 failed=0
node2.develop.com : ok=172 changed=14 unreachable=0 failed=0
INSTALLER STATUS **********************************************************************
Initialization : Complete
Health Check : Complete
etcd Install : Complete
MasterInstall : Complete
Master AdditionalInstall : Complete
Node Install : Complete
HostedInstall : Complete
Service Catalog Install : In Progress
a. 可能是因为安装了atomic,导致catalog 安装失败。卸载atomic,重新安装,或者快照处理还原环境。或者重新设置maser。
b. 因为重复安装的问题,catalog.Server无法覆盖原有的文件。
4.node节点没有启动docker,导致安装错误,oc get pod无法获取node节点。
方案:启动节点的docker,发现无法自动获取node,重新安装。