Add a puppet class to support k8s feature-gate update
This change adds a class to the kubernetes puppet manifest. It executes a script that updates kubernetes kubeadm-config configmap and static manifests and restarts the kube-api-server and kube-controller-manager with new feature gates. The class ensures that the api-server and the controller-manager pods are back up and healthy. Depends-On: https://review.opendev.org/c/starlingx/integ/+/845654 Test Plan: (CentOS) On AIO-SX and AIO-DX: PASS: Full platform upgrade successful PASS: Verify platform logs and puppet logs for successful execution. Story: 2009789 Task: 45626 Signed-off-by: Kaustubh Dhokte <kaustubh.dhokte@windriver.com> Change-Id: Ia789a84bf012b3e574e9319eb68293857628db28
This commit is contained in:
parent
52ace69c83
commit
1cdfd78286
@ -854,6 +854,34 @@ class platform::kubernetes::master::change_apiserver_parameters (
|
||||
}
|
||||
}
|
||||
|
||||
class platform::kubernetes::master::update_kubeadm_feature_gates (
|
||||
) inherits ::platform::kubernetes::params {
|
||||
|
||||
exec { 'update kubeadm feature-gates':
|
||||
command => '/usr/local/sbin/update-k8s-feature-gates.sh',
|
||||
logoutput => true
|
||||
}
|
||||
|
||||
# Wait for kube-apiserver to be up
|
||||
# Uses a k8s API health endpoint for that: https://kubernetes.io/docs/reference/using-api/health-checks/
|
||||
exec { 'wait_for_kube_api_server':
|
||||
command => '/usr/bin/curl -k -f -m 15 https://localhost:6443/readyz',
|
||||
timeout => 30,
|
||||
tries => 18,
|
||||
try_sleep => 5,
|
||||
require => Exec['update kubeadm feature-gates'],
|
||||
}
|
||||
# Wait for kube-controller-manager to be up.
|
||||
# The only container inside the kube-controller-manager-<hostname> pod is restarted when kube-controller-manager manifest is updated
|
||||
exec { 'wait_for_kube_controller_manager':
|
||||
command => '/usr/bin/crictl ps | grep kube-controller-manager | grep -q Running',
|
||||
timeout => 30,
|
||||
tries => 6,
|
||||
try_sleep => 5,
|
||||
require => Exec['update kubeadm feature-gates'],
|
||||
}
|
||||
}
|
||||
|
||||
class platform::kubernetes::certsans::runtime
|
||||
inherits ::platform::kubernetes::params {
|
||||
include ::platform::params
|
||||
|
Loading…
Reference in New Issue
Block a user