Kubectl config: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
=Overview=
=Overview=


==current-context==
==<tt>current-context</tt>==


Displays the [[.kube_config#Current_Context|current context]]:
Displays the [[.kube_config#Current_Context|current context]]:


kubectl config current-context
<syntaxhighlight lang='bash'>
kubectl config current-context
</syntaxhighlight>


==use-context==
==<tt>use-context</tt>==


Sets the [[.kube_config#Current_Context|current context]]:
Sets the [[.kube_config#Current_Context|current context]]:


kubectl config use-context ''new-context-name''
<syntaxhighlight lang='bash'>
kubectl config use-context <new-context-name>
</syntaxhighlight>


==<tt>view</tt>==
==<tt>view</tt>==

Revision as of 04:07, 10 April 2021

Internal

Overview

current-context

Displays the current context:

kubectl config current-context

use-context

Sets the current context:

kubectl config use-context <new-context-name>

view

Displays the content of ~/.kube/cofig:

kubectl config view

rename-context