Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Defaulting to replicas: 1 in a deployment is detrimental #58

Open
ghostsquad opened this issue Jan 22, 2021 · 0 comments
Open

Defaulting to replicas: 1 in a deployment is detrimental #58

ghostsquad opened this issue Jan 22, 2021 · 0 comments

Comments

@ghostsquad
Copy link

ghostsquad commented Jan 22, 2021

https://github.com/bitnami-labs/kube-libsonnet/blob/master/kube.libsonnet#L448

Since it's not easy to remove fields from a jsonnet obj (google/jsonnet#312), and there's different behavior between:

replicas: null

and when the replicas field is missing.

In the latter case, the field isn't changed in the resulting object in Kubernetes. Thus, if you have a deployment replica count managed by an HPA (or similar), you want to exclude that field.

When a deployment is first deployed and the field doesn't exist, it it set to 1 in the final object in k8s.
If the deployment already exists and the field doesn't exist in the manifest being reapplied, the field remains unchanged.

replicas: null is essentially equivalent to replicas: 1.

So there's no way, if using this library to easily remove the replicas field in order to get the desired behavior of having that field managed externally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant