Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.
This repository was 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

Description

@ghostsquad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions