Google開源的容器集群管理系統:Kubernetes
Kubernetes 是來自 Google 云平臺的開源容器集群管理系統。基于 Docker 構建一個容器的調度服務。該系統可以自動在一個容器集群中選擇一個工作容器供使用。其核心概念是 Container Pod。詳細的設計思路請參考這里。
Running a container (simple version)
Once you have your instances up and running, the build-go.sh
script sets up your Go workspace and builds the Go components.
The cloudcfg.sh
script spins up two containers, running Nginx and with port 80 mapped to 8080:
cd kubernetes
hack/build-go.sh
cluster/cloudcfg.sh -p 8080:80 run dockerfile/nginx 2 myNginx
To stop the containers:
cluster/cloudcfg.sh stop myNginx
To delete the containers:
cluster/cloudcfg.sh rm myNginx
Running a container (more complete version)
Assuming you've run hack/dev-build-and-up.sh
and hack/build-go.sh
:
cd kubernetes
cluster/cloudcfg.sh -c api/examples/pod.json create /pods
Where pod.json contains something like:
{
"ID": "nginx",
"desiredState": {
"image": "dockerfile/nginx",
"networkPorts": [{
"containerPort": 80,
"hostPort": 8080
}]
},
"labels": {
"name": "foo"
}
}
Look in api/examples/
for more examples
Tearing down the cluster
cd kubernetes
cluster/kube-down.sh
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!