Kubernetes cluster deployment formula.
-
Vars and helpers:
-
Core formulas:
-
Core
- kubernetes v1.30.8
- etcd v3.5.17
- containerd v1.6.26
- crictl v1.30.0
-
Network Plugin
- cni-plugins v1.6.2
- flannel v0.26.3
Target minion should have the following grains configured:
kubernetes:
clustername: local
roles:
- kube-master
- kube-cluster-member
See: https://docs.saltproject.io/en/latest/topics/grains/index.html#grains-in-etc-salt-grains
Navigate to /etc/salt/master.d
and create a file called nodegroups.conf
with these contents:
nodegroups:
kubernetes: 'G@roles:kube-cluster-member or G@roles:kube-node-proxier'
Then restart salt-master
service:
systemctl restart salt-master
See: https://docs.saltproject.io/en/latest/topics/targeting/nodegroups.html
- Add the following content to the pillar's
top.sls
file:
base:
kubernetes:
- match: nodegroup
- containerd
- crictl
- etcd
- flannel
- cni
- kubernetes
'roles:kube-master':
- match: grain
- kubernetes/mine
- Open
kubernetes/mine.sls
and replacekube0
with the default interface name of the cluster members. For a single-machine installation, leave it default and configure a dummy interfacekube0
in/etc/network/interfaces
:
# Kubernetes dummy interface
auto kube0
iface kube0 inet static
address 10.81.10.1/24
pre-up ip link add $IFACE type dummy
pre-up ip link set $IFACE multicast on
Then bring the interface up:
ifup kube0
- Populate the Salt Mine with data:
salt -N kubernetes saltutil.refresh_all
salt -N kubernetes mine.update
See: https://docs.saltproject.io/en/latest/topics/mine/index.html