-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: introduce KeptnApp to KeptnAppContext migration guide (#2851)
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com> Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Co-authored-by: Meg McRoberts <meg.mcroberts@dynatrace.com> Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
- Loading branch information
1 parent
213e93d
commit 7e71022
Showing
6 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: lifecycle.keptn.sh/v1alpha3 | ||
kind: KeptnApp | ||
metadata: | ||
name: "some-keptn-app" | ||
namespace: "my-app-ns" | ||
labels: | ||
my-custom-label: customValue | ||
app.kubernetes.io/managed-by: keptn # added annotation | ||
spec: | ||
version: "1.2.3" | ||
workloads: | ||
- name: podtato-head-left-arm | ||
version: 0.2.7 | ||
# removed pre/post-deployment tasks and evaluations | ||
--- | ||
apiVersion: lifecycle.keptn.sh/v1beta1 | ||
kind: KeptnAppContext | ||
metadata: | ||
name: "some-keptn-app" # created a resource with the same name as KeptnApp | ||
namespace: "my-app-ns" | ||
spec: | ||
preDeploymentTasks: # moved pre/post-deployment tasks and evaluations | ||
- pre-deployment-task | ||
preDeploymentEvaluations: | ||
- pre-deployment-evaluation | ||
postDeploymentTasks: | ||
- post-deployment-task | ||
postDeploymentEvaluations: | ||
- post-deployment-evaluation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: lifecycle.keptn.sh/v1alpha3 | ||
kind: KeptnApp | ||
metadata: | ||
name: "some-keptn-app" | ||
namespace: "my-app-ns" | ||
labels: | ||
my-custom-label: customValue | ||
spec: | ||
version: "1.2.3" | ||
workloads: | ||
- name: podtato-head-left-arm | ||
version: 0.2.7 | ||
preDeploymentTasks: | ||
- pre-deployment-task | ||
preDeploymentEvaluations: | ||
- pre-deployment-evaluation | ||
postDeploymentTasks: | ||
- post-deployment-task | ||
postDeploymentEvaluations: | ||
- post-deployment-evaluation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Migrating KeptnApp to KeptnAppContext | ||
|
||
The introduction of the `KeptnAppContext` resource | ||
in Keptn v0.11.0 | ||
requires modifications to existing | ||
[KeptnApp](../../reference/crd-reference/app.md) | ||
resources that were generated manually. | ||
This page gives instructions for doing that. | ||
|
||
## Migration steps | ||
|
||
> **Warning** | ||
Migration is only required for | ||
**manually created KeptnApp** or | ||
automatically created `KeptnApp` resources with | ||
**manually edited pre/post-deployment tasks or evaluations**. | ||
`KeptnApp` resources created by Keptn via the | ||
[automatic app-discovery](../../guides/auto-app-discovery.md) | ||
without any manual changes in the pre/post-deployment | ||
tasks/evaluations section do not require any action. | ||
|
||
To migrate an existing **manually created KeptnApp** or | ||
automatically created `KeptnApp` with | ||
**manually edited pre/post-deployment tasks or evaluations** | ||
to `KeptnAppContext` you need to execute the following steps: | ||
|
||
1. Create a `KeptnAppContext` custom resource that has the same name | ||
as your `KeptnApp`. | ||
2. Move the lists of pre/post-deployment tasks and evaluation from `KeptnApp` | ||
to `KeptnAppContext`. | ||
In other words, delete them from `KeptnApp.spec` and add them under the `KeptnAppContext.spec` field. | ||
3. Add the `app.kubernetes.io/managed-by: keptn` annotation | ||
to `KeptnApp`. | ||
|
||
> **Note** | ||
Please make sure all of your application resources | ||
(such as Pods, Deployments, StatefulSets or DaemonSets) | ||
have the proper annotations/labels set. | ||
These annotations/labels (especially the | ||
`app.kubernetes.io/part-of` or `keptn.sh/app`) | ||
are necessary for the migration to the | ||
automatic app-discovery feature. | ||
More information about how to set up these annotations/labels | ||
can be found [here](../../guides/integrate.md#basic-annotations). | ||
|
||
## Example of migration | ||
|
||
Here, we provide an example of how to | ||
migrate the `KeptnApp` definition to the `KeptnAppContext`. | ||
Let's say we have the following `KeptnApp` in our cluster: | ||
|
||
```yaml | ||
{% include "./assets/keptnapp.yaml" %} | ||
``` | ||
|
||
Applying the migration steps from the previous subsection, we get the | ||
following result: | ||
|
||
```yaml | ||
{% include "./assets/keptnapp-migrated.yaml" %} | ||
``` | ||
|
||
These modified resources can be now applied to your cluster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters