azure account set
The cluster setup scripts can setup Kubernetes for multiple targets. First modify cluster/kube-env.sh
to specify azure:
KUBERNETES_PROVIDER="azure"
Next, specify an existing virtual network in cluster/azure/config-defualt.sh
:
AZ_VNET=<vnet name>
Now you're ready.
You can then use the cluster/kube-*.sh
scripts to manage your azure cluster, start with:
cluster/kube-up.sh
The script above will start (by default) a single master VM along with 4 worker VMs. You
can tweak some of these parameters by editing cluster/azure/config-default.sh
.
The cluster/kubecfg.sh
command below spins up two containers, running Nginx and with port 80 mapped to 8080:
cd kubernetes
cluster/kubecfg.sh -p 8080:80 run dockerfile/nginx 2 myNginx
To stop the containers:
cluster/kubecfg.sh stop myNginx
To delete the containers:
cluster/kubecfg.sh rm myNginx
You can create a pod like this:
cd kubernetes
cluster/kubecfg.sh -c api/examples/pod.json create /pods
Where pod.json contains something like:
{
"id": "php",
"kind": "Pod",
"apiVersion": "v1beta1",
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "php",
"containers": [{
"name": "nginx",
"image": "dockerfile/nginx",
"ports": [{
"containerPort": 80,
"hostPort": 8080
}],
"livenessProbe": {
"enabled": true,
"type": "http",
"initialDelaySeconds": 30,
"httpGet": {
"path": "/index.html",
"port": "8080"
}
}
}]
}
},
"labels": {
"name": "foo"
}
}
You can see your cluster's pods:
cluster/kubecfg.sh list pods
and delete the pod you just created:
cluster/kubecfg.sh delete pods/php
Look in api/examples/
for more examples
cd kubernetes
cluster/kube-down.sh
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。