Commit d18dcabc authored by Brendan Burns's avatar Brendan Burns

Merge pull request #9786 from ZJU-SEL/UpdateDockerK8s

Update docker k8s approach
parents 7266f493 4e92f409
...@@ -5,6 +5,7 @@ VERSION=v0.18.2 ...@@ -5,6 +5,7 @@ VERSION=v0.18.2
all: all:
cp ../../saltbase/salt/helpers/safe_format_and_mount . cp ../../saltbase/salt/helpers/safe_format_and_mount .
curl -O https://storage.googleapis.com/kubernetes-release/release/${VERSION}/bin/linux/amd64/hyperkube curl -O https://storage.googleapis.com/kubernetes-release/release/${VERSION}/bin/linux/amd64/hyperkube
sed -i "s/VERSION/${VERSION}/g" master-multi.json master.json
docker build -t gcr.io/google_containers/hyperkube:${VERSION} . docker build -t gcr.io/google_containers/hyperkube:${VERSION} .
gcloud preview docker push gcr.io/google_containers/hyperkube:${VERSION} gcloud preview docker push gcr.io/google_containers/hyperkube:${VERSION}
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"containers":[ "containers":[
{ {
"name": "controller-manager", "name": "controller-manager",
"image": "gcr.io/google_containers/hyperkube:v0.18.2", "image": "gcr.io/google_containers/hyperkube:VERSION",
"command": [ "command": [
"/hyperkube", "/hyperkube",
"controller-manager", "controller-manager",
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}, },
{ {
"name": "apiserver", "name": "apiserver",
"image": "gcr.io/google_containers/hyperkube:v0.18.2", "image": "gcr.io/google_containers/hyperkube:VERSION",
"command": [ "command": [
"/hyperkube", "/hyperkube",
"apiserver", "apiserver",
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
}, },
{ {
"name": "scheduler", "name": "scheduler",
"image": "gcr.io/google_containers/hyperkube:v0.18.2", "image": "gcr.io/google_containers/hyperkube:VERSION",
"command": [ "command": [
"/hyperkube", "/hyperkube",
"scheduler", "scheduler",
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"containers":[ "containers":[
{ {
"name": "controller-manager", "name": "controller-manager",
"image": "gcr.io/google_containers/hyperkube:v0.18.2", "image": "gcr.io/google_containers/hyperkube:VERSION",
"command": [ "command": [
"/hyperkube", "/hyperkube",
"controller-manager", "controller-manager",
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}, },
{ {
"name": "apiserver", "name": "apiserver",
"image": "gcr.io/google_containers/hyperkube:v0.18.2", "image": "gcr.io/google_containers/hyperkube:VERSION",
"command": [ "command": [
"/hyperkube", "/hyperkube",
"apiserver", "apiserver",
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
}, },
{ {
"name": "scheduler", "name": "scheduler",
"image": "gcr.io/google_containers/hyperkube:v0.18.2", "image": "gcr.io/google_containers/hyperkube:VERSION",
"command": [ "command": [
"/hyperkube", "/hyperkube",
"scheduler", "scheduler",
......
...@@ -131,8 +131,8 @@ kubectl get nodes ...@@ -131,8 +131,8 @@ kubectl get nodes
This should print: This should print:
``` ```
NAME LABELS STATUS NAME LABELS STATUS
127.0.0.1 <none> Ready 127.0.0.1 kubernetes.io/hostname=127.0.0.1 Ready
``` ```
If the status of the node is ```NotReady``` or ```Unknown``` please check that all of the containers you created are successfully running. If the status of the node is ```NotReady``` or ```Unknown``` please check that all of the containers you created are successfully running.
......
...@@ -8,9 +8,9 @@ kubectl get nodes ...@@ -8,9 +8,9 @@ kubectl get nodes
That should show something like: That should show something like:
``` ```
NAME LABELS STATUS NAME LABELS STATUS
10.240.99.26 <none> Ready 10.240.99.26 kubernetes.io/hostname=10.240.99.26 Ready
127.0.0.1 <none> Ready 127.0.0.1 kubernetes.io/hostname=127.0.0.1 Ready
``` ```
If the status of any node is ```Unknown``` or ```NotReady``` your cluster is broken, double check that all containers are running properly, and if all else fails, contact us on IRC at If the status of any node is ```Unknown``` or ```NotReady``` your cluster is broken, double check that all containers are running properly, and if all else fails, contact us on IRC at
......
...@@ -103,31 +103,6 @@ The service proxy provides load-balancing between groups of containers defined b ...@@ -103,31 +103,6 @@ The service proxy provides load-balancing between groups of containers defined b
sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.18.2 /hyperkube proxy --master=http://${MASTER_IP}:8080 --v=2 sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.18.2 /hyperkube proxy --master=http://${MASTER_IP}:8080 --v=2
``` ```
### Add the node to the cluster
On the master you created above, create a file named ```node.yaml``` make it's contents:
```yaml
apiVersion: v1
kind: Node
metadata:
name: ${NODE_IP}
spec:
externalID: ${NODE_IP}
status:
# Fill in appropriate values below
capacity:
cpu: "1"
memory: 3Gi
```
Make the API call to add the node, you should do this on the master node that you created above. Otherwise you need to add ```-s=http://${MASTER_IP}:8080``` to point ```kubectl``` at the master.
```sh
./kubectl create -f node.yaml
```
### Next steps ### Next steps
Move on to [testing your cluster](testing.md) or [add another node](#adding-a-kubernetes-worker-node-via-docker) Move on to [testing your cluster](testing.md) or [add another node](#adding-a-kubernetes-worker-node-via-docker)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment