vmware-tanzu / cartographer-conventions

Conventions provide a mechanism for platform operators to define cross cutting behavior that is applied to Kubernetes resources by understanding the developers intent and the semantics of the resources being advised.
Apache License 2.0
16 stars 8 forks source link

Explore ytt based conventions #58

Open scothis opened 2 years ago

scothis commented 2 years ago

The current approach to defining an opinion source is via a webhook to a remote process. While flexible, this approach introduces networks and misconfigurations that can affect system stability. We should also explore ytt as a mechanism to run arbitrary code safely within the controller process.

Open questions:

Proposed approach:

apiVersion: conventions.carto.run/v1alpha1
kind: ClusterPodConvention
metadata:
  name: ytt-sample
spec:
  ytt:
    template: |
      ...inlined ytt...

The .spec.webhook section would remain, but be mutually exclusive with .spec.ytt.

The structure being templated is the PodTemplateSpec, with image metadata exposed as a ytt value.

vrabbi commented 2 years ago

This would be amazing. I can think of a bunch of use cases this would solve for me and would be much easier to implement custom conventions

cpage-pivotal commented 2 years ago

Yes please! Being able to quickly implement template-based conventions with ytt is going to be extremely accessible to end users, and allow ops teams to realize enormous value from supply chains.