Spinnaker Stage Bake (Manifest): Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 6: Line 6:
This stage renders the final form of a manifest or a multi-document manifest set, using a template renderer such as Helm.
This stage renders the final form of a manifest or a multi-document manifest set, using a template renderer such as Helm.
=Configuration=
=Configuration=
==Template Renderer==
==Bake (Manifest) Configuration==
===Template Renderer===
'''Render Engine''': HELM3
'''Render Engine''': HELM3
==Helm Options==
===Helm Options===
'''Name''': the Helm release name for the chart. <font color=darkkhaki>It determines the name of the artifact produced by this stage</font>. This name will override the "'''Match Artifact/Name'''" specified in the [[#Produces_Artifact|Produces Artifact]] section.
'''Name''': the Helm release name for the chart. <font color=darkkhaki>It determines the name of the artifact produced by this stage</font>. This name will override the "'''Match Artifact/Name'''" specified in the [[#Produces_Artifact|Produces Artifact]] section.
<span id='Bake_Namespace'></span>'''Namespace''': the target namespace to release into. If not specified, "default" will be used. ⚠️ There were (yet not elucidated) situations when even if a specific namespace was configured here, the deployment went to "default". That was fixed by [[#Override_Namespace |overriding the namespace]] in the Deploy (Manifest) stage.
<span id='Bake_Namespace'></span>'''Namespace''': the target namespace to release into. If not specified, "default" will be used. ⚠️ There were (yet not elucidated) situations when even if a specific namespace was configured here, the deployment went to "default". That was fixed by [[#Override_Namespace |overriding the namespace]] in the Deploy (Manifest) stage.


==Template Artifact==
===Template Artifact===
:'''Expected Artifact''': Artifact from execution context
:'''Expected Artifact''': Artifact from execution context



Revision as of 23:28, 25 February 2022

Internal

Overview

This stage renders the final form of a manifest or a multi-document manifest set, using a template renderer such as Helm.

Configuration

Bake (Manifest) Configuration

Template Renderer

Render Engine: HELM3

Helm Options

Name: the Helm release name for the chart. It determines the name of the artifact produced by this stage. This name will override the "Match Artifact/Name" specified in the Produces Artifact section.

Namespace: the target namespace to release into. If not specified, "default" will be used. ⚠️ There were (yet not elucidated) situations when even if a specific namespace was configured here, the deployment went to "default". That was fixed by overriding the namespace in the Deploy (Manifest) stage.

Template Artifact

Expected Artifact: Artifact from execution context

To define the helm chart to render, there are two choices: Helm repository or GitHub repository. In both cases, the chart to be deployed must be stored remotely as a .tar.gz archive.

Helm Repository

GitHub Repository for Helm Chart

Account: GitHub
Content URL: https://github.domain.com/api/v3/repos/<organization>/<repository>/<path-inside-repository>. Example: https://github.domain.com/api/v3/repos/ovidiuf/smoke/tmp/smoke-1.0.0.tgz
Commit/Branch: develop

Note that the GitHub repository must be configured for Spinnaker access.

The documentation seems to suggest that the chart can be stored in the GitHub repository in an exploded format, and the path to the Chart.yaml is sufficient, either the path to the file itself or the path to the directory containing Chart.yaml.

Overrides

The files passed to --values parameter must be added as "Overrides/value artifact". Individually specified overrides can also be set in form of key/value pairs.

Execution Options

Produces Artifact

By default, Spinnaker automatically creates an embedded/base64 artifact that is bound when the stage completes, representing the full manifest set to be deployed downstream.

Example of Configured Stage

{
  "expectedArtifacts": [
    {
      "defaultArtifact": {
        "customKind": true,
        "id": "a3b15bdc-8f73-4265-ba38-9be06cd6b4f2"
      },
      "displayName": "rendered-helm-chart",
      "id": "c7202ead-c6f9-497a-9120-1957688ed2d8",
      "matchArtifact": {
        "artifactAccount": "embedded-artifact",
        "customKind": false,
        "id": "22a48f2b-2b62-46bd-9964-68b406a3c1c8",
        "type": "embedded/base64"
      },
      "useDefaultArtifact": false,
      "usePriorArtifact": false
    }
  ],
  "inputArtifacts": [
    {
      "account": "github",
      "artifact": {
        "artifactAccount": "github",
        "id": "75ebe7b2-b04a-4fcd-a712-c7eacb06c348",
        "name": "tmp/smoke-0.1.0.tgz",
        "reference": "https://github.example.com/api/v3/repos/ovidiuf/smoke/contents/tmp/smoke-0.1.0.tgz",
        "type": "github/file",
        "version": "develop"
      }
    }
  ],
  "name": "Render Helm",
  "namespace": "of",
  "outputName": "smoke",
  "overrides": {},
  "templateRenderer": "HELM3",
  "type": "bakeManifest"
}