LoginSignup
2
1

More than 5 years have passed since last update.

macにminishiftをインストールする

Last updated at Posted at 2019-04-29

はじめに

macOSにminishiftをインストールするには2つ方法があります。
公式サイトでも紹介されていますが、今回はお手軽にmacOS + Virtualboxによるインストールを紹介します。

検証環境

  • macOS Mojave (10.14.4)
  • Virtualbox 6.0.4
  • minishift v1.33.0

インストール手順

基本的なインストール手順は公式サイトにもあります。
Preparing to Install Minishift

Linux、Windows、macOSといろんなプラットフォームでのインストール方法が記載されていますが、読むのは"All Platforms"のところです。

インストールバイナリのダウンロード

バイナリを公式サイトのMinishift Releasesからダウンロードします。

バイナリを解凍し、任意の場所に配置

私は分かりやすくホームディレクトリにある"Applications"フォルダに"minishift"フォルダを作成して、その中に解凍したバイナリ一式を配置しました。

minishiftの起動

起動コマンドはこちら。

$ cd /Users/[自分のユーザ名]/minishift
$ ./minishift start --vm-driver virtualbox

デフォルトではCPUは2個、メモリ4GBで起動するそうですが、変更したい場合は起動時にオプション指定することで変更可能です。

$ ./minishift start --vm-driver virtualbox --cpus=4 --memory=8GB

一度起動に失敗してタイムアウトエラーとなりましたが、メモリサイズを8GBに変更したら問題なく起動しました。メモリサイズ不足か、はたまた純粋にタイムアウトしたのかは不明ですが、何度か試してみたら良いかもしれません。

Error: timed out waiting for the condition

web consoleにアクセス

起動に成功するとこんな感じのログが表示されます。
web consoleのURLが表示されていますので、アクセスしてください。
OpenShiftのログイン画面が表示されます。

...
Login to server ...
Creating initial project "myproject" ...
Server Information ...
OpenShift server started.

The server is accessible via web console at:
    https://192.168.99.100:8443/console

You are logged in as:
    User:     developer
    Password: <any value>

To login as administrator:
    oc login -u system:admin

トラブルシューティング

minishiftの起動時にこんなメッセージが表示されることがあります。

Could not set oc CLI context for 'minishift' profile: Error during setting 'minishift' as active profile: The specified path to the kube config '/Users/xxxxx/.minishift/machines/minishift_kubeconfig' does not exist

その際は、下記のようなワークアラウンドで回避可能です。

$ minishift delete -f
$ minishift start --profile minishift

以上。

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