...

Here we will use our InSights webhook functionality to generate a listening webhook and integrate the same with Spinnaker.

Prerequisites:

  1. Spinnaker

...

Steps to configure:

Expand
titleStep 1. Configure a webhook in Insights:
  1. Login to InSIghts and click on the Configuration -> Webhook Configuration option.

Image RemovedImage Added

2. Click on the “+” icon highlighted in the webhook configuration screen to add a new webhook:

Image RemovedImage Added

3. Provide all necessary details such as the name of the Webhook, what is the tool for which it will be used, the label with which data will be forwarded to Neo4j etc. All fields marked with asterisk(*) are mandatory fields. (Refer here for more details)

Image RemovedImage Added

4. The Response Template defines which fields are to be consumed by InSights. Values inside this field should be comma separated. Below is an example response template for Spinnaker events:

Code Block
languagejson
details.type=eventType,
details.created=creationTime,
details.application=application,
content.executionId=executionId,
content.execution.name=name,
content.execution.status=status,
content.execution.startTime=startTime,
content.execution.endTime=endTime,
content.execution.description=description,
content.context.serverGroupName=podName,
content.execution.trigger.user=username,
content.taskName=taskName,
content.context.canaryConfigId=canaryConfigId,
content.context.canaryScore=canaryScore,
content.context.scoreThresholds.pass=passScore,
content.context.scoreThresholds.marginal=marginalScore,
content.context.canaryPipelineStatus=canaryStatus,
content.context.scopes.default.controlScope.scope=base,
content.context.scopes.default.experimentScope.scope=canary 
Info

The left hand side defines the property coming from Spinnaker payload and the right hand side defines the name with which it will be stored in Neo4j (You can provide your own names here). The dot (.) is used to define nested properties.

5. Once all details are filled, click on the save icon highlighted below:

Image RemovedImage Added

6. This will take you back to the main Webhook configuration page. Select your webhook and Click on the link icon to copy your webhook. Keep it handy, this will be used later for Spinnaker.

Image RemovedImage Added
Expand
titleStep 2. Integrate the webhook to Spinnaker:
  1. Login to the halyard instance from where you have deployed Spinnaker. Navigate to the following path:

    ~/.hal/default/profiles

  2. Create a new file here called: echo-local.yml

  3. Write the content below into your newly created echo-local.yml file:

    Code Block
    rest:
      enabled: true
      endpoints:
        -
          wrap: false
          url: <Insights_Webhook_Configured_In_Step_1>
  4. Save the file and run the following command:

    hal deploy apply

Info

This will redeploy Spinnaker with your changes, and all event payloads will be forwarded to the InSights webhook.

You can configure multiple webhooks, where Spinnaker will forward the payloads to all of them simultaneously. In such scenarios, the echo-local.yml file will look like this:

rest:
enabled: true
endpoints:
-
wrap: false
url: <webhook1>
-
wrap: false
url: <webhook2>

Reference: click here

...