kube-libsonnet icon indicating copy to clipboard operation
kube-libsonnet copied to clipboard

Deployment: remove replicas=1

Open chengchengmu opened this issue 2 years ago • 1 comments

Description

This PR removes the replicas: 1 inside the Deployment object.

Motivation

For Horizontal Pod Autoscaler to work properly with gitops systems such as ArgoCD, FluxCD, Deployment objects shouldnt' have replicas set. The default replicas is 1 so this is safe to be removed. Also it appears that it is not easy to remove a field in jsonnet once it is set, so it is better to just not set it.

References

  • Linked issue: https://github.com/bitnami-labs/kube-libsonnet/issues/58
  • ArgoCD: https://argo-cd.readthedocs.io/en/stable/user-guide/best_practices/#leaving-room-for-imperativeness
  • FluxCD: https://argo-cd.readthedocs.io/en/stable/user-guide/best_practices/#leaving-room-for-imperativeness
  • Remove a field from jsonnet issue: https://github.com/google/jsonnet/issues/312

chengchengmu avatar Apr 20 '22 10:04 chengchengmu

Thanks @jjo !

@jbianquetti-nami do you mind taking a look at this tiny PR when you get a chance ?

chengchengmu avatar Apr 20 '22 12:04 chengchengmu