From 82c17c081306c49bdb54653ed0f790c9d3c1e1f3 Mon Sep 17 00:00:00 2001 From: atsikham Date: Thu, 4 Feb 2021 11:08:33 +0100 Subject: [PATCH] Backported #1888 fix --- .../roles/upgrade/tasks/kubernetes/upgrade-master0.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/kubernetes/upgrade-master0.yml b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/kubernetes/upgrade-master0.yml index 3ac0e1b63e..061e14d285 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/kubernetes/upgrade-master0.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/kubernetes/upgrade-master0.yml @@ -95,6 +95,14 @@ - name: k8s/master0 | Wait for cluster's readiness include_tasks: utils/wait.yml +# Even though cluster is seen as ready here, the next task may occasionally fail with error like +# "Error from server (NotFound): the server could not find the requested resource". +# The following task prevents this issue. +- name: k8s/master0 | Refresh api-resources cache + shell: kubectl api-resources --cached=false > /dev/null + when: + - version is version('1.18', '<') + # 'kubeadm upgrade apply' overwrites Epiphany's customized CoreDNS so we patch it again. # This task restores 'hosts' plugin and should be run each time K8s was upgraded in order to support "--wait-for-pods" epicli feature (issue #1218). - name: k8s/master0 | Customize CoreDNS