Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm setting up a kubernetes cluster using lxc container while I was configuring master node with kubeadm init it is showing the following error:-
kubeadm init --apiserver-advertise-address=10.102.126.160 --pod-network-cidr=192.168.0.0/16
[init] Using Kubernetes version: v1.13.1
[preflight] Running pre-flight checks
[preflight] The system verification failed. Printing the output from the verification:
KERNEL_VERSION: 4.15.0-43-generic
DOCKER_VERSION: 18.06.1-ce
DOCKER_GRAPH_DRIVER: overlay2
OS: Linux
CGROUPS_CPU: enabled
CGROUPS_CPUACCT: enabled
CGROUPS_CPUSET: enabled
CGROUPS_DEVICES: enabled
CGROUPS_FREEZER: enabled
CGROUPS_MEMORY: enabled
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist
[ERROR Swap]: running with swap on is not supported. Please disable swap
[ERROR SystemVerification]: failed to parse kernel config: unable to load kernel module: "configs", output: "modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.15.0-43-generic/modules.dep.bin'\nmodprobe: FATAL: Module configs not found in directory /lib/modules/4.15.0-43-generic\n", err: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
Can anyone help me out to solve this issue.
To run kubernetes inside lxc container
you need to do some configuration first, like there is no kernel module
in lxc container, so you need to use overlay
driver for docker. Also, your swap is ON you need to disable it using swapoff -a
. There are many of these configuration you need to do before installing kubernetes cluster using kubeadm.
Here is the very nice blog explaining step by step configuration in lxc container:
https://medium.com/@kvapss/run-kubernetes-in-lxc-container-f04aa94b6c9c
You can see all this stuff in this lxc profile that you should pass when you create your containers.
lxc launch images:ubuntu/16.04 CONTAINER_NAME --profile PROFILE_NAME
But your big big problem is run the Kubelet into a lxc container. Kubelet logs will show something like that:
failed to start OOM watcher open /dev/kmsg: no such file or directory
If you get this error you should do a little hack because the /dev/kmsg
character device is not created by default. You can create this device with following command:
mknod /dev/kmsg c 1 11
Maybe a kernel image update is needed. You can go through the whole process in these scripts for ubuntu 16.04
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.