Skip to content

Don't require version field in KeptnApp CRD #2461

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

Closed
norman-zon opened this issue Nov 9, 2023 · 5 comments
Closed

Don't require version field in KeptnApp CRD #2461

norman-zon opened this issue Nov 9, 2023 · 5 comments
Labels
question Further information is requested

Comments

@norman-zon
Copy link
Contributor

The documentation for using deployment checks states:

Manually edit all KeptnApp resources to specify evaluations and tasks to be run for the KeptnApp itself.

According to GitOps principles I would put the KeptnApp CR under source control, therefor making it a part of my deployment.

But since the version field in the CR is required, every deployment reconciliation would overwrite the version determined and set by keptn, resulting in a loop.

Please don't require the version in the CR, to avoid this conflict.

@mowies
Copy link
Member

mowies commented Nov 9, 2023

I think you're using automatic app discovery right? So Keptn will manage the KeptnApp CR for you.

To follow GitOps principles, you could take the keptn-generated KeptnApp resource and start to manage it manually in your GitOps repo. For Keptn to not manage it anymore, you just need to remove the app.kubernetes.io/managed-by: "keptn" annotation from the KeptnApp.

Then you can adjust the KeptnApp to your liking and can also manage the version field however you like.

@mowies mowies changed the title (KeptnApp) Don't require version field in CR Don't require version field in KeptnApp CRD Nov 9, 2023
@bacherfl
Copy link
Member

bacherfl commented Nov 9, 2023

I think you're using automatic app discovery right? So Keptn will manage the KeptnApp CR for you.

To follow GitOps principles, you could take the keptn-generated KeptnApp resource and start to manage it manually in your GitOps repo. For Keptn to not manage it anymore, you just need to remove the app.kubernetes.io/managed-by: "keptn" annotation from the KeptnApp.

Then you can adjust the KeptnApp to your liking and can also manage the version field however you like.

To me it also seems like in this case the automatic app discovery is used, so the proposed solution by @mowies should do the trick. The version property in the KeptnApp is an essential one, as this is one of the properties that are required to properly wire together all related resources within an application (i.e. KeptnApp, KeptnAppVersion, KeptnWorkload, KeptnWorkloadVersion). But by removing the annotation that @mowies mentioned you should have full control over the KeptnApp and can therefore also add it into a GitOps repository without Keptn overwriting any of the configuration.

@mowies mowies added the question Further information is requested label Nov 9, 2023
@norman-zon
Copy link
Contributor Author

Sorry, for not being more precise.

My goal is to have keptn manage the KeptnApp (using automatic discovery), so it can set the version there. I don't want to manually set the version at all.
But to use Tasks I have to set the keptn.sh/xxx-deployment-tasks annotation in the KeptnApp.

So it boils down to the question how am I supposed to control a single property of an auto-generated CR?

My first take at this would be to put the whole KeptnApp CR under my source control, as described above. Thus yielding the issue of having to be responsible for the version field, what I don't want.

If using Kustomize I might just patch the single property in, but that would not be possible with helm.

@mowies
Copy link
Member

mowies commented Nov 9, 2023

Ahaa ok thanks for the explanation!
In that case I can tell you that we are already working on a solution as part of #1394.
Check out the example in the ticket, you'll see that there's a new resource that handles the tasks/evaluations for the app which is detached from the keptnapp itself.
The plan is to solve exactly that issue of having a resource that is half auto-generated and half user-maintained.

@norman-zon
Copy link
Contributor Author

Awesome! That's perfect. I'm looking forward to this feature being finished.
Thanks for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Archived in project
Development

No branches or pull requests

3 participants