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! 🎉👏😊"

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

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 wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay