Ansible Role: k8s_cluster

This role is used to create (or expand) a Kubernetes cluster using kubeadm.

Cilium

This role uses Cilium as Container Networking Infrastructure (CNI) plugin, and by default sets up the following features:

  • BGP Control Plane: enabled to allow advertising LoadBalancer IP addresses to routers using BGP peering.

  • Gateway API support is enabled by default, allowing Cilium to be used as backend for Gateway resources.

  • Kube-Proxy replacement is enabled to allow the above features.

Variables

Variable

Required

Description

k8s_cluster_join_token

Yes

Token used to join additional worker nodes to the Kubernetes cluster. Generate with kubeadm token generate.

k8s_cluster_node_role

Yes

Role of the target host. Set to control-plane for the (single!) control plane node, and to worker for the other cluster members.

k8s_cluster_node_taints

No

List of taints to apply to the target host.

k8s_cluster_node_pod_limit

No

The maximum number of Pods that Kubernetes will schedule on a single Node.

k8s_cluster_version

No

Kubernetes version to use when bootstrapping the cluster. Note: when adding additional cluster members later, make sure to use the same version!

k8s_cluster_name

No

Name of the Kubernetes cluster.

k8s_cluster_domain

No

Internal DNS domain for the cluster.

k8s_cluster_pod_network_cidr

No

Subnet used for IP address allocation of Pods.

k8s_cluster_service_network_cidr

No

Subnet used for IP address allocation of Services with type ClusterIP.

k8s_cluster_cilium_cli_version

No

Version of the Cilium CLI installed on the control-plane node.

k8s_cluster_cilium_version

No

Version of Cilium to use when bootstrapping the cluster.

k8s_cluster_helm_version

No

Version of the Helm CLI installed on the control-plane node.