LoginSignup
0
0

More than 1 year has passed since last update.

k3d を使ってローカル で k8s を試す

Last updated at Posted at 2022-10-02

環境

MacOS

k3s とは

k3dは、k3s(Rancher Labの最小Kubernetesディストリビューション)をdockerで実行するための軽量なラッパーです。
k3dを使うと、Kubernetes上でのローカル開発など、シングルノードやマルチノードのk3sクラスタをDocker上で非常に簡単に作成することができます。

k3s インストール

brew install k3d

クラスタ作成

k3d cluster create mycluster

クラスタ削除

k3d cluster delete mycluste

kubectl 操作メモ

コンテキストの一覧

kubectl config get-contexts

コンテキストの切り替え

kubectl config use-context xxx

ポートフォーワード

kubectl port-forward mypod 80:80

NodePort を使ってアクセス

0
0
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
0
0