From 10e71cdb94154bd8f6a3aa63b3f84322fe6bc42f Mon Sep 17 00:00:00 2001 From: Ray Bejjani Date: Fri, 24 Apr 2020 15:20:05 +0200 Subject: [PATCH] CI: Restart all kube-system pods in GKE Some of these pods are scheduled before cilium and are never managed. They still have issues, however, and some are cricital to the cluster's health. Signed-off-by: Ray Bejjani --- test/k8sT/assertionHelpers.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/k8sT/assertionHelpers.go b/test/k8sT/assertionHelpers.go index cca32d319a45..497ec8e5e6d8 100644 --- a/test/k8sT/assertionHelpers.go +++ b/test/k8sT/assertionHelpers.go @@ -120,6 +120,11 @@ func DeployCiliumOptionsAndDNS(vm *helpers.Kubectl, ciliumFilename string, optio By(fmt.Sprintf("%s (hint: %s)", "Assuming that microk8s already has DNS deployed...", "Use 'microk8s.enable dns' to create deployment")) + case helpers.CIIntegrationGKE: + By("Restarting all kube-system pods") + if res := vm.DeleteResource("pod", fmt.Sprintf("-n %s --all", helpers.KubeSystemNamespace)); !res.WasSuccessful() { + log.Warningf("Unable to delete kube-system pods: %s", res.OutputPrettyPrint()) + } default: vm.ApplyDefault(helpers.DNSDeployment(vm.BasePath())) By("Restarting DNS Pods") @@ -138,6 +143,12 @@ func DeployCiliumOptionsAndDNS(vm *helpers.Kubectl, ciliumFilename string, optio ExpectCiliumReady(vm) ExpectCiliumOperatorReady(vm) ExpectKubeDNSReady(vm) + + switch helpers.GetCurrentIntegration() { + case helpers.CIIntegrationGKE: + err := vm.WaitforPods(helpers.KubeSystemNamespace, "", longTimeout) + ExpectWithOffset(1, err).Should(BeNil(), "kube-system pods were not able to get into ready state after restart") + } } // SkipIfBenchmark will skip the test if benchmark is not specified