Fix kubectl drain command on puppet manifest

The k8s upgrade shows error during upgrade abort with an error
on the "kubectl drain" command [1]. The commit that introduced
this issue is likely [2].

This commit fix the "kubectl drain" command.

[1]: f65f702ffd/puppet-manifests/src/modules/platform/manifests/kubernetes.pp (L1709)
[2]: 578b64b6ee

Test Plan
PASS: start k8s upgrade, upgrade control plane, abort the upgrade
      and verify that cordon.log shows no errors
PASS: start k8s orchestrated upgrade, verify that cordon.log shows
      no errors after kube upgrade strategy fails

Closes-bug: 2049505

Change-Id: Id376ae991c66300481c99f86c4e6020f7b7ac5af
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
This commit is contained in:
Heitor Matsui
2024-01-16 09:17:29 -03:00
parent f65f702ffd
commit 80dacd3b2c

View File

@@ -1706,7 +1706,7 @@ class platform::kubernetes::cordon_node {
# unsatisfied pod-disruption-budget, and may also run long if there
# are lots of pods to drain, so limit operation to 150 seconds.
platform::kubernetes::kube_command { 'drain the node':
command => "kubectl -drain ${::platform::params::hostname} \
command => "kubectl drain ${::platform::params::hostname} \
--ignore-daemonsets --delete-emptydir-data \
--skip-wait-for-delete-timeout=10 \
--force --timeout=150s",