Ansible role to install kubeadm and bootstrap single node Kubernetes.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Requirements
- Default Variables
- kubeadm_apiserver_certsans
- kubeadm_apiserver_endpoint
- kubeadm_calico_manifests
- kubeadm_calico_version
- kubeadm_canal_manifests
- kubeadm_canal_version
- kubeadm_cluster_config
- kubeadm_cluster_name
- kubeadm_cri_socket
- kubeadm_default_apiserver_args
- kubeadm_default_controller_args
- kubeadm_default_scheduler_args
- kubeadm_extra_apiserver_args
- kubeadm_extra_controller_args
- kubeadm_extra_scheduler_args
- kubeadm_flannel_manifests
- kubeadm_flannel_version
- kubeadm_general_networking
- kubeadm_init_config
- kubeadm_keyring
- kubeadm_kubelet_config
- kubeadm_kubelet_config_enabled
- kubeadm_kubeproxy_config
- kubeadm_kubeproxy_config_enabled
- kubeadm_kubernetes_version
- kubeadm_local_address
- kubeadm_local_port
- kubeadm_network_provider
- kubeadm_pod_subnet
- kubeadm_service_subnet
- kubectl_keyring
- kubectl_legacy_keyring
- kubectl_legacy_repo
- Discovered Tags
- Dependencies
- License
- Author
- Minimum Ansible version:
2.10
Extra sans for the apiserver
kubeadm_apiserver_certsans: []
Fixed endpoint for the controlplane
kubeadm_apiserver_endpoint: 127.0.0.1:6443
kubeadm_apiserver_endpoint: kubernetes.example.com:6443
List of manifests for calico networking
kubeadm_calico_manifests:
- https://docs.projectcalico.org/v{{ kubeadm_calico_version }}/manifests/calico.yaml
Version of calico manifest
kubeadm_calico_version: 3.21
List of manifests for canal networking
kubeadm_canal_manifests:
- https://docs.projectcalico.org/v{{ kubeadm_canal_version }}/manifests/canal.yaml
Version of canal manifest
kubeadm_canal_version: 3.21
Kubeadm cluster configuration content
kubeadm_cluster_config: |
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
clusterName: {{ kubeadm_cluster_name }}
kubernetesVersion: stable-{{ kubeadm_kubernetes_version }}
controlPlaneEndpoint: {{ kubeadm_apiserver_endpoint }}
apiServer:
extraArgs: {{ kubeadm_default_apiserver_args | combine(kubeadm_extra_apiserver_args) }}
certSANs: {{ kubeadm_apiserver_certsans | from_yaml }}
scheduler:
extraArgs: {{ kubeadm_default_scheduler_args | combine(kubeadm_extra_scheduler_args) }}
controllerManager:
extraArgs: {{ kubeadm_default_controller_args | combine(kubeadm_extra_controller_args) }}
networking:
serviceSubnet: {{ kubeadm_service_subnet }}
podSubnet: {{ kubeadm_pod_subnet }}
Name of the Kubernetes cluster
kubeadm_cluster_name: kubernetes
Path to container runtime socket
kubeadm_cri_socket: /run/containerd/containerd.sock
Default args for the apiserver
kubeadm_default_apiserver_args:
bind-address: 0.0.0.0
cloud-provider: external
authorization-mode: Node,RBAC
Default args for the controller
kubeadm_default_controller_args:
bind-address: 0.0.0.0
cloud-provider: external
Default args for the scheduler
kubeadm_default_scheduler_args:
bind-address: 0.0.0.0
Extra args for the apiserver
kubeadm_extra_apiserver_args: {}
Extra args for the controller
kubeadm_extra_controller_args: {}
Extra args for the scheduler
kubeadm_extra_scheduler_args: {}
List of manifests for flannel networking
kubeadm_flannel_manifests:
- https://raw.githubusercontent.com/flannel-io/flannel/v{{ kubeadm_flannel_version
}}/Documentation/kube-flannel.yml
Version of flannel manifest
kubeadm_flannel_version: 0.16.1
List of manifests for general networking
kubeadm_general_networking: []
Kubeadm init configuration content
kubeadm_init_config: |
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: {{ kubeadm_local_address }}
bindPort: {{ kubeadm_local_port }}
nodeRegistration:
criSocket: {{ kubeadm_cri_socket }}
name: {{ inventory_hostname }}
Path for the repository keyring
kubeadm_keyring: /usr/share/keyrings/kubernetes-v{{ kubeadm_kubernetes_version }}-archive-keyring.gpg
Kubelet configuration content, optionally available
kubeadm_kubelet_config: |
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
Enable the kublet configuration
kubeadm_kubelet_config_enabled: false
Kubeproxy configuration content, optionally available
kubeadm_kubeproxy_config: |
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
Enable the kubeproxy configuration
kubeadm_kubeproxy_config_enabled: false
Vrsion of Kubernetes to install
kubeadm_kubernetes_version: 1.29
Address to bind the controlplane to
kubeadm_local_address: 0.0.0.0
Port to bind the controlplane to
kubeadm_local_port: 6443
Name of network provider to use, could be kuberouter, flannel, calico or canal
kubeadm_network_provider: none
Used subnet for pods
kubeadm_pod_subnet: 10.244.0.0/16
Used subnet for services
kubeadm_service_subnet: 10.96.0.0/16
Path to legacy keyring which got to be removed
kubectl_legacy_keyring: /usr/share/keyrings/kubernetes-archive-keyring.gpg
Legacy repository that got to be removed
kubectl_legacy_repo: deb [signed-by={{ kubectl_legacy_keyring }}] http://apt.kubernetes.io/
kubernetes-xenial main
kubeadm
- None
Apache-2.0