4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Docker for MacでKubernetesが利用可能になったので使ってみた

Last updated at Posted at 2018-07-28

はじめに

Dockerコミュニティ版の最新バージョン Docker Community Edition 18.06.0-ceより、MacOSとWindowsで正式にKubernetesが統合されました。既にインストールしている人は、バージョンアップを行いKubernetes機能を有効にすることで、Kubernetesを使用できます。

本記事は、Docker for MacのKubernetesインストールについて簡単にまとめました。

Docker for MacでKubernetesを使用する

Dockerを無料で使用する場合、コミュニティ版と言われる安定したバージョンのStableと、最新の機能が取り込まれたエッジバージョンのEdgeがあります。これまでDocker for MacでKubernetesを使用する場合は、Edgeバージョンを選択する必要がありましたが、Stableでのリリースが発表され、正式にDocker DesktopにKubernetesが統合されることになりました。

ソースはこちらです。

Kubernetesのインストール

既にDocker for Macがインストールされていて、バージョンアップによりKubernetesをインストールする手順になります。Docker for Macをインストールしていない場合は先にインストールしてください。

  1. Dockerを起動すると、バージョンアップのポップアップが表示されるので[Install Update]をクリックする。
    スクリーンショット 2018-07-28 11.24.15.png

  2. [Install and Reaunch]をクリックする。
    スクリーンショット 2018-07-28 11.27.29.png

  3. [OK]をクリックし、管理者のパスワード入力が求められるので入力する。
    スクリーンショット 2018-07-28 11.28.42.png

  4. インストール完了後、[preferences]を見るとKubernetesのアイコンが表示される。
    スクリーンショット 2018-07-28 11.30.29.png

  5. [Enable Kubernetes]にチェックを入れて、[Kubernetes]を選択し、最後に[Apply]をクリックする。
    スクリーンショット 2018-07-28 11.34.03.png

  6. [Install]をクリックする。
    スクリーンショット 2018-07-28 11.34.43.png

  7. インストール完了後、[Run in background]をクリックし、Kubernetesが起動することを確認する。
    スクリーンショット 2018-07-28 11.35.28.png

さいごに

本家の[Installing kubeadm]より、システム要件を確認すると以下の通りでした。

・One or more machines running one of:
・Ubuntu 16.04+
・Debian 9
・CentOS 7
・RHEL 7
・Fedora 25/26 (best-effort)
・HypriotOS v1.0.1+
・Container Linux (tested with 1576.4.0)
・2 GB or more of RAM per machine (any less will leave little room for your apps)
・2 CPUs or more
・Full network connectivity between all machines in the cluster (public or private network is fine)
・Unique hostname, MAC address, and product_uuid for every node. See here for more details.
・Certain ports are open on your machines. See here for more details.
・Swap disabled. You MUST disable swap in order for the kubelet to work properly.

インストール完了後、Kubernetesが中々起動しませんでした。
気がついたら起動できたのですが、Docker for Macはデフォルトで使用可能メモリが2GBになっているので、4GBのMacだと動作が重く使い物になりません。

なので、[preferences]-[Advanced]の[Memory]を1.0GiBに引き下げることで起動はできましたが、本来のパフォーマンスを出すならKubernetesを動かすプラットフォームとなるマシンのメモリに8GBは必要そうです。

4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?