From d20f19788471b7279b76ee03405821892da6f259 Mon Sep 17 00:00:00 2001 From: Priit Liivak Date: Thu, 20 Sep 2018 22:44:27 +0300 Subject: [PATCH 1/5] Update master-setup.yml Add option for additional kubeadm init options --- tasks/master-setup.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index 416c6c2..5e4fd52 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -6,6 +6,8 @@ --apiserver-advertise-address={{ kubernetes_apiserver_advertise_address | default(ansible_default_ipv4.address) }} --kubernetes-version {{ kubernetes_version }} --ignore-preflight-errors={{ kubernetes_ignore_preflight_errors }} + {{ kubeadm_init_opts }} + register: kubeadmin_init failed_when: False when: kubernetes_init_stat.stat.exists == False From 3ef362e5f5b2061045f8a59b5c033098fd35deba Mon Sep 17 00:00:00 2001 From: Priit Liivak Date: Thu, 20 Sep 2018 22:45:29 +0300 Subject: [PATCH 2/5] Update main.yml kubeadm_init_opts default value --- defaults/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 7804c12..cd59427 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,6 +12,8 @@ kubernetes_packages: kubernetes_role: master kubernetes_kubelet_extra_args: "" +# Any additional options for kubeadm init +kubeadm_init_opts: "" kubernetes_allow_pods_on_master: True kubernetes_enable_web_ui: True From 192e4cb431f4a7110302bd7561c5ae9c4cf5509d Mon Sep 17 00:00:00 2001 From: priitliivak Date: Fri, 28 Sep 2018 10:56:37 +0300 Subject: [PATCH 3/5] Changes for the comments under PR #19 --- README.md | 4 ++++ defaults/main.yml | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e93d6b2..a39be0c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ Whether the particular server will serve as a Kubernetes `master` (default) or ` Extra args to pass to `kubelet` during startup. E.g. to allow `kubelet` to start up even if there is swap is enabled on your server, set this to: `"--fail-swap-on=false"`. Or to specify the node-ip advertised by `kubelet`, set this to `"--node-ip={{ ansible_host }}"`. + kubernetes_kubeadm_init_extra_opts: "" + +Extra args to pass to `kubeadm init` during K8s control plane initialization. E.g. to specify extra Subject Alternative Names for API server certificate, set this to: `"--apiserver-cert-extra-sans my-custom.host"` + kubernetes_allow_pods_on_master: True Whether to remove the taint that denies pods from being deployed to the Kubernetes master. If you have a single-node cluster, this should definitely be `True`. Otherwise, set to `False` if you want a dedicated Kubernetes master which doesn't run any other pods. diff --git a/defaults/main.yml b/defaults/main.yml index cd59427..d11ef3b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,8 +12,7 @@ kubernetes_packages: kubernetes_role: master kubernetes_kubelet_extra_args: "" -# Any additional options for kubeadm init -kubeadm_init_opts: "" +kubernetes_kubeadm_init_extra_opts: "" kubernetes_allow_pods_on_master: True kubernetes_enable_web_ui: True From 6c9bed7b7e7b48d1a8c5128f41eb86e4963ef115 Mon Sep 17 00:00:00 2001 From: priitliivak Date: Fri, 28 Sep 2018 12:56:27 +0300 Subject: [PATCH 4/5] Fixing lint issues --- tasks/master-setup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index 4950d61..1bde7c0 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -7,7 +7,7 @@ --kubernetes-version {{ kubernetes_version_kubeadm }} --ignore-preflight-errors={{ kubernetes_ignore_preflight_errors }} {{ kubeadm_init_opts }} - + register: kubeadmin_init failed_when: false when: kubernetes_init_stat.stat.exists == false From d7a605ed5613dac616ac3db516cb220f8c8b8f9f Mon Sep 17 00:00:00 2001 From: priitliivak Date: Fri, 28 Sep 2018 13:02:31 +0300 Subject: [PATCH 5/5] incredibly sloppy day. --- tasks/master-setup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/master-setup.yml b/tasks/master-setup.yml index 1bde7c0..05146df 100644 --- a/tasks/master-setup.yml +++ b/tasks/master-setup.yml @@ -6,7 +6,7 @@ --apiserver-advertise-address={{ kubernetes_apiserver_advertise_address | default(ansible_default_ipv4.address) }} --kubernetes-version {{ kubernetes_version_kubeadm }} --ignore-preflight-errors={{ kubernetes_ignore_preflight_errors }} - {{ kubeadm_init_opts }} + {{ kubernetes_kubeadm_init_extra_opts }} register: kubeadmin_init failed_when: false