CentOS 7
Sponsored Link

OpenShift Origin (OKD) 3.11 : Deploy Router2018/11/20

 
Deploy Router that is used within OpenShift Cluster.
If you installed OpenShift Origin like here, a Router Pod has already been deployed and running, but if it has not be running by some reason, configure it like follows.
This example is based on the environment like follows.
-----------+-----------------------------+-----------------------------+------------
           |10.0.0.25                    |10.0.0.51                    |10.0.0.52
+----------+-----------+      +----------+-----------+      +----------+-----------+
|  [ ctrl.srv.world ]  |      | [ node01.srv.world ] |      | [ node02.srv.world ] |
|     (Master Node)    |      |    (Compute Node)    |      |    (Compute Node)    |
|     (Infra Node)     |      |                      |      |                      |
|     (Compute Node)   |      |                      |      |                      |
+----------------------+      +----------------------+      +----------------------+

[1] Make sure the default Router which Installer has configured exists or not.
[origin@ctrl ~]$
oc adm router --dry-run --service-account=router

Router "router" service exists
[origin@ctrl ~]$
oc get pods

NAME                       READY     STATUS    RESTARTS   AGE
docker-registry-1-ttw9l    1/1       Running   1          1h
registry-console-1-zjbqb   1/1       Running   1          53m
router-1-mjch7             1/1       Running   2          15h

# if you'd like to delete default Router, do like follows

[origin@ctrl ~]$
oc delete all -l router

pod "router-1-mjch7" deleted
replicationcontroller "router-1" deleted
service "router" deleted
deploymentconfig.apps.openshift.io "router" deleted
[origin@ctrl ~]$
oc delete serviceaccounts router

serviceaccount "router" deleted
[origin@ctrl ~]$
oc delete clusterrolebindings router-router-role

clusterrolebinding.authorization.openshift.io "router-router-role" deleted
[2] On Master Node, Create and deploy Router. On this example, create a HAProxy Router Pod which is the same settings with default Router Installer configures on [node01.srv.world] Node.
[origin@ctrl ~]$
oc adm router router --selector='kubernetes.io/hostname=node01.srv.world' --replicas=1 --service-account=router

--> Creating router router ...
    serviceaccount "router" created
    clusterrolebinding.authorization.openshift.io "router-router-role" created
    deploymentconfig.apps.openshift.io "router" created
    service "router" created
--> Success

# few minutes later, deploy has finished and Pod becomes running state

[origin@ctrl ~]$
oc get pods

NAME                       READY     STATUS    RESTARTS   AGE
docker-registry-1-ttw9l    1/1       Running   1          1h
registry-console-1-zjbqb   1/1       Running   1          55m
router-1-brqp4             1/1       Running   0          30s
Matched Content