Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PatchSet of composition as a different CRD #3847

Closed
venkatk-25 opened this issue Mar 10, 2023 · 5 comments
Closed

PatchSet of composition as a different CRD #3847

venkatk-25 opened this issue Mar 10, 2023 · 5 comments
Labels

Comments

@venkatk-25
Copy link

venkatk-25 commented Mar 10, 2023

Modularity/maintainability of Patchsets

For our use case we need to define a set of common patches to resources across multiple compositions. Some of our use cases

  1. defining common set of tags(few examples like one can be namespace of claimname. configuration pkg name, etc...)
  2. Defining some defaults to some MR which appears across multiple compositions.

The updation of the patchsets as a platform is not maintainable if they are not defined modularly and a change in logic of desired patch in these would result in updation of all compostions.

How could Crossplane help solve your problem?

  1. Would be great if Patchset can be made independent CRD and then referenced from different compositions, this becomes more maintainable long term.

A crd like:

apiVersion: apiextensions.crossplane.io/v1
kind: Patchset
metadata:
  name: multitenancy-patches
spec:
      patches:
      - fromFieldPath: "spec.claimRef.namespace"
        toFieldPath: "spec.providerConfigRef.name"

and compostion reference it like:

apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: sns-poc
spec:
  compositeTypeRef:
    apiVersion: jpmc.com/v1alpha1
    kind: XSns
  resources:
    - name: Topic
      base:
        apiVersion: sns.aws.crossplane.io/v1beta1
        kind: Topic
        metadata:
          name: crossplane-poc-topic
        spec:
          forProvider:
            displayName: crossplane-poc-topic
          providerConfigRef:
            name:
      patches:
        - type: PatchSet
          patchSetRef: multitenancy-patches

A trigger in the patch should trigger the updation of all the compostions referencing it. Giving a very basic example here for example.

Alternates:

  1. We could define configuration package itself as helm/or any templatization engine.and templatize the patchset and define the patchset in common template file.
  2. Define these patchsets as OPA policies instead and automatically inject into all compostions.

This is something we can do though would mean more tooling on top of packaging tools of crossplane. A more native approach would be more maintainable and helpful

@venkatk-25 venkatk-25 added the enhancement New feature or request label Mar 10, 2023
@negz
Copy link
Member

negz commented Mar 22, 2023

I think we'd need to see a little more demand for this before we prioritized it, but it seems like a reasonable idea to me.

@github-actions
Copy link

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

@github-actions github-actions bot added the stale label Jun 21, 2023
@ytsarev
Copy link
Member

ytsarev commented Jun 22, 2023

/fresh this one makes sense to me as well. Dedicated CRD for PatchSet can solve long-term problems like a common set of shared tags

@github-actions github-actions bot removed the stale label Jun 22, 2023
@garreeoke
Copy link

Love this idea!

@github-actions
Copy link

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

@github-actions github-actions bot added the stale label Oct 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants