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

Introduce "KnExport" type for defining an export format. #824

Closed
rhuss opened this issue May 5, 2020 · 7 comments · Fixed by #856
Closed

Introduce "KnExport" type for defining an export format. #824

rhuss opened this issue May 5, 2020 · 7 comments · Fixed by #856
Assignees
Labels
kind/feature New feature or request

Comments

@rhuss
Copy link
Contributor

rhuss commented May 5, 2020

Feature request

We have now kn service export which supports two modes for exporting revision: One which is directly usable with kubectl and uses a kind of "replay of services" to build up the service-configuration-revision graph and one which exports the service and revisions directly. However, the latter can not be applied directly to Kubernetes but only with a (still to build) kn service import as it needs to fix the ownerReferences (those can't be set from the outside).

The format suggested is:

apiVersion: client.knative.dev/v1alpha1
kind: Export
meta: 
   exportDate: ....
   name: ....
kind:
   service: 
         ... // a full Knative service spec
   revisions:   // list of Knative revisions, in creation order
   - ....

Ideally, it should be registered in a schema, using the same machinery as for CRDs in order to leverage cli-runtime output formats.

For the option --mode I suggest a renaming to better reflect the purpose:

  • --mode replay --- Create a replay list of Knative Services
  • --mode export --- To specify this new format. Not sure about the value we might use a name that better fits the purpose.

The main motivation to use a dedicated export type is to make it crystal clear that one can not import a bunch of Service and its Revisions with standard k8s tooling.

@rhuss rhuss added the kind/feature New feature or request label May 5, 2020
@rhuss
Copy link
Contributor Author

rhuss commented May 5, 2020

bike shedding: I wonder whether this has to remain a client-side feature or would make also for a nice server-side feature by using this type as a real CRD ? In that case, a more "neutral" would make sense (like serving.knative.dev/Export)

@rhuss
Copy link
Contributor Author

rhuss commented May 5, 2020

Well, maybe "export" is not the right wording here, as it focuses on the direction. Maybe "Transport" or "Transfer" is better suited ?

@itsmurugappan
Copy link
Contributor

bike shedding: I wonder whether this has to remain a client-side feature or would make also for a nice server-side feature by using this type as a real CRD ? In that case, a more "neutral" would make sense (like serving.knative.dev/Export)

Server side feature means, controller would be reacting to the resource created right ? Then would'nt that work with kubectl apply itself ?

whether we have it at the client or server, crd needs to be packaged with serving install scripts.

@rhuss
Copy link
Contributor Author

rhuss commented May 5, 2020

Yes, it would then work with kubectl as well, but then also "properly" as the server side controller is expected to set up the proper ownerrefs.

When we only use it only client side than no CRD is required. Its all about the client translating this yaml to the appropriate Knative Services and Revisions and apply them when using kn import. That way, if you use kubectl you will get an error because of an unkown type (so only kn can make sense out of the type).

@itsmurugappan
Copy link
Contributor

for leveraging the cli-runtime output formats we need the crd right ?

@rhuss
Copy link
Contributor Author

rhuss commented May 6, 2020

Yes, but that does not have to be registered at the server but only locally in the code via a schema . The idea to leverage the CRD machinery on the client side without actually deploying the CRD to the server.

@itsmurugappan
Copy link
Contributor

/assign @itsmurugappan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants