Managing a local OpenShift cluster

The OpenShift cluster will run as an all-in-one container on a Docker host. The Docker host may be a local virtual machine (VM), remote machine, or the local Unix host.

Use the up command to start a new cluster on a Docker host.

Ensure that Docker commands are working and that you can create new containers before you try to use an existing Docker connection.

Default routes are set up using nip.io and the host IP of your cluster.  Use the --routing-suffix flag to use a different routing suffix.

The syntax is as follows:

oc cluster ACTION [flags]

The available commands are as follows:

  • add: Add components to an oc cluster up cluster
  • down: Stop OpenShift on Docker
  • status: Show OpenShift on Docker status
  • up: Start OpenShift on Docker with reasonable defaults

Use oc <command> --help for more information about a given command. Use oc options for a list of global command-line options (this applies to all commands).

We will not dive into all composite commands; we will just explain the ones we will use along our journey. If you need more information, take a look at the documentation at https://docs.okd.io/latest/welcome/index.html.

To check what is really running, we can first check which containers are running, as follows:

# docker ps

This will give the output depicted in the following screenshot:

Output showing the containers that are running

Toward the end of the log, we can see something about the web-console, which is the other management tool provided automatically by the OKD platform.

Furthermore, the log provides the coordinates of our OKD cluster accessible at https://127.0.0.1:8443.

The same URL is valid for both the graphic interface and the command-line tool, and by default the oc automatically logs you in with a developer account, as shown at the end of the log:

You are logged in as:
User: developer
Password: <any value>

By default, the user admin with any password is also created. The super user, who is the real administrator of the system, is the user called super:admin, which is available only with the CLI, as it uses a certificate to log in.

We will go back to the oc command later in the chapter, and switch to the Web console.

To access the system via the UI, point your browser at the URL described earlier, and you should see the login form, shown as follows:

Log in as developer and you should see the following page:

As you can see from the preceding screenshot, OKD provides, by default, various ready-to-use templates for different platforms (such as WildFly, Node.js, and Ruby) and databases (such as MongoDB and MariaDB) with which to deploy your application as a container.

Of course, you can provide your own template to the technology you need to run your applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset