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 件のコメント:

コメントを投稿

memo

  1)RDS に接続してみる 2)ドライバーを環境変数で定義してみる 以下、dockerfileに記載 ———————— # /bin/shを/bin/sh_tmpにリネーム > 同時に/bin/shに対して/bin/bashへのシンボリックリンクを作成 R...