K8s environment cannot be initiated

I want to initiate a k8s cluster.

Steps:
Opened UDP500/4500 ingress/egress

  1. Rancher Server installation:
    docker run -d -p 8080:8080 rancher/server:stable

  2. Installed k8s supported docker on host:
    curl https://releases.rancher.com/install-docker/1.12.sh | sh

  3. Adding node:
    sudo docker run -e CATTLE_AGENT_IP=“10.132.0.3” --rm --privileged -v /var/run/docker
    .sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.2 http://rancher.kloia.com:8080/
    v1/scripts/xxxxxxx:xxxxxxxxx:xxxxxxxxxxxxx

On Rancher Dashboard seems initiated but practically no:

kubectl get nodes
NAME STATUS AGE
rancher-wpress-k8s-01.c.big-rig-163913.internal NotReady 14m

What can i be missing?

Let’s see if we can figure out what’s going on in your environment. Could you supply the following?

  • What OS are you running?
  • Where are you running (Bare-metal/VM/on-prem/cloud)
  • What’s the status of the host (Infrastructure -> Hosts)
  • What’s the status of the Infrastructure Stacks? (Kubernetes -> Infrastructure Stacks)
  • Can you supply the output of kubectl get events?

Thanks for the reply, here are the answers:

Debian
Google Cloud Instances
Host is active and all green
Infrastructure stacks all green
Output of kubectl get events: Can’t find mounted memory cgroups

Ok, I guess this is Debian 8 (Jessie) and the stock kernel we’re talking about?

This kernel does not have memory cgroups enabled by default, which fails the initalization of Kubernetes. If you want to stay on Debian and the stock kernel, you can edit /etc/default/grub so that the line GRUB_CMDLINE_LINUX contains
cgroup_enable=memory i.e. GRUB_CMDLINE_LINUX="blablabla cgroup_enable=memory". After this, run sudo update-grub2 and reboot. Your setup should be coming online.

Otherwise you could pick a OS with those Linux kernel defaults (and a more recent kernel) like RancherOS or Ubuntu.

I get an error when I try to launch kubernetes hosts with RancherOS 1.0.1

(Expected state running but got error: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:258: applying cgroup configuration for process caused \"mountpoint for cgroup not found\"") 

This is a fresh installation of a Rancher HA cluster.

Here’s a screenshot:

I can’t SSH into the container either since I get the following error:

PTY allocation request failed on channel 0

To fix this, I deleted all the hosts and used Ubuntu 16.04 … it seems that if you want Kubernetes, use Ubuntu.

The problem here is that RancherOS v1.0.1 runs Docker 17.03.1-ce by default, and this version is not supported by Kubernetes. If you want to run Kubernetes on RancherOS please run sudo ros engine switch docker-1.12.6 to switch to a supported version of Docker.

2 Likes

This means I should change the docker version of the new added host?

Yep, you can use sudo ros engine switch docker-1.12.6 on the cmdline or use cloudconfig

#cloud-config
rancher:
  docker:
    engine: docker-1.12.6

http://rancher.com/docs/os/configuration/switching-docker-versions/

I’m getting the same error as siggi after adding an Oracle Linux host to a K8 environment. The docker version of the host was 17.05.0-ce, which I now realize is not supported. However, after that, I couldn’t run any docker containers, in or out of rancher, e.g.

docker run hello-world failed with:

docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:258: applying cgroup configuration for process caused \"mountpoint for devices not found\"".

I tried reinstalling docker, but now the docker daemon won’t startup (fails with the cgroup mount). Any ideas how to resolve this?

What version of Oracle Linux? cat /etc/os-release + uname -r would be nice to know. Sounds similar to https://github.com/moby/moby/issues/14353, but that’s a pretty old issue.

cat /etc/os-release:

NAME="Oracle Linux Server"
VERSION="7.1"
ID="ol"
VERSION_ID="7.1"
PRETTY_NAME="Oracle Linux Server 7.1"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:1"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.1
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.1

uname -r:

3.10.0-514.26.2.el7.x86_64