CentOS 7
Sponsored Link

OpenShift Origin (OKD) 3.10 : Deploy Router2018/08/22

 
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-4rkv8    1/1       Running   1          1d
registry-console-1-62j9p   1/1       Running   1          1d
router-1-97bzn             1/1       Running   1          1d

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

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

pod "router-1-97bzn" 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

info: password for stats user admin has been set to fLgkdnujaK
--> Creating router router ...
    serviceaccount "router" created
    clusterrolebinding "router-router-role" created
    deploymentconfig "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-4rkv8    1/1       Running   1          1d
registry-console-1-62j9p   1/1       Running   1          1d
router-1-gfc99             1/1       Running   0          55s
Matched Content