Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Allow CR to handle manifest patches #329

@kramvan1

Description

@kramvan1

Problem

The custom resource (CR) for the knative operators should allow for tweaking all the resources deployed at the Kuberneters spec level. For example, allow for Affinity, Envs, HPA, Image pull policy, Annotations, Replicas, probes (readiness, liveness, startup), LifeCycle, Priority class, Tolerations, Request sizes...

For example, there are cases where the default deployment needs to be tweaked for a specific usage.
In one case we needed to add a Lifecycle preStop to a deployment to allow it more time to shutdown.

An example of how Istio handled this in the CR looked like this:

    ingressGateways:
    - name: istio-ingressgateway
      enabled: true
      k8s:
        overlays:
        - kind: Deployment
          name: istio-ingressgateway
          patches:
          - path: spec.template.spec.containers.[name:istio-proxy].lifecycle
            value:
              preStop:
                exec:
                  command: ["sleep", "25"]

Where ingressGateways in the high level CR component and istio-ingressgateway is the section of the manifest we are interested in patching.

The patch is straight forward, just a basic spec path and values to patch in there.

Which persona is this feature for?

integrator

Exit Criteria

See the deployment yaml output changed to include the patched values.

Time Estimate (optional):

not sure.

Additional context (optional)

Refs:
https://istio.io/docs/setup/install/standalone-operator/
https://istio.io/docs/setup/install/istioctl/#customize-kubernetes-settings

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