Skip to content

Commit

Permalink
Use "kubeadm join" to join masters to control plane (#6661)
Browse files Browse the repository at this point in the history
Remove configuration variable kubeadm_control_plane
  • Loading branch information
hafe authored Sep 17, 2020
1 parent 0cc5e3e commit 6da385d
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 70 deletions.
2 changes: 0 additions & 2 deletions inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ kata_containers_enabled: false
kubelet_deployment_type: host
helm_deployment_type: host

# Enable kubeadm experimental control plane
kubeadm_control_plane: false
kubeadm_certificate_key: "{{ lookup('password', credentials_dir + '/kubeadm_certificate_key.creds length=64 chars=hexdigits') | lower }}"

# K8s image pull policy (imagePullPolicy)
Expand Down
1 change: 0 additions & 1 deletion roles/kubernetes/kubeadm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
include_tasks: kubeadm_etcd_node.yml
when:
- etcd_kubeadm_enabled
- kubeadm_control_plane
- inventory_hostname not in groups['kube-master']
- kube_network_plugin in ["calico", "flannel", "canal", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin != "calico" or calico_datastore == "etcd"
3 changes: 0 additions & 3 deletions roles/kubernetes/master/defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# disable upgrade cluster
upgrade_cluster_setup: false

# Enable kubeadm experimental control plane
kubeadm_control_plane: false

# Experimental kubeadm etcd deployment mode. Available only for new deployment
etcd_kubeadm_enabled: false

Expand Down
44 changes: 0 additions & 44 deletions roles/kubernetes/master/tasks/kubeadm-secondary-legacy.yml

This file was deleted.

9 changes: 2 additions & 7 deletions roles/kubernetes/master/tasks/kubeadm-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,8 @@
tags:
- kubeadm_token

- name: kubeadm | Initialize other masters (experimental control plane)
include_tasks: kubeadm-secondary-experimental.yml
when: kubeadm_control_plane

- name: kubeadm | Initialize other masters (legacy not control plane)
include_tasks: kubeadm-secondary-legacy.yml
when: not kubeadm_control_plane
- name: kubeadm | Join other masters
include_tasks: kubeadm-secondary.yml

- name: kubeadm | upgrade kubernetes cluster
include_tasks: kubeadm-upgrade.yml
Expand Down
6 changes: 0 additions & 6 deletions roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,6 @@
when: resolvconf_mode is defined
run_once: true

- name: Stop if kubeadm etcd mode is enabled but experimental control plane is not
assert:
that: kubeadm_control_plane
msg: "kubeadm etcd mode requires experimental control plane"
when: etcd_kubeadm_enabled

- name: Stop if etcd deployment type is not host or docker
assert:
that: etcd_deployment_type in ['host', 'docker']
Expand Down
3 changes: 0 additions & 3 deletions roles/kubespray-defaults/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@ kubelet_protect_kernel_defaults: true
## the k8s cluster.
kube_feature_gates: []

# Enable kubeadm experimental control plane
kubeadm_control_plane: false

# Local volume provisioner storage classes
# Levarages Ansibles string to Python datatype casting. Otherwise the dict_key isn't substituted
# see https://github.com/ansible/ansible/issues/17324
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ cloud_image: centos-7
mode: ha

# Kubespray settings
kubeadm_control_plane: true
kubeadm_certificate_key: 3998c58db6497dd17d909394e62d515368c06ec617710d02edea31c06d741085
kube_proxy_mode: iptables
kube_network_plugin: flannel
Expand Down
1 change: 0 additions & 1 deletion tests/files/packet_ubuntu16-flannel-ha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ mode: ha
# Kubespray settings
kube_network_plugin: flannel
etcd_kubeadm_enabled: true
kubeadm_control_plane: true
kubeadm_certificate_key: 3998c58db6497dd17d909394e62d515368c06ec617710d02edea31c06d741085
skip_non_kubeadm_warning: true
deploy_netchecker: true
Expand Down
1 change: 0 additions & 1 deletion tests/files/packet_ubuntu18-flannel-containerd-ha-once.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mode: ha
vm_memory: 1600Mi

# Kubespray settings
kubeadm_control_plane: true
kubeadm_certificate_key: 3998c58db6497dd17d909394e62d515368c06ec617710d02edea31c06d741085
kube_proxy_mode: iptables
kube_network_plugin: flannel
Expand Down
1 change: 0 additions & 1 deletion tests/files/packet_ubuntu18-flannel-containerd-ha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mode: ha
vm_memory: 1600Mi

# Kubespray settings
kubeadm_control_plane: true
kubeadm_certificate_key: 3998c58db6497dd17d909394e62d515368c06ec617710d02edea31c06d741085
kube_proxy_mode: iptables
kube_network_plugin: flannel
Expand Down

0 comments on commit 6da385d

Please sign in to comment.