Kubernetes教程

我会使用 Mac PC,并安装 Minikube。

安装minikube并验证一系列操作。

brew cask install minikube
minikube start
kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
deployment "hello-minikube" created
kubectl expose deployment hello-minikube --type=NodePort
service "hello-minikube" exposed
kubectl get pod
NAME                             READY     STATUS              RESTARTS   AGE
hello-minikube-180744149-dm5rp   0/1       ContainerCreating   0          14s
curl $(minikube service hello-minikube --url)
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:32530
user-agent=curl/7.43.0
BODY:
-no body in request-%  
minikube stop
Stopping local Kubernetes cluster...
Machine stopped.

访问仪表盘

minikube dashboard
スクリーンショット 2017-08-16 18.59.39.png
广告
将在 10 秒后关闭
bannerAds