系统要求至少centos 7.3以上
安装基础包:
# yum install wget git net-tools bind-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct
更新系统至最新包:
# yum update
配置ansible,配置文件/etc/ansible/hosts
# Create an OSEv3 group that contains the masters and nodes groups [OSEv3:children] masters nodes # 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 openshift_disable_check=docker_image_availability,docker_storage,memory_availability,disk_availability # uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider #openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}] # host group for masters [masters] master-40-228 # host group for etcd [etcd] master-40-228 # host group for nodes, includes region info [nodes] master-40-228 openshift_node_labels="{'region': 'infra', 'zone': 'default'}" node-40-230 openshift_node_labels="{'region': 'primary', 'zone': 'west'}" node-40-131 openshift_node_labels="{'region': 'primary', 'zone': 'west'}" [new_nodes] #node-51-84 openshift_node_labels="{'region': 'primary', 'zone': 'west'}" #node-51-85 openshift_node_labels="{'region': 'primary', 'zone': 'west'}" node-51-86 openshift_node_labels="{'region': 'primary', 'zone': 'west'}"
下载openshift-ansible,
执行安装命令: ansible-playbook playbook/byo/config.yaml
参考: https://docs.openshift.org/3.6/install_config/install/host_preparation.html