Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix intermittent calico failures during k8s-bootstrap #175

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

tariq1890
Copy link
Contributor

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.yaml command 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 apply instead of kubectl create as it is idempotent and declarative
ii) Sleep 10s after the Calico CRDs are created so that the new kinds are fully registered in the cluster etcd

@ArangoGutierrez ArangoGutierrez merged commit fb35c86 into main Sep 26, 2024
5 checks passed
@tariq1890 tariq1890 deleted the fix-calico-flakes branch September 26, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants