ref. Try to prepare host for installation of OpenShift. - AKAI TSUKI
hosts file
at all node.
# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 172.16.10.111 opshift01 opshift01.example.com 172.16.10.112 opshift02 opshift02.example.com 172.16.10.113 opshift03 opshift03.example.com #
inventory file
at master node.
# cat inventory_file/hosts [OSEv3:children] masters nodes [OSEv3:vars] ansible_ssh_user=root openshift_deployment_type=origin openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}] openshift_disable_check=memory_availability openshift_master_default_subdomain=apps.example.com [masters] opshift01.example.com [nodes] opshift01.example.com openshift_node_labels="{'region': 'infra', 'zone': 'default'}" openshift_schedulable=true opshift02.example.com openshift_node_labels="{'region': 'primary', 'zone': 'west'}" opshift03.example.com openshift_node_labels="{'region': 'primary', 'zone': 'east'}" #
run ansible-playbook
# ansible-playbook -i inventory_file/hosts \ > ~/openshift-ansible/playbooks/byo/config.yml *snip* PLAY RECAP ***************************************************************************************** localhost : ok=9 changed=0 unreachable=0 failed=0 opshift01.example.com : ok=561 changed=136 unreachable=0 failed=0 opshift02.example.com : ok=232 changed=63 unreachable=0 failed=0 opshift03.example.com : ok=232 changed=63 unreachable=0 failed=0 #
after install
# oc login -u system:admin Logged into "https://opshift01:8443" as "system:admin" using existing credentials. You have access to the following projects and can switch between them with 'oc project <projectname>': * default kube-public kube-system logging management-infra openshift openshift-infra Using project "default". # # oc get node NAME STATUS AGE VERSION opshift01 Ready 12m v1.6.1+5115d708d7 opshift02 Ready 12m v1.6.1+5115d708d7 opshift03 Ready 12m v1.6.1+5115d708d7 # # oc get pods -o wide NAME READY STATUS RESTARTS AGE IP NODE docker-registry-1-g8b13 1/1 Running 0 13m 10.128.0.4 opshift01 registry-console-1-dznp7 1/1 Running 0 10m 10.128.0.5 opshift01 router-1-jqj4n 1/1 Running 0 14m 172.16.10.111 opshift01 # # oc get svc -o wide NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR docker-registry 172.30.255.65 <none> 5000/TCP 14m docker-registry=default kubernetes 172.30.0.1 <none> 443/TCP,53/UDP,53/TCP 27m <none> registry-console 172.30.181.217 <none> 9000/TCP 12m name=registry-console router 172.30.122.197 <none> 80/TCP,443/TCP,1936/TCP 16m router=router # # oc get routes NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD docker-registry docker-registry-default.apps.example.com docker-registry <all> passthrough None registry-console registry-console-default.apps.example.com registry-console <all> passthrough None #
check config file.
# grep -C1 subdomain /etc/origin/master/master-config.yaml routingConfig: subdomain: "apps.example.com" serviceAccountConfig: # # grep -A8 identityProviders /etc/origin/master/master-config.yaml identityProviders: - challenge: true login: true mappingMethod: claim name: htpasswd_auth provider: apiVersion: v1 file: /etc/origin/master/htpasswd kind: HTPasswdPasswordIdentityProvider #