Add Application Awareness

In the previous step, we installed the demo application without any application awareness. This means that Keptn assumed that every workload is a single-service application at the moment and created the Application resources for you.

To get the overall state of an application, we need a grouping of workloads, called KeptnApp. To get this working, we need to modify our application manifest with two things:

  • Add an “” or “” label to the deployment
  • Create an application resource

Preparing the Manifest and create an App resource


You can also use the prepared manifest and apply it directly using: kubectl apply -k sample-app/version-2/ and proceed here.


Create a temporary directory and copy the base manifest there:

mkdir ./my-deployment
cp demo-application/base/manifest.yml ./my-deployment

Now, open the manifest in your favorite editor and add the following label to the deployments, e.g.:

apiVersion: apps/v1
kind: Deployment
  name: podtato-head-right-leg
  namespace: podtato-kubectl
    app: podtato-head
      component: podtato-head-right-leg
        component: podtato-head-right-leg
      annotations: "right-leg" "0.1.0" "podtato-head"
      terminationGracePeriodSeconds: 5
        - name: server
          imagePullPolicy: Always
            - containerPort: 9000
            - name: PODTATO_PORT
              value: "9000"

Now, update the version of the workloads in the manifest to 0.2.0.

Finally, create an application resource (app.yaml) and save it in the directory as well:

kind: KeptnApp
  name: podtato-head
  namespace: podtato-kubectl
  version: "latest"
    - name: left-arm
      version: "myvers12.5"
    - name: left-leg
      version: "my_v24"
    - name: entry
      version: "latest"
    - name: right-arm
      version: "0.1.1"
    - name: left-arm
      version: "0.1.1"
    - name: hat
      version: "0.1.1"

Now, apply the manifests:

kubectl apply -f ./my-deployment/.

Watch Application behavior

Now, your application gets deployed in an application aware way. This means that pre-deployment tasks and evaluations would be executed if you would have any. The same would happen for post-deployment tasks and evaluations after the last workload has been deployed successfully.

Now that you defined your application, you could watch the state of the whole application using:

kubectl get keptnappversions -n podtato-kubectl`

You should see that the application is in a progressing state as long as the workloads (kubectl get kwi) are progressing. After the last application has been deployed, and post-deployment tasks and evaluations are finished (there are none at this point), the state should switch to completed.

Now, we have deployed an application and are able to get the total state of the application state. Metrics and traces get exported and now we’re ready to dive deeper in the world of Pre- and Post-Deployment Tasks.