You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-27Lines changed: 44 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,17 @@
7
7
8
8
This ansible role will install and configure a high available Kubernetes cluster. This repo automate the installation process of Kubernetes using [kubeadm](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/).
9
9
10
-
This repo is only a example on how to use Ansible automation to install and configure a Kubernetes cluster. For a production environment use [Kubespray](https://kubernetes.io/docs/setup/production-environment/tools/kubespray/)
10
+
This repo is only a example on how to use Ansible automation to install and configure a Kubernetes cluster. For a production environment use [Kubespray](https://kubespray.io)
|`kubernetes_subnet`|`yes`|`192.168.25.0/24`| Subnet where Kubernetess will be deployed. If the VM or bare metal server has more than one interface, Ansible will filter the interface used by Kubernetes based on the interface subnet |
33
-
|`disable_firewall`|`no`|`no`| If set to yes Ansible will disable the firewall. |
34
-
|`kubernetes_version`|`no`|`1.25.0`| Kubernetes version to install |
35
-
|`kubernetes_cri`|`no`|`containerd`| Kubernetes [CRI](https://kubernetes.io/docs/concepts/architecture/cri/) to install. |
36
-
|`kubernetes_cni`|`no`|`flannel`| Kubernetes [CNI](https://github.com/containernetworking/cni) to install. |
37
-
|`kubernetes_dns_domain`|`no`|`cluster.local`| Kubernetes default DNS domain |
38
-
|`kubernetes_pod_subnet`|`no`|`10.244.0.0/16`| Kubernetes pod subnet |
39
-
|`kubernetes_service_subnet`|`no`|`10.96.0.0/12`| Kubernetes service subnet |
40
-
|`kubernetes_api_port`|`no`|`6443`| kubeapi listen port |
41
-
|`setup_vip`|`no`|`no`| Setup kubernetes VIP addres using [kube-vip](https://kube-vip.io/)|
42
-
|`kubernetes_vip_ip`|`no`|`192.168.25.225`|**Required** if setup_vip is set to *yes*. Vip ip address for the control plane |
43
-
|`kubevip_version`|`no`|`v0.4.3`| kube-vip container version |
|`nginx_ingress_real_ip_cidr`|`no`|`0.0.0.0/0`|**Required** if enable_nginx_real_ip is set to *yes* Trusted subnet to use with the real-ip module |
53
-
|`nginx_ingress_proxy_body_size`|`no`|`20m`| nginx ingress controller max proxy body size |
54
-
|`sans_base`|`no`|`[list of values, see defaults/main.yml]`| list of ip addresses or FQDN uset to sign the kube-api certificate |
40
+
| Var | Default | Desc |
41
+
| ------- | ----------- | ----------- |
42
+
|`disable_firewall`| If set to yes Ansible will disable the firewall. |
43
+
|`disable_selinux`|`yes`| If set to yes Ansible will disable Selinux on RedHat based distro. Default `yes`[Ref.](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)|
44
+
|`kubernetes_version`|`1.31.4`| Kubernetes version to install |
|`kubernetes_pause_image`|`registry.k8s.io/pause:3.10`| Default `pause` image version (includes registry). Needed to solve [this](https://github.com/kubernetes/kubeadm/issues/3146) issue. |
47
+
|`kubernetes_cri`|`containerd`| Kubernetes [CRI](https://kubernetes.io/docs/concepts/architecture/cri/) to install. |
48
+
|`kubernetes_cni`|`flannel`| Kubernetes [CNI](https://github.com/containernetworking/cni) to install. |
49
+
|`flannel_version`|`v0.26.2`| Required if `kubernetes_cni` is set to `flannel`. Documentation available [here](https://github.com/flannel-io/flannel)|
50
+
|`kubernetes_dns_domain`|`cluster.local`| Kubernetes default DNS domain |
51
+
|`kubernetes_pod_subnet`|`10.244.0.0/16`| Kubernetes pod subnet |
52
+
|`kubernetes_service_subnet`|`10.96.0.0/12`| Kubernetes service subnet |
53
+
|`kubernetes_api_port`|`6443`| kubeapi listen port |
54
+
|`kubernetes_subnet`|`192.168.25.0/24`| Subnet where Kubernetess will be deployed. If the VM or bare metal server has more than one interface, Ansible will filter the interface used by Kubernetes based on the interface subnet |
55
+
|`setup_vip`| Setup kubernetes VIP addres using [kube-vip](https://kube-vip.io/)|
56
+
|`kubernetes_vip_ip`|`192.168.25.225`|**Required** if setup_vip is set to *yes*. Vip ip address for the control plane |
57
+
|`kubevip_version`|`v0.8.7`| kube-vip container version |
|`nginx_ingress_real_ip_cidr`|`0.0.0.0/0`|**Required** if enable_nginx_real_ip is set to *yes* Trusted subnet to use with the real-ip module |
67
+
|`nginx_ingress_proxy_body_size`|`20m`| nginx ingress controller max proxy body size |
68
+
|`sans_base`|`[list of values, see defaults/main.yml]`| list of ip addresses or FQDN uset to sign the kube-api certificate |
55
69
56
70
## Extra Variables
57
71
@@ -86,7 +100,10 @@ In the Vagrantfile you can inject your public ssh key directly in the authorized
86
100
87
101
## Using this role
88
102
89
-
To use this role you follow the example in the [examples/](examples/) dir. Adjust the hosts.ini file with your hosts and run the playbook:
103
+
To use this role you follow the example in the [examples/](examples/) dir.
104
+
On the very first run add the extra variable parameter `-e kubernetes_init_host=<HOSTNAME>` to the `ansible-playbook` command where HOSTNAME is the hostname where the k8s cluster will be initialized.
105
+
106
+
Adjust the example hosts.ini file with your hosts and run the playbook:
0 commit comments