Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ cat /etc/netplan/01-netcfg.yaml 
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.2.30/24, '2001:1::1/64']
      gateway4: 192.168.2.1
      nameservers:
        addresses: [192.168.2.1]

Clone the vm

Code Block
virt-clone --original k8s-master --name k8s-w1 --auto-clone
virt-clone --original k8s-master --name k8s-w2 --auto-clone
virt-clone --original k8s-master --name k8s-w3 --auto-clone
...

Set the static ip and hostname on the clones

Code Block
hostnamectl set-hostname k8s-w1.internal.stroila.net
...


Configure the nodes

Code Block
#!/bin/sh

sudo apt update \
  && sudo apt install -qy docker.io

sudo apt install gnupg2 -y
  
sudo apt update \
  && sudo apt install -y apt-transport-https \
  && 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 -a /etc/apt/sources.list.d/kubernetes.list \
  && sudo apt update 
  
  sudo apt update \
  && sudo apt-get install -y \
  kubelet \
  kubeadm \
  kubernetes-cni


Clone the vm

Code Block
virt-clone --original k8s-master --name k8s-w1 --auto-clone
virt-clone --original k8s-master --name k8s-w2 --auto-clone
virt-clone --original k8s-master --name k8s-w3 --auto-clone
...


Set the static ip and hostname on the clones

Code Block
hostnamectl set-hostname k8s-w1.internal.stroila.net
...