Oc login: Difference between revisions
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
=Overview= | =Overview= | ||
'oc login' configures locally a [[.kube_config#Contexts|Kubernetes context]] by updating [[.kube_config|.kube/config]]. If it finds no state saved under .kube/config, or no command line options are provided, the command queries the user for OpenShift server, username and password. The command runs in the context of a project. The user must exists on server, and its identity must be correctly resolved by the OpenShift identity provider. | |||
The user must exists on server, and its identity must be correctly resolved by the OpenShift identity provider. | |||
Example: | Example: | ||
<syntaxhighlight lang='bash'> | |||
oc login -u <username>:<password> | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='bash'> | |||
oc login <api-server-url> -u <username> -p <password> | |||
</syntaxhighlight> | |||
If -u is not specified, 'oc login' will query for user. | |||
If -u is not specified, | |||
More about authentication: | More about authentication: |
Revision as of 00:55, 20 November 2020
Internal
Overview
'oc login' configures locally a Kubernetes context by updating .kube/config. If it finds no state saved under .kube/config, or no command line options are provided, the command queries the user for OpenShift server, username and password. The command runs in the context of a project. The user must exists on server, and its identity must be correctly resolved by the OpenShift identity provider.
Example:
oc login -u <username>:<password>
oc login <api-server-url> -u <username> -p <password>
If -u is not specified, 'oc login' will query for user.
More about authentication:
Related
oc whoami
Options
-u --username
Sets the user name.
-p --password
Sets the user name.
-n
Sets the project (namespace) to log into.
-s --server
--server="https://my-openshift-master:8443"
--certificate-authority
Specifies the path to the certificate authority file.
--insecure-skip-tls-verify
Allows interaction with HTTPS server while bypassing server certificate checks.