Skip to content

mmontes11/k8s-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

193 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ k8s-bootstrap

CI Release

Bootstrap Kubernetes clusters using kubeadm.

The workload cluster is bootstrapped by Flux using the k8s-infrastructure repository.

Alternative installation flavours

System compatibility

This Kubernetes installation has been verified on Ubuntu 24.04.

Node preparation

Execute the provided script on all nodes (both control plane and worker nodes) prior to starting the installation process:

sudo bash node-prepare.sh

Once completed, reboot the node and proceed with the installation.

Installation

Setup the control-plane by running:

sudo bash control-plane.sh

Copy the kubeadm configuration files config/kubeadm-join.<node-type>.yaml to each node and run this command to join the cluster:

sudo bash node.sh 'config/kubeadm-join.<node-type>.yaml' 

Run this on the control-plane for bootstrapping the infrastructure:

export GITHUB_USER=mmontes11
export GITHUB_REPO=k8s-infrastructure 
export GITHUB_BRANCH=main
export GITHUB_PATH=clusters/homelab
export GITHUB_TOKEN=<your-personal-access-token>
./bootstrap.sh

Add worker node to a existing Talos cluster

Generate the Kubernetes configuration files from the Talos control-plane and copy them to the target node:

TALOS_CONTROLPLANE=<host> \
TARGET_NODE=<host> \
KUBELET_EXTRA_ARGS="--node-labels=node.mmontes.io/type=<type> --register-with-taints=node.mmontes.io/type=<type>:NoSchedule" \
./scripts/talos-config.sh

Run this command in the target node to join the cluster:

sudo \
SKIP_KUBEADM_JOIN="true" \
bash node.sh

Upgrade worker node

Run the following commands to upgrade containerd and kubelet in a worker node:

sudo \
UPGRADE="1" \
CONTAINERD_VERSION="2.2.1-1~ubuntu.24.04~noble" \
bash scripts/containerd.sh
sudo \
UPGRADE="1" \
KUBERNETES_VERSION="v1.35" \
KUBERNETES_PKG="1.35.0-1.1" \
bash scripts/kubernetes.sh

Kubeconfig

admin and super-admin kubeconfigs are available in the following control-plane paths:

  • /etc/kubernetes/admin.conf
  • /etc/kubernetes/super-admin.conf

This article depicts the differences between them.