Файлы, используемые в видео.
Установка докера
cat > install-docker-ce8.sh << EOF2 #!/bin/bash dnf install tc ipvsadm -y systemctl stop NetworkManager.service systemctl disable NetworkManager.service dnf install network-scripts dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo dnf install docker-ce --nobest -y mkdir /etc/docker cat > /etc/docker/daemon.json <<EOF { "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m" }, "storage-driver": "overlay2", "storage-opts": [ "overlay2.override_kernel_check=true" ], "iptables": false } EOF mkdir -p /etc/systemd/system/docker.service.d systemctl daemon-reload systemctl enable docker systemctl restart docker EOF2 chmod +x install-docker-ce8.sh
Установка kubernetes
cat > install-k8s-ce8.sh << EOF2 #!/bin/bash iptables -P FORWARD ACCEPT cat > /etc/modules-load.d/containerd.conf <<EOF overlay br_netfilter EOF modprobe overlay modprobe br_netfilter cat > /etc/sysctl.d/99-kubernetes-cri.conf <<EOF net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward = 1 net.bridge.bridge-nf-call-ip6tables = 1 EOF sysctl --system cat > /etc/yum.repos.d/kubernetes.repo <<EOF [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF dnf install -y kubelet kubeadm kubectl --disableexcludes=kubernetes systemctl enable kubelet.service EOF2 chmod +x install-k8s-ce8.sh
Инициализация кластера:
kubeadm init --pod-network-cidr=10.244.0.0/16
Создание токена на присоединения ноды:
kubeadm token create --print-join-command
Подготовка ноды к обслуживанию:
kubectl drain node2.kryukov.biz --ignore-daemonsets
Возврат ноды из обслуживания:
kubectl uncordon node2.kryukov.biz