How do you display current Kubernetes context using kubectl?

Experience Level: Junior
Tags: Kubernetes

Answer

Option 1:

Run the following command:

kubectl config current-context

Option 2:

Run the following command:

kubectl config get-contexts|grep "*"
Kubernetes Certified Application Developer (CKAD) preparation
Kubernetes Certified Application Developer (CKAD) preparation

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
Kubernetes
Kubernetes

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
25 Kubernetes questions that will help you get certified and become more efficient with K8s
25 Kubernetes questions that will help you get certified and become more efficient with K8s

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself