OS Console

Learn how to access a Kubernetes node's OS console using the ocne cluster console command.

Oracle CNE systems are administered through Kubernetes. If you need to directly access a node's OS for debugging and testing purposes, use the ocne cluster console command to start an administration console.

The console can be started with extra debugging tools that can be used for investigation and diagnosis purposes, by including the --toolbox option.

The ocne cluster console command can also be used with the -- command option to run commands on a node, without directly interacting with the shell. This might be helpful to return information about a node, without connecting directly to the console.

By default, the console session starts with the initial working directory set to root (/). If you need to access services that run on the node itself, for example the ocne-update.service, you can run the chroot /hostroot command, and chroot to the local file system of the node. Or, you can start the console session already chrooted to the node file system, using the --direct option.

The ocne cluster console command is the method you use to access a node's OS in the cluster. The only reason to access a node using some other method, such as SSH, or a serial console, is when the node can't be accessed using this method.

For information on the credentials to use for SSH, see OCK Image User.

Accessing a Node's OS Console

Access a Kubernetes node's OS console using the ocne cluster console command.

  1. Get the name of the node.

    Use the kubectl get nodes command to find the name of the node you want to access.

    kubectl get nodes
  2. Connect to the node's console.

    Use the ocne cluster console command to access the console of a node. The syntax is:

    ocne cluster console 
    [{-d|--direct}]
    {-N|--node} nodename
    [{-t|--toolbox}]
    [-- command] 

    For more information on the syntax options, see Oracle Cloud Native Environment: CLI.

    For example:

    ocne cluster console --direct --node mynode

    The preceding line of code starts a chroot session on the node and a terminal prompt is displayed. When you're finished using the console, enter exit to end the console session.

  3. Pass a command for the console to run.

    The ocne cluster console command can be used with the -- command option to run commands on a node, without directly interacting with the shell. For example, to find the IP address of the node, you can run:

    ocne cluster console --direct --node ocne-control-plane-1 -- ip addr | head