fix intermittent calico failures during k8s-bootstrap#175
Merged
ArangoGutierrez merged 1 commit intomainfrom Sep 26, 2024
Merged
fix intermittent calico failures during k8s-bootstrap#175ArangoGutierrez merged 1 commit intomainfrom
ArangoGutierrez merged 1 commit intomainfrom
Conversation
Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com>
ArangoGutierrez
approved these changes
Sep 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR hopefully fixes some of the flakes we have observed when deploying calico on a newly created K8s cluster.
The root cause of the failure is that the
kubectl --kubeconfig $KUBECONFIG create -f https://raw.githubusercontent.com/projectcalico/calico/${CALICO_VERSION}/manifests/custom-resources.yamlcommand fails as the cluster doesn't immediately recognise one of the custom resource kinds (defined by the CRD created in the previous step) as there seems to be some delay in CRD creation going through after issuing the kubectl create command of the same. This failure prompts a retry which ultimately fails as it also retries creating custom resources which were already created successfully in the first attempt.This PR applies a two-fold fix
i) Run
kubectl applyinstead ofkubectl createas it is idempotent and declarativeii) Sleep 10s after the Calico CRDs are created so that the new kinds are fully registered in the cluster etcd