6
1

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 3 years have passed since last update.

【2020年11月版】Kubernetesをk3d+Lensで超速で立ち上げる

Posted at

k3d を使ってみました。

k3d = k3s on docker。つまり docker上でk3sをうごかすものです。
そして・・・、簡単です。とっても。

前提条件

dockerは動かしておいてください。

1. k3d のインストール&クラスタの作成

1-1. インストール

以下のコマンドでk3dをインストールします。

$ curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash

1-2. クラスタの立ち上げ

インストール後、以下のコマンドでクラスタを作成します。

$ k3d cluster create test-cluster

このtest-clusterは作成するクラスタの名前です。好きなお名前でどうぞ。

1-3. クラスタに接続

以下のコマンドでkubectlの接続先を上記で作成したクラスタに指定します。

$ k3d kubeconfig merge test-cluster --switch-context

以上で、kubectl が使えるようになっております。

2. Lensのインストールと立ち上げ

以下の公式サイトからgithubサイトへのリンクがありますのでバイナリがダウンロード可能です。

インストール後、lensを立ち上げると・・・

スクリーンショット 2020-11-23 19.48.48.png

左上のクラスタ追加ボタンがありますので、クリックすると・・・

スクリーンショット-2020-11-23-19-49-58.png

はい、上記で作成したk3d-test-clusterへの接続準備、オーライでございます。
Add cluster(s)をクリックすると・・・

スクリーンショット 2020-11-23 19.55.33.png

はい、このような感じでクラスタに接続完了です。このままLensからいろいろとクラスタの操作が行えてしまいます。

だいたい5分くらい?ですよ。。。

クラスタの削除

以下のコマンドでクラスタの削除です。

$ k3d cluster delete test-cluster

k3d、めっちゃお手軽やん。。。

以上です!!

参考サイト

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?