mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #9786 from ZJU-SEL/UpdateDockerK8s
Update docker k8s approach
This commit is contained in:
commit
d18dcabca5
@ -5,6 +5,7 @@ VERSION=v0.18.2
|
||||
all:
|
||||
cp ../../saltbase/salt/helpers/safe_format_and_mount .
|
||||
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} .
|
||||
gcloud preview docker push gcr.io/google_containers/hyperkube:${VERSION}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
"containers":[
|
||||
{
|
||||
"name": "controller-manager",
|
||||
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||
"image": "gcr.io/google_containers/hyperkube:VERSION",
|
||||
"command": [
|
||||
"/hyperkube",
|
||||
"controller-manager",
|
||||
@ -19,7 +19,7 @@
|
||||
},
|
||||
{
|
||||
"name": "apiserver",
|
||||
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||
"image": "gcr.io/google_containers/hyperkube:VERSION",
|
||||
"command": [
|
||||
"/hyperkube",
|
||||
"apiserver",
|
||||
@ -32,7 +32,7 @@
|
||||
},
|
||||
{
|
||||
"name": "scheduler",
|
||||
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||
"image": "gcr.io/google_containers/hyperkube:VERSION",
|
||||
"command": [
|
||||
"/hyperkube",
|
||||
"scheduler",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"containers":[
|
||||
{
|
||||
"name": "controller-manager",
|
||||
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||
"image": "gcr.io/google_containers/hyperkube:VERSION",
|
||||
"command": [
|
||||
"/hyperkube",
|
||||
"controller-manager",
|
||||
@ -19,7 +19,7 @@
|
||||
},
|
||||
{
|
||||
"name": "apiserver",
|
||||
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||
"image": "gcr.io/google_containers/hyperkube:VERSION",
|
||||
"command": [
|
||||
"/hyperkube",
|
||||
"apiserver",
|
||||
@ -32,7 +32,7 @@
|
||||
},
|
||||
{
|
||||
"name": "scheduler",
|
||||
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||
"image": "gcr.io/google_containers/hyperkube:VERSION",
|
||||
"command": [
|
||||
"/hyperkube",
|
||||
"scheduler",
|
||||
|
@ -132,7 +132,7 @@ kubectl get nodes
|
||||
This should print:
|
||||
```
|
||||
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.
|
||||
|
@ -9,8 +9,8 @@ kubectl get nodes
|
||||
That should show something like:
|
||||
```
|
||||
NAME LABELS STATUS
|
||||
10.240.99.26 <none> Ready
|
||||
127.0.0.1 <none> Ready
|
||||
10.240.99.26 kubernetes.io/hostname=10.240.99.26 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
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
|
||||
### 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
|
||||
|
||||
Move on to [testing your cluster](testing.md) or [add another node](#adding-a-kubernetes-worker-node-via-docker)
|
||||
|
Loading…
Reference in New Issue
Block a user