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

Adapt mutating webhook to create KeptnAppCreationRequest resources #623

Closed
3 of 8 tasks
Tracked by #514 ...
odubajDT opened this issue Jan 13, 2023 · 0 comments · Fixed by #1277
Closed
3 of 8 tasks
Tracked by #514 ...

Adapt mutating webhook to create KeptnAppCreationRequest resources #623

odubajDT opened this issue Jan 13, 2023 · 0 comments · Fixed by #1277
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@odubajDT
Copy link
Contributor

odubajDT commented Jan 13, 2023

Part of #514

Pre-requisites:

Goal

Adapt webhook to generate KeptnAppCreationRequest resources to support of automatic discovery of the application, where a multi-service/single-service application will not require a user-defined KeptnApp resource.

Technical Details

Changes of mutating webhook

According to the research and a PoC we came to a conclusion that the KeptnAppCreationRequest resource should be created by mutating webhook. In the same time creation of the KeptnApp resource (in the current state only for single-service applications) should not be part of mutating webhook and will be part of the KeptnAppCreationRequest controller. We won't need two different implementations paths to distinguish anymore between a single-service of multi-service applications, although there will be a small difference.

Workflow:

Webhook receives a Pod and checks the annotations:

  • if the Pod has application annotation, it is part of multi-service application (check like this)
  • if it does not have them, we are dealing with a single-service application

In the second step webhook will try to retrieve KeptnAppCreationRequest resource for the application -> the name of the KeptnAppCreationRequest is the same as the name of the application (and the name of the future KeptnApp)

  • if it finds it, it does nothing
  • if it does not find it, webhook will create KeptnAppCreationRequest resource. Its name will be the same as the name off the application. Additionaly, the KeptnAppCreationRequest will have the following labels:
    • keptn.sh/app-type: (single-service|multi-service) -> this is important for the KeptnAppCreationRequest controller to know whether he should wait for the rest of workloads to be applied to the cluster, or can directly move on to creation of KeptnApp

Acceptance Criteria

  • Mutating webhook does not create KeptnApp resources
  • Mutating webhook creates KeptnAppCreationRequest resources

DoD

  • Changed webhook implementation according to the description
  • Unit tests
  • Integration tests

Note

PoC of implementation available here: #559

@odubajDT odubajDT added enhancement New feature or request status: ready-for-refinement Issue is relevant for the next backlog refinment labels Jan 13, 2023
@odubajDT odubajDT added this to the 0.6 milestone Jan 13, 2023
@odubajDT odubajDT moved this to 🏗 Shaping in Keptn Lifecycle Toolkit Jan 13, 2023
@odubajDT odubajDT changed the title Adapt mutating webhook to create KeptnAppCreationRequest resources Adapt mutating webhook to create KeptnAppCreationRequest resources Jan 13, 2023
@thisthat thisthat modified the milestones: 0.6, 0.7 Jan 18, 2023
@thisthat thisthat moved this from 🏗 Shaping to 🎟️ Refined in Keptn Lifecycle Toolkit Jan 31, 2023
@odubajDT odubajDT removed the status: ready-for-refinement Issue is relevant for the next backlog refinment label Feb 8, 2023
@thisthat thisthat modified the milestones: 0.7, 0.8 Feb 24, 2023
@bacherfl bacherfl self-assigned this Apr 25, 2023
@bacherfl bacherfl moved this from 🎟️ Refined to 🏃 In progress in Keptn Lifecycle Toolkit Apr 25, 2023
@github-project-automation github-project-automation bot moved this from 🏃 In progress to ✅ Done in Keptn Lifecycle Toolkit May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants