LoginSignup
9
13

More than 5 years have passed since last update.

kubernetes on Docker Desktop がstableになったので、installしてみる

Last updated at Posted at 2018-07-28

3日ほど前、kubernetes on Docker Desktop(mac,windows)がstableになりました。

個人で勉強するために、GCP登録するのは気がひけるので、ずっとDocker Desktopで使えるのを待ってました。

kubernetesのことはまったく分かりませんが、このビッグウェーブに乗るため手を動かします。手を動かしていればそのうち理解できるでしょう :kissing_heart:

Docker Desktopをアップデート

アップデート前のaboutページ
before-update1.jpg

アップデート前のpreferenceページ
before-update2.jpg

dockerを立ち上げると、kubernetesが使えるバージョンへのアップデートが登場します
update_install.jpg

アップデート後のaboutページ
after-update.jpg

アップデート後のpreferenceページにkubernetesを使用するための、選択が登場します。Enableをチェックしましょう。

ckeck-kube.jpg

Applyを押下すると、ほう、時間がかかるとな?(確かに3,4分かかりました)
時間がかかるとな.jpg

終了~ (下部にkubernetes is runnig の表示が!)
added-kubemenu.jpg

動作するかを確認する

  • kubectl(基本コマンドらしいです) でclientバージョンとserverバージョンの確認。
    • バージョンが異なった場合どうなるかは分かりません
$ kubectl version                                                                                                                                                                           
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
  • kubectl config current-context
    • localからリモートのkubernetesを動かすこともあるので、どこに作用するかの確認だと思う
    • localを向いているみたいね $ kubectl config current-context docker-for-desktop
  • kubectl cluster-info
    • クラスタ情報を見れるコマンドみたいです
$ kubectl cluster-info                                                                                                                                                                   
Kubernetes master is running at https://localhost:6443
KubeDNS is running at https://localhost:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/pro

Kubernetes Dashboard を動かす

dashboardを動かしているチュートリアルをよく見るのでやってみます。githubにレポジトリがあったので、公式のReadme.md に従います。

  • kubectl apply
    • applyするみたいです。(installじゃないんだ :thinking: )
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

secret "kubernetes-dashboard-certs" created
serviceaccount "kubernetes-dashboard" created
role.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
rolebinding.rbac.authorization.k8s.io "kubernetes-dashboard-minimal" created
deployment.apps "kubernetes-dashboard" created
service "kubernetes-dashboard" created
  • kubectl proxy
    • プロキシが必要みたいで
$ kubectl proxy                                                                                                                                                                             
Starting to serve on 127.0.0.1:8001
  • 127.0.0.1:8001 にアクセス
    • http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

スクリーンショット 2018-07-28 23.41.53.jpg

お、立ち上がった! (この画面はスキップします)

スクリーンショット 2018-07-28 23.42.19.jpg

Dashboardが立ち上がりました!
これで勉強できるね :relaxed:

参考

9
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
13