Skip to content

Resolve "review-apps - Do not delete PVCs anymore"

David Dieulivol requested to merge 397680-do_not_cleanup_pvcs into master

What does this MR do and why?

Closes #397680 (closed).

  • Do not cleanup stale PVCs anymore, as they are removed when we delete the k8s namespace.
  • Add a check in scripts/review_apps/k8s-resources-count-checks.sh to verify we don't go above 800 PVCs in the cluster.

How to set up and validate locally

PVC limit set at 100 locally for testing purposes

$ scripts/review_apps/k8s-resources-count-checks.sh
[ERROR] PVCs are above 100 (currently at 532)

$ echo $?
1

PVC limit set at 800 locally (the default)

$ scripts/review_apps/k8s-resources-count-checks.sh

Show k8s resources count: 
  3032 configmaps
  3024 secrets
  2656 pods
  1575 endpoints
  1569 services
  1295 replicasets.apps
  1184 deployments.apps
  1041 poddisruptionbudgets.policy
  651 horizontalpodautoscalers.autoscaling
  524 persistentvolumeclaims
  521 ingresses.networking.k8s.io
  486 controllerrevisions.apps
  454 serviceaccounts
  391 statefulsets.apps
  283 rolebindings.rbac.authorization.k8s.io
  281 roles.rbac.authorization.k8s.io
  267 jobs.batch
  260 ingressclasses
  195 containerwatcherstatuses.containerthreatdetection.googleapis.com
  73 leases.coordination.k8s.io
  17 daemonsets.apps
  4 orders.acme.cert-manager.io
  4 certificaterequests.cert-manager.io
  2 resourcequotas
  2 networkpolicies.networking.k8s.io
  2 limitranges
  2 issuers.cert-manager.io
  2 certificates.cert-manager.io
  0 volumesnapshots.snapshot.storage.k8s.io
  0 updateinfos.nodemanagement.gke.io
  0 servicenetworkendpointgroups.networking.gke.io
  0 serviceattachments.networking.gke.io
  0 scalingpolicies.scalingpolicy.kope.io
  0 replicationcontrollers
  0 podtemplates
  0 managedcertificates.networking.gke.io
  0 frontendconfigs.networking.gke.io
  0 csistoragecapacities.storage.k8s.io
  0 cronjobs.batch
  0 challenges.acme.cert-manager.io
  0 capacityrequests.internal.autoscaling.k8s.io
  0 capacityrequests.internal.autoscaling.gke.io
  0 backendconfigs.cloud.google.com

$ echo $?
0

MR acceptance checklist

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

Merge request reports

Loading