0
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 1 year has passed since last update.

minikubeのインストールと動作確認メモ

Last updated at Posted at 2022-11-10

基本的にDocker Desktopのkubernetes機能を利用してきたが、minikubeもメモ。

マルチnodeとかも試せるので。

インストール

Macなのでbrewで。

brew install minikube
brew install kubernetes-cli

Docker Desktopで一度kubernetesを有効にしてるとcliのインストール時にコンフリクトするみたい。既存を削除しました。

動作確認(minikube自体)

バージョン

minikube version version

minikube version: v1.28.0

start

とりあえずstartしてみる。

startしてないと、profileとか何もないので、何も確認できない。

minikube start

profile listを確認。

minikube profile list

dockerが入っているとVMドライバはdockerになるみたい。以前はVirtual Boxがデフォルトで遅くてストレスでしたがよかったです。
hyperkitを使う方法もあるようです。

状態を確認。

minikube status

stop

minikube stop

deleteでminikubeで作成したクラスター(profile)を削除できるみたい。

minikube delete

minikube startで再びクラスタは作れます。

dashboardの起動

Docker Desktopでは初期設定がうざかったdashboardもコマンド1つで起動できるようです。

minikube dashboard

動作確認(kubernetes的)

nginxを動かしてみる

とりあえずマニフェストファイルは用意せず、コマンドでnginxを起動させてみます。

kubectl create deployment hello-nginx --image=nginx

exposeで公開。このときserviceが生成されます。

kubectl expose deployment  hello-nginx --type=NodePort --port=80

minikubeでは以下のコマンドで自動でport-forward設定してくれるみたいです。

minikube service hello-nginx

nginxの画面が見えましたか?見れればOK

片付け

後片付け。

kubectl delete deployment hello-nginx
kubectl delete service hello-nginx
minikube image rm docker.io/library/nginx:latest

実際の利用はこちらをどうぞ(個人的な内容ですが)。

参考

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