From f687b90c88502d34ef4c961fd7a8b25546759265 Mon Sep 17 00:00:00 2001 From: Sushrut Athavale Date: Wed, 15 May 2024 13:57:00 -0700 Subject: [PATCH] Added supported stages + video demo + started harness prerequisites. --- .../{_category_ copy.json => _category_.json} | 2 +- docs/docs/spinnaker-migration/instructions.md | 4 ++ docs/docs/spinnaker-migration/intro.md | 23 ++++++- .../docs/spinnaker-migration/prerequisites.md | 64 +++++++++++++++++-- 4 files changed, 86 insertions(+), 7 deletions(-) rename docs/docs/spinnaker-migration/{_category_ copy.json => _category_.json} (72%) diff --git a/docs/docs/spinnaker-migration/_category_ copy.json b/docs/docs/spinnaker-migration/_category_.json similarity index 72% rename from docs/docs/spinnaker-migration/_category_ copy.json rename to docs/docs/spinnaker-migration/_category_.json index e9188ef..9dd69e1 100644 --- a/docs/docs/spinnaker-migration/_category_ copy.json +++ b/docs/docs/spinnaker-migration/_category_.json @@ -1,5 +1,5 @@ { - "label": "spinnaker-migration", + "label": "Spinnaker Migration", "collapsed": false, "position": 11, "link": { diff --git a/docs/docs/spinnaker-migration/instructions.md b/docs/docs/spinnaker-migration/instructions.md index 56c6fff..d018e99 100644 --- a/docs/docs/spinnaker-migration/instructions.md +++ b/docs/docs/spinnaker-migration/instructions.md @@ -51,3 +51,7 @@ Migration details: ? Do you want to proceed? Yes INFO[2024-03-04T15:50:41-08:00] Spinnaker migration completed ``` + +## Video Demo + + \ No newline at end of file diff --git a/docs/docs/spinnaker-migration/intro.md b/docs/docs/spinnaker-migration/intro.md index a7ae817..a632352 100644 --- a/docs/docs/spinnaker-migration/intro.md +++ b/docs/docs/spinnaker-migration/intro.md @@ -1,4 +1,6 @@ --- +title: Introduction +description: Introduction to the Spinnaker Migration tool. Includes supported Spinnaker stages. sidebar_position: 1 --- @@ -10,5 +12,24 @@ This tool was developed by Harness to assist in the migration process from Spinn This tool is designed for customers, CSMs, and developers who are currently using Spinnaker and wish to migrate their accounts to Harness CD Next Gen. -### Key Components that can be migrated +### Spinnaker stages that can be migrated The following key components can be migrated using this tool: + +| | Stages | Harness | Can we Migrate? | Comments | +| -- | ------------------------- | ----------------- | --------------- | ------------------------------------------------------ | +| 1 | pipeline | Pipeline Chaining | Yes | Can only chain up to 2 pipelines | +| 2 | manualJudgment | Approval | Yes | | +| 3 | checkPreconditions | Shell Script | Yes | Supports Expressions, and Multiple Check preconditions | +| 4 | deleteManifest | Delete | Yes | | +| 5 | evaluateVariables | JEXL Expression | Yes | | +| 6 | wait | Wait | Yes | | +| 7 | deployManifest | Deploy | Yes | | +| 8 | webhook | Custom Webhook | Yes | | +| 9 | findImageFromTags | | Yes | | +| 10 | bake | Bake Plugin | Yes | AMI Baking | +| 11 | jenkins | Jenkins Step | Yes | | +| 12 | findArtifactsFromResource | Shell Script | Yes | | +| 13 | Find Image From Tags | Plugin | Yes | | +| 14 | AWS: invokeLambda | Plugin | Yes | | +| 15 | ShrinkCluster | Plugin | Yes | | +| 16 | ScaleDownCluster | Plugin | Yes | \ No newline at end of file diff --git a/docs/docs/spinnaker-migration/prerequisites.md b/docs/docs/spinnaker-migration/prerequisites.md index 0a879a5..5169b7b 100644 --- a/docs/docs/spinnaker-migration/prerequisites.md +++ b/docs/docs/spinnaker-migration/prerequisites.md @@ -7,13 +7,67 @@ sidebar_position: 2 Before using the Spinnaker to CD Next Gen migration tool, you must have the following prerequisites: - Armory Account - Armory Platform | Spinnaker - - Harness Account - AccountID - - Harness Org - default if not provided - - Harness Project - Project_Name - - API Key - Follow instructions at Manage API keys | [Harness Developer Hub](https://developer.harness.io/docs/platform/automation/api/add-and-manage-api-keys/#create-personal-api-keys-and-tokens) - - Environment - Prod, Prod1, or Prod3 + +## Cloud Providers + +Cloud providers can have their own specific prerequisites for migration. Here they are: + +### AWS + +If you are using the **spinnaker-aws-drone-plugin** for any stages (i.e. Shrinkcluster, Scaledowncluster, Invokelambda) then ensure that there is an AWS secret created at the project level within Harness with the following names: + +``` +AWS_ACCESS_KEY_ID +AWS_SECRET_ACCESS_KEY +``` + +For information on how to create secrets with Harness, go to [AWS Secrets Manager](https://developer.harness.io/docs/platform/secrets/secrets-management/add-an-aws-secret-manager) + +### GCP + +Regrettably, Harness lacks native support for triggering pipelines directly via incoming Pub/Sub messages. However, we can work around this limitation by using a custom webhook trigger. + +For detailed information about custom webhook triggers, go to [Using Custom Triggers](https://developer.harness.io/docs/platform/triggers/trigger-deployments-using-custom-triggers/) + +In this approach, you would need to provision a new GCP Cloud Function that triggers from Pub/Sub topic messages and invokes the custom webhook URL. Below is an example of such a function in Node.js. + +```jsx +const fetch = require('node-fetch'); + +exports.pubsubListener = (event, context) => { + const pubsubMessage = event.data; + const message = Buffer.from(pubsubMessage, 'base64').toString(); + + console.log(`Received message: ${message}`); + + // Define the webhook URL and payload + const webhookUrl = ''; + const payload = { + sample_key: 'sample_value' + }; + + // Make a POST request to the webhook URL + fetch(webhookUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(payload) + }) + .then(response => { + if (!response.ok) { + throw new Error('Failed to trigger webhook'); + } + console.log('Webhook triggered successfully'); + return response.json(); + }) + .catch(error => { + console.error('Error triggering webhook:', error); + }); +}; +```