Openshift Container Platform - Understand and use the command line
|
May 25, 2019
|
Development,
Kubernetes
OpenShift Container Platform (OCP) organizes entities in the OpenShift cluster as objects. These objects are managed by the master node. Objects are known as resources. Some resources are:
- Nodes
- Services
- Pods
- Projects (namespaces)
- Deployment Configuration (DC)
- Users
$ sudo yum install atomic-OpenShift-clientsFor other Linux distributions, the OpenShift Origin (https://www.okd.io/) is the implementation of Red Hat OpenShift. Once the oc CLI tool has been installed, the oc help command display help info. Some oc subcommands are used for login, logout, creating/deleting projects, creating routes/applications/deployment configurations, scaling applications, starting new builds and checking logs. Bash completion is installed but not enabled by default for the oc CLI. To use bash completion for the oc CLI, source the /etc/bash_completion/oc file .
$source /etc/bash_completion/oc $oc adm autoscale create explain import-image new-project process rollout set annotate cancel-build debug expose label observe project rsh start-build …The login subcommand will interactively prompt you for the server name, user name, and password or include the information on the command line
$ oc login https://localhost:8443 -u developer -p passwordOnce you login, OpenShift save the authorization token in the users’s home folder under the .kube folder.
