Site Tools


linux:ubuntu:kubernetes

This is an old revision of the document!


Kubernetes

Installation

Add the Repository,install “kubelet” + “kubeadm” + “kubectl” and set the updates on hold

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \
  echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list && \
  sudo apt-get update -q && \
  sudo apt-get install -qy kubelet kubeadm kubectl
  apt-mark hold kubelet kubeadm kubectl
<code>

===== Configuration =====

==== master ====

Pull images used by kubeadm
<code>
kubeadm config images pull

Set up the ip configuration, the “apiserver-advertise-address” has to be your management ip

kubeadm init --apiserver-advertise-address=10.0.0.1 --pod-network-cidr=192.168.0.0/16                               
kubeadm init --pod-network-cidr=192.168.0.0/16

You may run into the following warnings and errors

[init] Using Kubernetes version: v1.16.2
[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
        [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.4. Latest validated version: 18.09
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

To fix the error, disable swap

swapoff -a

#should be 0 now
free -m
              total        used        free      shared  buff/cache   available
Mem:           xxxx         xxx        xxxx         xxx        xxxx        xxxx
Swap:             0           0           0

Execute the ip configuration again, which should now be possible.

Commands

Command Function
Placeholder Placeholder

Troubleshooting

Placeholder

Reason:

Fix:


Offene Fragen...

  • cgroup driver?!

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#configure-cgroup-driver-used-by-kubelet-on-control-plane-node

Please mind, that you only have to do that if the cgroup driver of your CRI is not cgroupfs, because that is the default value in the kubelet already.

ABER

[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at https://kubernetes.io/docs/setup/cri/

  • validated version of docker?

[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.4. Latest validated version: 18.09

  • management ip

https://github.com/kubernetes/kubernetes/issues/33618

linux/ubuntu/kubernetes.1571788738.txt.gz · Last modified: 2019/10/23 01:58 by lunetikk