mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Update Docker instructions.
This commit is contained in:
parent
c8591bd323
commit
4b904c34a8
@ -1,6 +1,6 @@
|
|||||||
# build the hyperkube image.
|
# build the hyperkube image.
|
||||||
|
|
||||||
VERSION=v0.17.0
|
VERSION=v0.18.2
|
||||||
|
|
||||||
all:
|
all:
|
||||||
cp ../../saltbase/salt/helpers/safe_format_and_mount .
|
cp ../../saltbase/salt/helpers/safe_format_and_mount .
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"containers":[
|
"containers":[
|
||||||
{
|
{
|
||||||
"name": "controller-manager",
|
"name": "controller-manager",
|
||||||
"image": "gcr.io/google_containers/hyperkube:v0.17.0",
|
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||||
"command": [
|
"command": [
|
||||||
"/hyperkube",
|
"/hyperkube",
|
||||||
"controller-manager",
|
"controller-manager",
|
||||||
@ -19,11 +19,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "apiserver",
|
"name": "apiserver",
|
||||||
"image": "gcr.io/google_containers/hyperkube:v0.17.0",
|
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||||
"command": [
|
"command": [
|
||||||
"/hyperkube",
|
"/hyperkube",
|
||||||
"apiserver",
|
"apiserver",
|
||||||
"--service-cluster-ip-range=10.0.0.1/24",
|
"--portal-net=10.0.0.1/24",
|
||||||
"--address=0.0.0.0",
|
"--address=0.0.0.0",
|
||||||
"--etcd_servers=http://127.0.0.1:4001",
|
"--etcd_servers=http://127.0.0.1:4001",
|
||||||
"--cluster_name=kubernetes",
|
"--cluster_name=kubernetes",
|
||||||
@ -32,7 +32,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "scheduler",
|
"name": "scheduler",
|
||||||
"image": "gcr.io/google_containers/hyperkube:v0.17.0",
|
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||||
"command": [
|
"command": [
|
||||||
"/hyperkube",
|
"/hyperkube",
|
||||||
"scheduler",
|
"scheduler",
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"containers":[
|
"containers":[
|
||||||
{
|
{
|
||||||
"name": "controller-manager",
|
"name": "controller-manager",
|
||||||
"image": "gcr.io/google_containers/hyperkube:v0.17.0",
|
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||||
"command": [
|
"command": [
|
||||||
"/hyperkube",
|
"/hyperkube",
|
||||||
"controller-manager",
|
"controller-manager",
|
||||||
@ -19,11 +19,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "apiserver",
|
"name": "apiserver",
|
||||||
"image": "gcr.io/google_containers/hyperkube:v0.17.0",
|
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||||
"command": [
|
"command": [
|
||||||
"/hyperkube",
|
"/hyperkube",
|
||||||
"apiserver",
|
"apiserver",
|
||||||
"--service-cluster-ip-range=10.0.0.1/24",
|
"--portal-net=10.0.0.1/24",
|
||||||
"--address=127.0.0.1",
|
"--address=127.0.0.1",
|
||||||
"--etcd_servers=http://127.0.0.1:4001",
|
"--etcd_servers=http://127.0.0.1:4001",
|
||||||
"--cluster_name=kubernetes",
|
"--cluster_name=kubernetes",
|
||||||
@ -32,7 +32,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "scheduler",
|
"name": "scheduler",
|
||||||
"image": "gcr.io/google_containers/hyperkube:v0.17.0",
|
"image": "gcr.io/google_containers/hyperkube:v0.18.2",
|
||||||
"command": [
|
"command": [
|
||||||
"/hyperkube",
|
"/hyperkube",
|
||||||
"scheduler",
|
"scheduler",
|
||||||
|
@ -108,20 +108,20 @@ systemctl start docker
|
|||||||
Ok, now that your networking is set up, you can startup Kubernetes, this is the same as the single-node case, we will use the "main" instance of the Docker daemon for the Kubernetes components.
|
Ok, now that your networking is set up, you can startup Kubernetes, this is the same as the single-node case, we will use the "main" instance of the Docker daemon for the Kubernetes components.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v0.17.0 /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=127.0.0.1 --config=/etc/kubernetes/manifests-multi
|
sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v0.18.2 /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=127.0.0.1 --config=/etc/kubernetes/manifests-multi
|
||||||
```
|
```
|
||||||
|
|
||||||
### Also run the service proxy
|
### Also run the service proxy
|
||||||
```sh
|
```sh
|
||||||
sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.17.0 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2
|
sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.18.2 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test it out
|
### Test it out
|
||||||
At this point, you should have a functioning 1-node cluster. Let's test it out!
|
At this point, you should have a functioning 1-node cluster. Let's test it out!
|
||||||
|
|
||||||
Download the kubectl binary
|
Download the kubectl binary
|
||||||
([OS X](http://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/darwin/amd64/kubectl))
|
([OS X](http://storage.googleapis.com/kubernetes-release/release/v0.18.2/bin/darwin/amd64/kubectl))
|
||||||
([linux](http://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubectl))
|
([linux](http://storage.googleapis.com/kubernetes-release/release/v0.18.2/bin/linux/amd64/kubectl))
|
||||||
|
|
||||||
List the nodes
|
List the nodes
|
||||||
|
|
||||||
|
@ -93,14 +93,14 @@ systemctl start docker
|
|||||||
Again this is similar to the above, but the ```--api_servers``` now points to the master we set up in the beginning.
|
Again this is similar to the above, but the ```--api_servers``` now points to the master we set up in the beginning.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v0.17.0 /hyperkube kubelet --api_servers=http://${MASTER_IP}:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=$(hostname -i)
|
sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v0.18.2 /hyperkube kubelet --api_servers=http://${MASTER_IP}:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=$(hostname -i)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Run the service proxy
|
#### Run the service proxy
|
||||||
The service proxy provides load-balancing between groups of containers defined by Kubernetes ```Services```
|
The service proxy provides load-balancing between groups of containers defined by Kubernetes ```Services```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.17.0 /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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ docker run --net=host -d gcr.io/google_containers/etcd:2.0.9 /usr/local/bin/etcd
|
|||||||
|
|
||||||
### Step Two: Run the master
|
### Step Two: Run the master
|
||||||
```sh
|
```sh
|
||||||
docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v0.17.0 /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=127.0.0.1 --config=/etc/kubernetes/manifests
|
docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v0.18.2 /hyperkube kubelet --api_servers=http://localhost:8080 --v=2 --address=0.0.0.0 --enable_server --hostname_override=127.0.0.1 --config=/etc/kubernetes/manifests
|
||||||
```
|
```
|
||||||
|
|
||||||
This actually runs the kubelet, which in turn runs a [pod](http://docs.k8s.io/pods.md) that contains the other master components.
|
This actually runs the kubelet, which in turn runs a [pod](http://docs.k8s.io/pods.md) that contains the other master components.
|
||||||
@ -20,14 +20,14 @@ This actually runs the kubelet, which in turn runs a [pod](http://docs.k8s.io/po
|
|||||||
### Step Three: Run the service proxy
|
### Step Three: Run the service proxy
|
||||||
*Note, this could be combined with master above, but it requires --privileged for iptables manipulation*
|
*Note, this could be combined with master above, but it requires --privileged for iptables manipulation*
|
||||||
```sh
|
```sh
|
||||||
docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.17.0 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2
|
docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.18.2 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test it out
|
### Test it out
|
||||||
At this point you should have a running kubernetes cluster. You can test this by downloading the kubectl
|
At this point you should have a running kubernetes cluster. You can test this by downloading the kubectl
|
||||||
binary
|
binary
|
||||||
([OS X](https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/darwin/amd64/kubectl))
|
([OS X](https://storage.googleapis.com/kubernetes-release/release/v0.18.2/bin/darwin/amd64/kubectl))
|
||||||
([linux](https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubectl))
|
([linux](https://storage.googleapis.com/kubernetes-release/release/v0.18.2/bin/linux/amd64/kubectl))
|
||||||
|
|
||||||
*Note:*
|
*Note:*
|
||||||
On OS/X you will need to set up port forwarding via ssh:
|
On OS/X you will need to set up port forwarding via ssh:
|
||||||
|
Loading…
Reference in New Issue
Block a user