minikube 실습하기
Minikube Quickstart를 해보았습니다.
Minikube 란?
Minikube는 쿠버네티스를 로컬에서 쉽게 돌리게 하는 툴입니다. Minikube는 쿠버네티스를 사용해보거나, 매일 (쿠버네티스를) 개발하는 사람을 위해, 싱글 노드 쿠버네티스 클러스터가 당신의 컴퓨터 위의 VM에서 돌아갑니다.
Installation
- macOS
brew cask install minikube
이 결과로 사용할 수 있는 명령어
- kubectl
- minikube
kubectl
is a command line interface for running commands against Kubernetes clusters. This overview covers kubectl syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the kubectl reference documentation. For installation instructions see installing kubectl.Quick Start
- minikube start: ISO 다운와 함께 시작
- minikube version: v0.28.0
- kubectl version: 쿠베컨트롤의 버전을 확인합니다.
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.5", GitCommit:"32ac1c9073b132b8ba18aa830f46b77dcceb0723", GitTreeState:"clean", BuildDate:"2018-06-22T05:40:33Z", GoVersion:"go1.9.7", Compiler:"gc", Platform:"darwin/amd64"}
The connection to the server 192.168.99.100:8443 was refused - did you specify the right host or port?
- minikube get-k8s-versions: 가능한 쿠버네티스 버전들을 보여줌. v1.10.0 이 최신
- minikube start --kubernetes-version="v1.10.0"
- minikube ssh
- uname -a
$ uname -a
Linux minikube 4.16.14 #1 SMP Mon Jun 11 16:20:15 UTC 2018 x86_64 GNU/Linux
- kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443
KubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
- kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready master 37m v1.10.0
- kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
deployment.apps "hello-minikube" created
- kubectl expose deployment hello-minikube --type=NodePort
service "hello-minikube" exposed
- kubectl get pod
NAME READY STATUS RESTARTS AGE
hello-minikube-6c47c66d8-5sz78 0/1 ContainerCreating 0 14s
- curl $(minikube service hello-minikube --url)
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
CLIENT VALUES:
client_address=172.17.0.1
command=GET
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.99.100:8080/
SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001
HEADERS RECEIVED:
accept=*/*
host=192.168.99.100:32584
user-agent=curl/7.54.0
BODY:
-no body in request-%
- minikube ip
192.168.99.100
- curl $(minikube service hello-minikube --url) -d '{data:data}'
CLIENT VALUES:
client_address=172.17.0.1
command=POST
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.99.100:8080/
SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001
HEADERS RECEIVED:
accept=*/*
content-length=11
content-type=application/x-www-form-urlencoded
host=192.168.99.100:32584
user-agent=curl/7.54.0
BODY:
{data:data}%
- http -f POST $(minikube service hello-minikube --url) API-key:foo hello=world
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/plain
Date: Wed, 27 Jun 2018 12:38:44 GMT
Server: nginx/1.10.0
Transfer-Encoding: chunked
CLIENT VALUES:
client_address=172.17.0.1
command=POST
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.99.100:8080/
SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001
HEADERS RECEIVED:
accept=*/*
accept-encoding=gzip, deflate
api-key=foo
connection=keep-alive
content-length=11
content-type=application/x-www-form-urlencoded; charset=utf-8
host=192.168.99.100:32584
user-agent=HTTPie/0.9.9
BODY:
hello=world
댓글 없음:
댓글 쓰기