From d55af93eba7d35b073843892064e295ca6fc0456 Mon Sep 17 00:00:00 2001 From: Arthur Outhenin-Chalandre Date: Sun, 12 Jan 2020 23:11:58 +0100 Subject: [PATCH 1/2] Fix kube-proxy removal * Fix unwanted skipped task for kube-proxy * Fix kube_proxy_remove default Signed-off-by: Arthur Outhenin-Chalandre --- roles/kubernetes/kubeadm/defaults/main.yml | 3 --- roles/kubernetes/kubeadm/tasks/main.yml | 1 - roles/kubernetes/node/defaults/main.yml | 3 --- roles/win_nodes/kubernetes_patch/defaults/main.yml | 2 -- 4 files changed, 9 deletions(-) diff --git a/roles/kubernetes/kubeadm/defaults/main.yml b/roles/kubernetes/kubeadm/defaults/main.yml index 988cbc594ad..9dc577edfda 100644 --- a/roles/kubernetes/kubeadm/defaults/main.yml +++ b/roles/kubernetes/kubeadm/defaults/main.yml @@ -4,9 +4,6 @@ discovery_timeout: 60s kubeadm_join_timeout: 120s -# Optionally remove kube_proxy installed by kubeadm -kube_proxy_remove: false - # If non-empty, will use this string as identification instead of the actual hostname kube_override_hostname: >- {%- if cloud_provider is defined and cloud_provider in [ 'aws' ] -%} diff --git a/roles/kubernetes/kubeadm/tasks/main.yml b/roles/kubernetes/kubeadm/tasks/main.yml index 3b6fe89740b..bf2c2687972 100644 --- a/roles/kubernetes/kubeadm/tasks/main.yml +++ b/roles/kubernetes/kubeadm/tasks/main.yml @@ -163,7 +163,6 @@ delegate_to: "{{ groups['kube-master']|first }}" when: - kube_proxy_remove - - kubeadm_discovery_address != kube_apiserver_endpoint | replace("https://", "") # When scaling/adding nodes in the existing k8s cluster, kube-proxy wouldn't be created, as `kubeadm init` wouldn't run. ignore_errors: true tags: diff --git a/roles/kubernetes/node/defaults/main.yml b/roles/kubernetes/node/defaults/main.yml index a529327b1fb..1bd363acc0f 100644 --- a/roles/kubernetes/node/defaults/main.yml +++ b/roles/kubernetes/node/defaults/main.yml @@ -22,9 +22,6 @@ kubelet_kubelet_cgroups: "/systemd/system.slice" ### fail with swap on (default true) kubelet_fail_swap_on: true -# Optionally remove kube_proxy installed by kubeadm -kube_proxy_remove: false - # Reserve this space for kube resources kube_memory_reserved: 256M kube_cpu_reserved: 100m diff --git a/roles/win_nodes/kubernetes_patch/defaults/main.yml b/roles/win_nodes/kubernetes_patch/defaults/main.yml index ab979d4c8b2..ad598883073 100644 --- a/roles/win_nodes/kubernetes_patch/defaults/main.yml +++ b/roles/win_nodes/kubernetes_patch/defaults/main.yml @@ -1,7 +1,5 @@ --- kubernetes_user_manifests_path: "{{ ansible_env.HOME }}/kube-manifests" -# Optionally remove kube_proxy installed by kubeadm -kube_proxy_remove: false # nodeselector for kube-proxy ds is beta until 1.18 kube_proxy_nodeselector: "{{ 'kubernetes.io/os' if kube_version is version('v1.18.0', '>=') else 'beta.kubernetes.io/os' }}" From dc47ff8c40565af6493a489446803190343a4e81 Mon Sep 17 00:00:00 2001 From: Arthur Outhenin-Chalandre Date: Thu, 28 May 2020 13:57:58 +0200 Subject: [PATCH 2/2] Add test for kube-router svc proxy Signed-off-by: Arthur Outhenin-Chalandre --- .gitlab-ci/packet.yml | 5 +++++ .../files/packet_ubuntu16-kube-router-svc-proxy.yml | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/files/packet_ubuntu16-kube-router-svc-proxy.yml diff --git a/.gitlab-ci/packet.yml b/.gitlab-ci/packet.yml index 05a3feb0302..b2b20b9adac 100644 --- a/.gitlab-ci/packet.yml +++ b/.gitlab-ci/packet.yml @@ -63,6 +63,11 @@ packet_ubuntu16-kube-router-sep: extends: .packet when: manual +packet_ubuntu16-kube-router-svc-proxy: + stage: deploy-part2 + extends: .packet + when: manual + packet_debian10-containerd: stage: deploy-part2 extends: .packet diff --git a/tests/files/packet_ubuntu16-kube-router-svc-proxy.yml b/tests/files/packet_ubuntu16-kube-router-svc-proxy.yml new file mode 100644 index 00000000000..8be6ef3f537 --- /dev/null +++ b/tests/files/packet_ubuntu16-kube-router-svc-proxy.yml @@ -0,0 +1,12 @@ +--- +# Instance settings +cloud_image: ubuntu-1604 +mode: separate + +# Kubespray settings +bootstrap_os: ubuntu +kube_network_plugin: kube-router +deploy_netchecker: true +dns_min_replicas: 1 + +kube_router_run_service_proxy: true