DEV Community

Ravindra Singh for AWS Community Builders

Posted on

4

Simplifying Context Configuration and Switching in Multiple Kubernetes Clusters

Understanding Contexts in Kubernetes
In Kubernetes, a context refers to a combination of a cluster, a user, and a namespace. Managing contexts becomes challenging when working with multiple clusters, each with its authentication requirements, namespaces, and unique configurations.

Tools to Simplify Kubernetes Context Management

  1. kubectx and kubens: Streamline context switching and namespace navigation.

  2. k9s: A terminal-based UI that facilitates cluster management and context switching.

  3. kubie: Provides shortcuts and aliases for easier context management.

  4. kubectl aliases: Custom aliases can simplify complex commands and context switching.

Switching contexts

To list all Kubernetes contexts.

kubectl config view -o jsonpath='{.contexts[*].name}' | tr " " "\n"
Enter fullscreen mode Exit fullscreen mode

Check your current context.

kubectl config current-context
Enter fullscreen mode Exit fullscreen mode

Switch context from current context.

kubectl config use-context <context_name>
Enter fullscreen mode Exit fullscreen mode

Thank you for reading and happy Kubernetes managing! 🎉👏😊"

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Okay let's go

Community matters

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay