described needed steps for shared mount propagation
This commit is contained in:
@@ -16,26 +16,48 @@ Here's a diagram of what the final result will look like:
|
|||||||
|
|
||||||
**Note: These steps have not been tested with the [Docker For Mac or Docker For Windows beta programs](https://blog.docker.com/2016/03/docker-for-mac-windows-beta/).**
|
**Note: These steps have not been tested with the [Docker For Mac or Docker For Windows beta programs](https://blog.docker.com/2016/03/docker-for-mac-windows-beta/).**
|
||||||
|
|
||||||
1. You need to have docker installed on one machine.
|
1. You need to have Docker version >= "1.10" installed on the machine.
|
||||||
2. Decide what Kubernetes version to use. Set the `${K8S_VERSION}` variable to
|
2. Enable mount propagation. Hyperkube is running in a container which has to mount volumes for other containers, for example in case of persistent storage. The required steps depend on the init system.
|
||||||
a released version of Kubernetes >= "v1.2.0". If you'd like to use the current stable version of Kubernetes, run the following:
|
|
||||||
|
|
||||||
|
In case of **systemd**, change MountFlags in the Docker unit file to shared.
|
||||||
|
```shell
|
||||||
|
DOCKER_CONF=$(systemctl cat docker | head -1 | awk '{print $2}')
|
||||||
|
sed -i.bak 's/^\(MountFlags=\).*/\1shared/' $DOCKER_CONF
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart docker
|
||||||
|
```
|
||||||
|
|
||||||
|
**Otherwise**, manually set the mount point used by Hyperkube to be shared:
|
||||||
|
```shell
|
||||||
|
mkdir -p /var/lib/kubelet
|
||||||
|
mount --bind /var/lib/kubelet /var/lib/kubelet
|
||||||
|
mount --make-shared /var/lib/kubelet
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Run it
|
||||||
|
|
||||||
|
1. Decide which Kubernetes version to use. Set the `${K8S_VERSION}` variable to a version of Kubernetes >= "v1.2.0".
|
||||||
|
|
||||||
|
|
||||||
|
If you'd like to use the current **stable** version of Kubernetes, run the following:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
export K8S_VERSION=$(curl -sS https://storage.googleapis.com/kubernetes-release/release/stable.txt)
|
export K8S_VERSION=$(curl -sS https://storage.googleapis.com/kubernetes-release/release/stable.txt)
|
||||||
```
|
```
|
||||||
|
|
||||||
and for the latest available version (including unstable releases):
|
and for the **latest** available version (including unstable releases):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
export K8S_VERSION=$(curl -sS https://storage.googleapis.com/kubernetes-release/release/latest.txt)
|
export K8S_VERSION=$(curl -sS https://storage.googleapis.com/kubernetes-release/release/latest.txt)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Run it
|
2. Start Hyperkube
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
export ARCH=amd64
|
export ARCH=amd64
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--volume=/:/rootfs:ro \
|
|
||||||
--volume=/sys:/sys:rw \
|
--volume=/sys:/sys:rw \
|
||||||
--volume=/var/lib/docker/:/var/lib/docker:rw \
|
--volume=/var/lib/docker/:/var/lib/docker:rw \
|
||||||
--volume=/var/lib/kubelet/:/var/lib/kubelet:rw,shared \
|
--volume=/var/lib/kubelet/:/var/lib/kubelet:rw,shared \
|
||||||
@@ -45,7 +67,6 @@ docker run -d \
|
|||||||
--privileged \
|
--privileged \
|
||||||
gcr.io/google_containers/hyperkube-${ARCH}:${K8S_VERSION} \
|
gcr.io/google_containers/hyperkube-${ARCH}:${K8S_VERSION} \
|
||||||
/hyperkube kubelet \
|
/hyperkube kubelet \
|
||||||
--containerized \
|
|
||||||
--hostname-override=127.0.0.1 \
|
--hostname-override=127.0.0.1 \
|
||||||
--api-servers=http://localhost:8080 \
|
--api-servers=http://localhost:8080 \
|
||||||
--config=/etc/kubernetes/manifests \
|
--config=/etc/kubernetes/manifests \
|
||||||
@@ -229,4 +250,3 @@ For support level information on all solutions, see the [Table of solutions](/do
|
|||||||
|
|
||||||
Please see the [Kubernetes docs](/docs/) for more details on administering
|
Please see the [Kubernetes docs](/docs/) for more details on administering
|
||||||
and using a Kubernetes cluster.
|
and using a Kubernetes cluster.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user