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

Allow CR to handle manifest patches #329

Open
kramvan1 opened this issue Mar 6, 2020 · 2 comments
Open

Allow CR to handle manifest patches #329

kramvan1 opened this issue Mar 6, 2020 · 2 comments

Comments

@kramvan1
Copy link

kramvan1 commented Mar 6, 2020

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

@aliok
Copy link
Member

aliok commented Mar 10, 2020

Related: #302

@houshengbo
Copy link

We would like implement on a use case based approach, instead of offering one powerful way to override everything.
Another related topic: knative/operator#5

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

3 participants