LoginSignup
0

More than 3 years have passed since last update.

Windows10でminikubeを使う

Posted at

環境

  • Windows10 Pro(Homeでもいけるはず)
  • VirtualBox

Virtulal BoxとHyper-Vは排他で一方が有効だともう一方は使えなくなるような動きをするので注意

手順

環境変数を通す

image.png

kubectlコマンドダウンロード

mkdir C:\tools\kubectl
Invoke-WebRequest -Uri  https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/windows/amd64/kubectl.exe -OutFile kubectl.exe

minikubeコマンドダウンロード

mkdir C:\tools\minikube
Invoke-WebRequest -Uri https://storage.googleapis.com/minikube/releases/latest/minikube-windows-amd64.exe -OutFile C:\tools\minikube\minikube.exe

起動

minikube start

クラスタ情報

kubectl cluster-info

サンプルアプリケーションのデプロイ

サンプルのDockerイメージをデプロイ

kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080

Dokcerイメージと接続するためのサービスをデプロイ

kubectl expose deployment hello-minikube --type=NodePort

Podがデプロイされているか確認

kubectl get pod

接続確認

minikube service hello-minikube

ブラウザでこのような画面が開く
image.png

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