約1年前に私がRancherに触れた頃に、Mac上でRancher Serverを構築しようとしてうまく行かなかったことがあったのですが、この記事は、それのリベンジを試みた記事です。
(当時の経緯はこの辺のスライドに書き残してありました…)
私がRancherに最初に触れた昨年後半では、まだVersion 1.6系の頃で、もちろんDocker for Macへのインストールは非推奨でした。(今もDocker for Macへのインストールは非推奨です…推奨環境はこちら)
今回インストールを試みたDocker for Mac環境

ターミナルでおまじないを実行
dockerがインストールされていれば、ターミナルだけで以下のコマンドを実行するだけで、Rancherがインストールされる(はず)ですが…
docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:latest

起動できるかどうかを確認
https://localhost
をブラウザに入力して、起動できるかどうかを確認します。
接続確認の画面が出ました。
無事に起動したようです。
パスワードを設定して先に進みます。
GKEにクラスタを作成し、Prometheusを導入
せっかくなので、GKE(Google Kubernetes Engine)にクラスタを作成して、Rancher CatalogからPrometheusを入れてみます。














終わりに
私がハマっていた当時とは、Rancher自身のアーキテクチャも変わってしまい、Kubernetesをターゲットとしたものになってしまっていますが、Mac上でもRancher Serverを導入し、Managed Kubernetesクラスターを管理できることがわかりました。
現時点では、相変わらず環境としてはDocker for Macは非推奨なので、実運用等には絶対オススメしませんが、ちょっと試してみるには気軽に構築できるのでよいのではないでしょうか。
(あくまで非推奨なので、試行は自己責任でお願いします)