From 895cbb92ad3fe8b71f441fc27755ad9ecfda72bb Mon Sep 17 00:00:00 2001 From: Avinash Sridharan Date: Thu, 30 Jul 2015 14:19:57 -0700 Subject: [PATCH 1/4] There is an open issue #9837 because of which kubernets is not able to start the API server if the underlying kernel does not support memory limits for CGROUP. Apparently docker is able to detect this, but somehow this is not communicated to invocations from the remote API. Thus to get kubernets working on a local docker installation, its important to make sure that the memory and swap accounting are turned on in the kernel and passed as a parameter to the kernel when booting up. Hence added the required instructions as a pre-req for running kubernets in a local docker installation. --- docs/getting-started-guides/docker.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 48660c7ab64..69212489253 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -55,6 +55,25 @@ Here's a diagram of what the final result will look like: ### Prerequisites 1. You need to have docker installed on one machine. +2. Your kernel should support memory and swap accounting. Ensure that the +following configs are turned on in your linux kernel: +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 ther kernel at boot as command line +parameters as follows: +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 kenel by looking at the +output of /proc/cmdline + ### Step One: Run etcd From b5a7cc9887022b62924d83b8285c0199cc0de8a1 Mon Sep 17 00:00:00 2001 From: Avinash Sridharan Date: Fri, 31 Jul 2015 10:40:18 -0700 Subject: [PATCH 2/4] Re-formatted the instructions --- docs/getting-started-guides/docker.md | 32 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index c0c0fd92a46..1f6e9db7c76 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -57,22 +57,28 @@ Here's a diagram of what the final result will look like: 1. You need to have docker installed on one machine. 2. Your kernel should support memory and swap accounting. Ensure that the following configs are turned on in your linux kernel: -CONFIG_RESOURCE_COUNTERS=y + ```console -CONFIG_MEMCG=y - -CONFIG_MEMCG_SWAP=y - -CONFIG_MEMCG_SWAP_ENABLED=y - -CONFIG_MEMCG_KMEM=y -3. Enable the memory and swap accounting in ther kernel at boot as command line + 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: -GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1" -NOTE: The above is specifically for GRUB2. + ```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 kenel by looking at the -output of /proc/cmdline + You can check the command line parameters passed to your kenel 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 + ``` ### Step One: Run etcd From 8e9c254f442598be995800eb3ff20c59f4c0bd15 Mon Sep 17 00:00:00 2001 From: Avinash Sridharan Date: Fri, 31 Jul 2015 22:09:34 -0700 Subject: [PATCH 3/4] Just removing the white-spaces --- docs/getting-started-guides/docker.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 1f6e9db7c76..1d744f3e7d7 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -57,6 +57,7 @@ Here's a diagram of what the final result will look like: 1. You need to have docker installed on one machine. 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 @@ -65,21 +66,23 @@ following configs are turned on in your linux kernel: 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. + NOTE: The above is specifically for GRUB2. You can check the command line parameters passed to your kenel 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 ``` - ### Step One: Run etcd From 6960d82c6b18e9de04ddbb191530851c25bd7abd Mon Sep 17 00:00:00 2001 From: Avinash Sridharan Date: Sat, 1 Aug 2015 14:59:11 -0700 Subject: [PATCH 4/4] trying to fix build error --- docs/getting-started-guides/docker.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/getting-started-guides/docker.md b/docs/getting-started-guides/docker.md index 17e0d0402bf..05c638f17ca 100644 --- a/docs/getting-started-guides/docker.md +++ b/docs/getting-started-guides/docker.md @@ -59,12 +59,11 @@ Here's a diagram of what the final result will look like: 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 + 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 @@ -74,12 +73,12 @@ parameters as follows: GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1" ``` - NOTE: The above is specifically for GRUB2. + NOTE: The above is specifically for GRUB2. You can check the command line parameters passed to your kenel by looking at the output of /proc/cmdline: ```console - $cat /proc/cmdline + $cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-3.18.4-aufs root=/dev/sda5 ro cgroup_enable=memory swapaccount=1 ```