K8S — Cluster and Context

Yst@IT
2 min readMar 27, 2020

--

Along the way of learning K8S, I found that sometimes I do need some reference and comparison between an original cluster and the cluster I have been testing on so to know and learn the differences.

Therefore, I come across the term Context. I knew this term for a while but never really get to know it. Link below explains it quite well.

Page from K8S showing how to manage multiple clusters.

This article is mainly to record the commends I have learned, as well as for my future reference.

In my scenario, I have two K8S cluster setup already. All commends are input from my bastion server.

Use get-contexts to list all context where the context with * is the current context, meaning that all commends are applied to that cluster. Current cluster is also shown by cluster-info and current-context commend.

Use get-clusters to list all available clusters.

Lastly, what I really want, need and helped me, set-context. Use this commend helped me change from compareset to dev cluster so I can issue kubectl commends to different clusters for comparison!

--

--

Yst@IT
Yst@IT

Written by Yst@IT

Cloud Solution Architect, focusing on Oracle Cloud Infrastructure currently.

No responses yet