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 AppDefinition CRD #19

Closed
cppforlife opened this issue Jul 16, 2020 · 8 comments
Closed

introduce AppDefinition CRD #19

cppforlife opened this issue Jul 16, 2020 · 8 comments
Labels
enhancement This issue is a feature request

Comments

@cppforlife
Copy link
Contributor

cppforlife commented Jul 16, 2020

AppDefinition allows to expose App creation as a dedicated CRD so that "configuration details" are hidden from the App creator. For example:

AppDefinition named my-app specifies how to create MyApp/v1alpha1 by defining App template (represented via App CRD's spec section). Users that want to create new instance of MyApp use create MyApp CR and fill it out with data values (if any required).

apiVersion: kappctrl.k14s.io/v1alpha1
kind: AppDefinition
metadata:
  name: myapp
spec:
  crd:
    apiGroup: apps.co.com
    version: v1alpha1
    name: MyApp
  defaults: # <-- ytt data values?
    ...
  template:
    spec: # App CRD spec
      fetch:
      - git: ...
      template:
      - ytt: ...
      deploy:
      - kapp: ...
apiVersion: apps.co.com/v1alpha1
kind: MyApp
metadata:
  name: app1
  namespace: apps
spec:
  host: blah.com
status:
  conditions:
  - type: Reconciling
  - type: ReconcileSucceeded
  - type: ReconcileFailed
    reason: Invalid
    message: ...
@cppforlife cppforlife added the enhancement This issue is a feature request label Jul 16, 2020
@voor
Copy link

voor commented Aug 4, 2020

Do you think something like this might also support adding in overlays to the original definition?

@cppforlife
Copy link
Contributor Author

Do you think something like this might also support adding in overlays to the original definition?

hmm, that's an interesting question. i havent thought too much about that. on one hand providing a CR with fine grain config knobs is a good barrier, from the other side providing additional config might be useful. what is the example you are thinking of where this would be needed?

@voor
Copy link

voor commented Aug 5, 2020

In terms of Cluster API, the standard cluster template gets you a Kubernetes cluster for 99% of your use cases. Now, let's say I need to change to a cluster that has PodSecurityPolicies -- I could create an app that has an overlay to add in the admission controller.

@cppforlife
Copy link
Contributor Author

given that AppDefinition is something that is meant to be defined by end users -- e.g. platform operator for example as an interface to users in the cluster, i'm still undecided on this.

in your example i imagine KubernetesCluster CRD would be defined with some defaults via AppDefinition CR. to support some clusters with PSPs builtin i would probably recommend a data value to be exposed to enable that (so it would be available under KubernetesCluster CR). effectively an overlay is an impl detail of KubernetesCluster CR.

@voor
Copy link

voor commented Aug 5, 2020

In some ways exposing the ability to directly inject overlays would break that contract, in the sense maybe platform operators don't want end-users doing that kind of modifications. Maybe leave overlays off the MVP and punt it to the backlog as a later configurable option to just "turn on use of overlays"

@cppforlife
Copy link
Contributor Author

as a lower level API we can also provide PredefinedApp (https://gist.github.com/cppforlife/3a5408e3aeb61266d76b44fcb84c3b0f) that relies on AppDefinition for base config.

@iancoffey
Copy link

iancoffey commented Dec 30, 2020

👋 updated, pardon paste fail :) I like this topic and direction and was about to open a new issue about a similar idea, which was just to update App to just be ref'ed from an new, optional AppInstance or similar sort of thing. Seems like a similar approach here but was curious if this project is open for an alternative proposal or is this specific CRD decided on

Anyway, Id love to chat / help with this topic!

@ewrenn8
Copy link
Contributor

ewrenn8 commented Mar 24, 2021

I am going to close this in favor of the new Packaging APIs that will fulfill this use case. These APIs are still in an alpha state, but you can track their progress via #87, and provide any feedback on the associated issues!

@ewrenn8 ewrenn8 closed this as completed Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a feature request
Projects
None yet
Development

No branches or pull requests

4 participants