2019年7月2日火曜日

Kubernetes クラスタ の切り替え方法

1)目的のkubernetesクラスタの状況を確認したい場合に以下のコマンドを行うようだ。

kubectl config get-contexts
============================================================
CURRENT   NAME                                                                   CLUSTER                                                                AUTHINFO                                                               NAMESPACE
          docker-for-desktop                                                     docker-for-desktop-cluster                                             docker-for-desktop                                                     
          gke_hardy-position-244307_asia-northeast1-a_nodejs-cluster             gke_hardy-position-244307_asia-northeast1-a_nodejs-cluster             gke_hardy-position-244307_asia-northeast1-a_nodejs-cluster             
          gke_hardy-position-244307_asia-northeast1-b_guestbook                  gke_hardy-position-244307_asia-northeast1-b_guestbook                  gke_hardy-position-244307_asia-northeast1-b_guestbook                  
          gke_hardy-position-244307_asia-northeast1-b_persistent-disk-tutorial   gke_hardy-position-244307_asia-northeast1-b_persistent-disk-tutorial   gke_hardy-position-244307_asia-northeast1-b_persistent-disk-tutorial   
*         gke_hardy-position-244307_asia-northeast1-b_test-disk                  gke_hardy-position-244307_asia-northeast1-b_test-disk                  gke_hardy-position-244307_asia-northeast1-b_test-disk                  
          minikube                                                               minikube                                                               minikube                                                               
=============================================================

* は、現在使用中のkubenetesのクラスタの位置。


2)以下のコマンドで、kubernetesクラスタの切り替えを行う。
     赤文字の箇所が対象のkuberntesクラスタを指定する。

kubectl config use-context gke_hardy-position-244307_asia-northeast1-b_persistent-disk-tutorial
========================================================================
Switched to context "gke_hardy-position-244307_asia-northeast1-b_persistent-disk-tutorial".
========================================================================


0 件のコメント:

コメントを投稿

M4 MaxのRoo Codeから自宅ラズパイk8sクラスターをMCPで「完落ち」させるまで③

完成後、MCP経由で自作のraspberry piにリソースの作成や削除などの実験をしてみました。 現時点で、思うこととして、障害時にログの分析や作成や削除に関する助言として受け入れるには頼りになるなって思いました。 [頼りにならない動作について] 削除についてですが、names...