OpenShift 3 cheatsheet

Here are a few useful commands that you may very often use on OpenShift 3.

Mark a node as non schedulable: Useful once you’ve created OpenShift router and registry to avoid any other scheduling on these nodes:

oadm manage-node node1.example.com --schedulable=false

Deploy OpenShift integrated docker registry:

 oadm registry --config=/etc/openshift/master/admin.kubeconfig \
    --credentials=/etc/openshift/master/openshift-registry.kubeconfig \
    --images='registry.access.redhat.com/openshift3/ose-${component}:${version}' 

Deploy an OpenShift router:

oadm router myrouter --replicas= \
    --credentials='/etc/openshift/master/openshift-router.kubeconfig' \
    --service-account=router

2 thoughts on “OpenShift 3 cheatsheet

  1. Hello,
    u wrote a very useful post! I have a noob question but I’m confused as hell:

    In my scenario I deployed openshift origin based on https://github.com/redhat-openstack/openshift-on-openstack project.
    I deployed 1x master , 1x infra host , 2x nodes

    The master and infra vm have floating ip so they can be accessible from external network.
    When i try to create a docker registry and router , Openshift create the those pods on the nodes instead of the master,
    Creating the router on the nodes ( they don’t have floating ip ) how are supposed to be reachable openshift apps from external network?
    Do u agree with me that each node must have public external network ? or I’m missing something?
    Thank you for your time and sorry for my bad english.
    Regards
    Alessio Dini

    • Hi Alessio,

      thank you for your comment. It is not specifically related to this post :), but anyway, here are some clues that may help you.
      The internal OpenShift registry is not intended to be accessible publicly out of the box. So, it is completely acceptable that it goes on a node, or even on a master with no floating IP. In fact, it will be referenced and accessible through its service IP (oc get service) with an internal cluster IP.

      If you would like to expose your registry, you will have to add a route and traffic will go through the OpenShift router.
      https://docs.openshift.com/enterprise/3.0/install_config/install/docker_registry.html#exposing-the-registry

      In the contrary, the router needs to run on an node (or a master) that has a floating IP. You will have to use node selector to ensure this.

Leave a Reply

Your email address will not be published. Required fields are marked *