From ad7c5ad6ab3d3dace3c1e19f3b7a9fec6635d4ff Mon Sep 17 00:00:00 2001 From: Griffin Date: Fri, 29 Sep 2023 15:50:26 +0530 Subject: [PATCH 1/4] add KeptnApp reference in getting started Signed-off-by: Griffin --- .../content/en/docs/getting-started/_index.md | 120 +++++++++++++++++- 1 file changed, 116 insertions(+), 4 deletions(-) diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index 07cc0f04fc..2496c35959 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -469,16 +469,128 @@ View the Keptn Applications Dashboard and you should see the DORA metrics and an ## Step 14: More control over KeptnApp -You may have noticed that the `KeptnApp` Custom Resources are created automatically by Keptn. +To customize workloads and checks associated with the application, we can edit the autogenerated KeptnApp or create our own. -The lifecycle toolkit automatically groups workloads into `KeptnApp`s by looking for matching -`app.kubernetes.io/part-of` annotations. -Any workloads with the same `part-of` annotation are said to be `part-of` the same `KeptnApp`. +```yaml +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnApp +metadata: + name: + namespace: +spec: + version: "x.y" + revision: x + workloads: + - name: + version: + - name: + version: + preDeploymentTasks: + - + postDeploymentTasks: + - + preDeploymentEvaluations: + - + postDeploymentEvaluations: + - +``` +## Fields + +- **apiVersion** -- API version being used. +- **kind** -- Resource type. + Must be set to `KeptnApp` + +- **metadata** + - **name** -- Unique name of this application. + Names must comply with the + [Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) + specification. + +- **spec** + - **version** -- version of the Keptn application. + Changing this version number causes a new execution + of all application-level checks + - **revision** -- revision of a `version`. + The value is an integer that can be modified + to trigger another deployment of a `KeptnApp` of the same version. + For example, increment this number to restart a `KeptnApp` version + that failed to deploy, perhaps because a + `preDeploymentEvaluation` or `preDeploymentTask` failed. + See + [Restart an Application Deployment](../implementing/restart-application-deployment/) + for a longer discussion of this. + - **workloads** + - **name** - name of this Kubernetes + [workload](https://kubernetes.io/docs/concepts/workloads/). + Use the same naming rules listed above for the application name. + Provide one entry for each workload + associated with this Keptn application. + - **version** -- version number for this workload. + Changing this number causes a new execution + of checks for this workload only, + not the entire application. + +The remaining fields are required only when implementing +the release lifecycle management feature. +If used, these fields must be populated manually: + +- **preDeploymentTasks** -- list each task + to be run as part of the pre-deployment stage. + Task names must match the value of the `metadata.name` field + for the associated [KeptnTaskDefinition](taskdefinition.md) resource. +- **postDeploymentTasks** -- list each task + to be run as part of the post-deployment stage. + Task names must match the value of the `metadata.name` field + for the associated + [KeptnTaskDefinition](taskdefinition.md) + resource. +- **preDeploymentEvaluations** -- list each evaluation to be run + as part of the pre-deployment stage. + Evaluation names must match the value of the `metadata.name` field + for the associated + [KeptnEvaluationDefinition](evaluationdefinition.md) + resource. +- **postDeploymentEvaluations** -- list each evaluation to be run + as part of the post-deployment stage. + Evaluation names must match the value of the `metadata.name` field + for the associated [KeptnEvaluationDefinition](evaluationdefinition.md) + resource. + +## Example + +```yaml +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnApp +metadata: + name: podtato-head + namespace: podtato-kubectl +spec: + version: "latest" + workloads: + - name: podtato-head-left-arm + version: "my_vers12.5" + - name: podtato-head-left-leg + version: "my_v24" + postDeploymentTasks: + - post-deployment-hello + preDeploymentEvaluations: + - my-prometheus-definition +``` + +You may have noticed that the `KeptnApp` Custom Resources are created automatically by Keptn. However, you can override this automatic behaviour by creating a custom `KeptnApp` CRD. In this way, you are in full control of what constitutes a Keptn Application. See [KeptnApp Reference page](../yaml-crd-ref/app.md) for more information. + + + + + ## What's next? Keptn can run pre and post deployment tasks and SLO evaluations automatically. From ea68b3a3b4648ae8269589c66c00a3088af7d49a Mon Sep 17 00:00:00 2001 From: Griffin Date: Mon, 2 Oct 2023 16:44:05 +0530 Subject: [PATCH 2/4] add space after #Fields Signed-off-by: Griffin --- docs/content/en/docs/getting-started/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index 68913134d9..7fd7542532 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -494,6 +494,7 @@ spec: postDeploymentEvaluations: - ``` + ## Fields - **apiVersion** -- API version being used. From 00ded7e6544e1d13d16bdc0d3d6006f81d2ce500 Mon Sep 17 00:00:00 2001 From: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:50:50 +0530 Subject: [PATCH 3/4] Update _index.md remove commented text Signed-off-by: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com> --- docs/content/en/docs/getting-started/_index.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index 7fd7542532..272780008b 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -584,14 +584,6 @@ However, you can override this automatic behaviour by creating a custom `KeptnAp In this way, you are in full control of what constitutes a Keptn Application. See [KeptnApp Reference page](../yaml-crd-ref/app.md) for more information. - - - - - ## What's next? Keptn can run pre and post deployment tasks and SLO evaluations automatically. From 1cce32f5143b1691fe7a27223313d3dd542460eb Mon Sep 17 00:00:00 2001 From: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:15:28 +0530 Subject: [PATCH 4/4] Update _index.md correct the links Signed-off-by: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com> --- docs/content/en/docs/getting-started/_index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index 272780008b..6362b02ea3 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -538,23 +538,23 @@ If used, these fields must be populated manually: - **preDeploymentTasks** -- list each task to be run as part of the pre-deployment stage. Task names must match the value of the `metadata.name` field - for the associated [KeptnTaskDefinition](taskdefinition.md) resource. + for the associated [KeptnTaskDefinition](../yaml-crd-ref/taskdefinition.md) resource. - **postDeploymentTasks** -- list each task to be run as part of the post-deployment stage. Task names must match the value of the `metadata.name` field for the associated - [KeptnTaskDefinition](taskdefinition.md) + [KeptnTaskDefinition](../yaml-crd-ref/taskdefinition.md) resource. - **preDeploymentEvaluations** -- list each evaluation to be run as part of the pre-deployment stage. Evaluation names must match the value of the `metadata.name` field for the associated - [KeptnEvaluationDefinition](evaluationdefinition.md) + [KeptnEvaluationDefinition](../yaml-crd-ref/evaluationdefinition.md) resource. - **postDeploymentEvaluations** -- list each evaluation to be run as part of the post-deployment stage. Evaluation names must match the value of the `metadata.name` field - for the associated [KeptnEvaluationDefinition](evaluationdefinition.md) + for the associated [KeptnEvaluationDefinition](../yaml-crd-ref/evaluationdefinition.md) resource. ## Example