OpenShift Command Line Tools: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 15: Line 15:
=Context=
=Context=


The context of an invocation consists in a project (namespace) name, an OpenShift cluster address, and the name of the OpenShift user. The current context is maintained in  under [[.kube/config]].
The context of an invocation consists in a project (namespace) name, an OpenShift cluster address, and the name of the OpenShift user. The current context is maintained in  under [[.kube/config]]:


Context examples:
[...]
 
contexts:
default/lb-local:443/system:admin
- context:
 
    cluster: master-openshift-novaordis-io:443
or
    namespace: default
 
    user: system:admin/master-openshift-novaordis-io:443
  playground/master-openshift-novaordis-io:443/ovidiu
  name: <b>default/master-openshift-novaordis-io:443/system:admin</b>
- context:
    cluster: master-openshift-novaordis-io:443
    namespace: playground
    user: system:admin/master-openshift-novaordis-io:443
  name: <b>playground/master-openshift-novaordis-io:443/system:admin</b>
current-context: <b>default/master-openshift-novaordis-io:443/system:admin</b>
[...]

Revision as of 23:58, 18 October 2017

Internal

Overview

User may interact with OpenShift by sending REST API invocations into an OpenShift master. Project-related queries and administrative commands may be sent with oc. Special administrative commands related to core OpenShift services, may be sent with oadm

State

Both oc and oadm maintain state on the client host, under ~/<user>/.kube/<cluster-identifier> directories, and configuration in ~/<user>/.kube/config. Example:

~ovidiu/.kube/master.openshift.novaordis.io_443

Context

The context of an invocation consists in a project (namespace) name, an OpenShift cluster address, and the name of the OpenShift user. The current context is maintained in under .kube/config:

[...]
contexts:
- context:
    cluster: master-openshift-novaordis-io:443
    namespace: default
    user: system:admin/master-openshift-novaordis-io:443
  name: default/master-openshift-novaordis-io:443/system:admin
- context:
    cluster: master-openshift-novaordis-io:443
    namespace: playground
    user: system:admin/master-openshift-novaordis-io:443
  name: playground/master-openshift-novaordis-io:443/system:admin
current-context: default/master-openshift-novaordis-io:443/system:admin
[...]