Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some prerequisites from single node docker cluster setup instructions. #18430

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 36 additions & 29 deletions docs/getting-started-guides/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Running Kubernetes locally via Docker
- [Run an application](#run-an-application)
- [Expose it as a service](#expose-it-as-a-service)
- [A note on turning down your cluster](#a-note-on-turning-down-your-cluster)
- [Troubleshooting](#troubleshooting)

### Overview

Expand All @@ -55,35 +56,7 @@ Here's a diagram of what the final result will look like:
### Prerequisites

1. You need to have docker installed on one machine.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about keeping this around for folks who have their nodes in-correctly configured. This information could reside in a Troubleshooting section for example :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree . This shouldn't be removed completely, but we can move it to the troubleshooting section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with moving this to Troubleshooting section. I just don't want to discourage people by seeing and reading a long and complicated list of kernel options.

2. Your kernel should support memory and swap accounting. Ensure that the
following configs are turned on in your linux kernel:

```console
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_SWAP_ENABLED=y
CONFIG_MEMCG_KMEM=y
```

3. Enable the memory and swap accounting in the kernel, at boot, as command line
parameters as follows:

```console
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
```

NOTE: The above is specifically for GRUB2.
You can check the command line parameters passed to your kernel by looking at the
output of /proc/cmdline:

```console
$cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.18.4-aufs root=/dev/sda5 ro cgroup_enable=memory
swapaccount=1
```

4. Decide what Kubernetes version to use. Set the `${K8S_VERSION}` variable to
2. Decide what Kubernetes version to use. Set the `${K8S_VERSION}` variable to
a value such as "1.1.1".

### Step One: Run etcd
Expand Down Expand Up @@ -226,6 +199,40 @@ the cluster, you need to first kill the kubelet container, and then any other co

You may use `docker kill $(docker ps -aq)`, note this removes _all_ containers running under Docker, so use with caution.

### Troubleshooting

#### Node is in ```NotReady``` state

If you see your node as ```NotReady``` it's possible that your OS does not have memcg and swap enabled.

1. Your kernel should support memory and swap accounting. Ensure that the
following configs are turned on in your linux kernel:

```console
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_SWAP_ENABLED=y
CONFIG_MEMCG_KMEM=y
```

2. Enable the memory and swap accounting in the kernel, at boot, as command line
parameters as follows:

```console
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
```

NOTE: The above is specifically for GRUB2.
You can check the command line parameters passed to your kernel by looking at the
output of /proc/cmdline:

```console
$cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.18.4-aufs root=/dev/sda5 ro cgroup_enable=memory
swapaccount=1
```

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/docker.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->