keptn-sandbox / litmus-service

Integration for LitmusChaos
Apache License 2.0
7 stars 5 forks source link

Upgrade keptn/distributor to 0.8.4 for properly showing up at the integrations page in Keptn Bridge #52

Closed christian-kreuzberger-dtx closed 3 years ago

christian-kreuzberger-dtx commented 3 years ago

In Keptn 0.8.4, the distributor will be extended with the functionality of registering itself as a Keptn uniform integration at the Keptn's Uniform API.

Related Video with short Tutorial (part of community meeting on June 17th): https://youtu.be/oZlf1v5qUvc?t=436

Goal: The integration/service should be visible in Keptn's Bridge Uniform screen: image

If you have any questions, please reply to https://github.com/keptn/keptn/issues/4418


To enable this feature, the following changes need to be made:

First, the image of the distributor container of the deployment needs to be set to keptn/distributor:0.8.4:

        - name: distributor
              image: keptn/distributor:0.8.4

Second, locate the env section of the distributor container:

        - name: distributor
          image: keptn/distributor:0.8.4
          resources: ...
          env:
            ...

and add the following environment variables:

            - name: VERSION
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: 'metadata.labels[''app.kubernetes.io/version'']'
            - name: K8S_DEPLOYMENT_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: 'metadata.labels[''app.kubernetes.io/name'']'
            - name: K8S_POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
            - name: K8S_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: K8S_NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName

Last but not least, ensure that the labels app.kubernetes.io/version and app.kubernetes.name are available under spec.template.metadata.labels in the K8s deployment:

        app.kubernetes.io/name: dynatrace-service
        app.kubernetes.io/version: 0.14.1

You can find a complete example of deployment.yaml (or service.yaml) here: https://github.com/keptn-contrib/unleash-service/blob/release-0.3.2/deploy/service.yaml

jetzlstorfer commented 3 years ago

Updated with this PR https://github.com/keptn-sandbox/litmus-service/pull/54