Skip to content

Resolve "Gitlab doesn't detect the deployment pods after K8s cluster upgrade to v1.22"

What does this MR do and why?

The extensions/v1beta1 was removed on Kubernetes 1.22: https://kubernetes.io/blog/2021/07/14/upcoming-changes-in-kubernetes-1-22/

Whenever we call extensions_client.discover the code raises a 404 not found and we fail to load deployments and ingresses. Consequently our deploy_boards also fail.

The fix is simply to not use this client anymore, since we don't need to look for resources in this APIs anymore. We should simply use the new APIs as suggested by the Kubernetes 1.22 documentation. That is networking.k8s.io/v1 for ingresses and apps/v1 for deployments. This also works in 1.21 because these APIs were already available and being used by us on our Auto DevOps chart.

Related Issues

#357612 (closed)

Screenshots or screen recordings

Deployed the environment to K8s 1.22

Deploy Boards loads the pods correctly.

deploy_test

When toggling between master and this branch we unsee/see the pods.

branch_test

How to set up and validate locally

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #357612 (closed)

Edited by Hordur Freyr Yngvason

Merge request reports