Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernetes 触ってみた

Kubernetes 触ってみた

Container EngineでKubernetesを触ってみた記録です。

Shinichirow KAMITO

July 17, 2015
Tweet

More Decks by Shinichirow KAMITO

Other Decks in Technology

Transcript

  1. gcloud コンテナエンジンのクラスタを操作するには、gcloudコマンドの kubectl コマンドを利用しま す。 $ gcloud components list --------------------------------------------------------------------------------------------------

    | Components | |------------------------------------------------------------------------------------------------| | Status | Name | ID | Size | |------------------+-----------------------------------------------+-------------------+---------| | Update Available | BigQuery Command Line Tool | bq | < 1 MB | | Update Available | Cloud SDK Core Libraries | core | 2.0 MB | | Update Available | Default set of gcloud commands | gcloud | < 1 MB | | Update Available | Developer Preview gcloud Commands | preview | < 1 MB | | Deprecated | Compute Engine Command Line Tool (deprecated) | gcutil | < 1 MB | | Not Installed | App Engine Command Line Interface (Preview) | app | < 1 MB | | Not Installed | Compute Engine Command Line Tool Checker | gcutil-msg | < 1 MB | | Not Installed | gcloud app Java Extensions | app-engine-java | 95.2 MB | | Not Installed | gcloud app Python Extensions | app-engine-python | 6.9 MB | | Installed | Cloud Storage Command Line Tool | gsutil | 2.7 MB | | Installed | gcloud Alpha Commands | alpha | < 1 MB | | Installed | gcloud Beta Commands | beta | < 1 MB | | Installed | kubectl | kubectl | | -------------------------------------------------------------------------------------------------- To install new components or update existing ones, run: $ gcloud components update COMPONENT_ID 11 / 23
  2. kubectl kubectlコマンドをインストールします。 $ gcloud components update kubectl インストールできたらversionが確認できます。 $ kubectl

    version Client Version: version.Info{Major:"0", Minor:"20.1", GitVersion:"v0.20.1", GitCommit:"", GitTreeSt ate:"not a git tree"} Server Version: version.Info{Major:"0", Minor:"21", GitVersion:"v0.21.2", GitCommit:"4e89f2e6670b16 62021a86ac42b99c5c50c37d05", GitTreeState:"clean"} kubectl helpするとなんかいっぱい出ます。 12 / 23
  3. gcloud config kubectlで使用するプロジェクトやゾーン、クラスタの設定をします。 $ gcloud config set project PROJECT_ID $

    gcloud config set compute/zone asia-east1-c $ gcloud config set container/clouster CLUSTER_NAME $ gcloud config list [compute] zone = asia-east1-c [container] cluster = CLUSTER_NAME [core] account = [email protected] disable_usage_reporting = False project = PROJECT_ID 13 / 23