HelmBlueGreenDeploy - Examples

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

The following examples show how to configure a HelmBlueGreenDeploy step. For more information on HelmBlueGreenDeploy Pipeline steps, see HelmBlueGreenDeploy.

Helm 3 and HelmChart Resource Input

A HelmBlueGreenDeploy step using Helm 3 and a HelmChart resource input.

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          greenReleaseName: app-green
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: helmChartResource

HelmBlueGreenDeploy

Dry Run

A HelmBlueGreenDeploy step using Helm 3 and a HelmChart resource input with values files and a dry run before the deployment.

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          blueValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          greenReleaseName: app-green
          greenValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          dryRun: true          
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: helmChartResource

GitRepo Input

A HelmBlueGreenDeploy step with a GitRepo input instead of a HelmChart, lint and test commands.

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          blueFlags: "--set key=value"
          greenReleaseName: app-green
          greenFlags: "--set key=value"
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          chartPath: "./myChart"
          lint: true
          lintFlags: "--strict"
          test: true
          testFlags: "--parallel"
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: gitRepoResource

FileSpec Input

A HelmBlueGreenDeploy step with a FileSpec input resource. When using the FileSpec input resource, use the chartPath property to specify where the Helm chart file is in the FileSpec resource. If the FileSpec represents a Generic repository in Artifactory that contains the Helm chart, use the following configuration as a reference:

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          greenReleaseName: app-green
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          chartPath: "./myChart"          
          lint: true
          lintFlags: "--strict"
          test: true
          testFlags: "--parallel"
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: fileSpecResource

If the FileSpec input resource represents a Helm repository in Artifactory, you will also need to provide the chartNameandchartVersionconfiguration properties:

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          greenReleaseName: app-green
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          chartPath: "./myChart"
                  chartName: "myChartName"
                  chartVersion: 0.0.1          
          lint: true
          lintFlags: "--strict"
          test: true
          testFlags: "--parallel"
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: fileSpecResource

BuildInfo Input

A HelmBlueGreenDeploy step with a BuildInfo input resource. When using the BuildInfo input resource, use the chartPath property to specify where the Helm chart file is in the BuildInfo resource. If the BuildInfo represents a Generic repository in Artifactory that contains the Helm chart, use the following configuration as a reference:

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          blueValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          greenReleaseName: app-green
          greenValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          chartPath: "./myChart"          
          lint: true
          lintFlags: "--strict"
          test: true
          testFlags: "--parallel"          
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: buildInfoResource

If the BuildInfo input resource represents a Helm repository in Artifactory, you will also need to provide the chartName and chartVersionconfiguration properties:

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          blueValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          greenReleaseName: app-green
          greenValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          chartPath: "./myChart"
                  chartName: "myChartName"
                  chartVersion: 0.0.1
          lint: true
          lintFlags: "--strict"
          test: true
          testFlags: "--parallel"          
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: buildInfoResource

ReleaseBundle Input

A HelmBlueGreenDeploy step with a ReleaseBundle input resource. When using the ReleaseBundle input resource you will need to specify where the Helm chart file is in the ReleaseBundle resource using the chartPath property.

If the ReleaseBundle represents a Generic repository in Artifactory that contains the Helm chart, please use the following configuration as a reference:

Artifactory integration is required

You must specify an Artifactory Integration when ReleaseBundle is the inputResource to HelmBlueGreenDeploy step. This integration will point to the Artifactory that will be the source to download the ReleaseBundle that will be used in this step.

HelmBlueGreenDeploy

pipelines:
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration:
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          blueValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          greenReleaseName: app-green
          greenValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          chartPath: "./myChart"          
          lint: true
          lintFlags: "--strict"
          test: true
          testFlags: "--parallel"
          integrations:
            - name: kubernetes_integration
            - name: artifactory_integration
          inputResources:
            - name: releaseBundleResource

If the ReleaseBundle input resource represents a Helm repository in Artifactory, you will also have to specify chartName and chartVersion configuration properties:

HelmBlueGreenDeploy

pipelines:
  - name: helmDeployPipeline   
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration:
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          blueValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          greenReleaseName: app-green
          greenValueFilePaths:
            - values/values1.yaml
            - values/values2.yaml
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service
          chartPath: "./myChart"
          chartName: "myChartName"
          chartVersion: 0.0.1          
          lint: true
          lintFlags: "--strict"
          test: true
          testFlags: "--parallel"
          integrations:
            - name: kubernetes_integration
                        - name: artifactory_integration 
          inputResources:
            - name: releaseBundleResource

Customizing Role Services

A HelmBlueGreenDeploy step with two custom labels assigned to a role Service.

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          greenReleaseName: app-green
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              idleCustomProperties: ".metadata.labels.mylabel = \"value\" | .metadata.labels.role = \"idle\""
              liveName: app-service
              liveCustomProperties: ".metadata.labels.mylabel = \"value\" | .metadata.labels.role = \"live\""
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: helmChartResource

Multiple Public Services

A HelmBlueGreenDeploy step that deploys a Helm Chart that exposes two Services.

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 3
          namespace: app-namespace
          blueReleaseName: app-blue
          greenReleaseName: app-green
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service              
              liveName: app-service
            - blueReferenceName: app-blue-admin-service
              greenReferenceName: app-green-admin-service 
              idleName: app-idle-admin-service              
              liveName: app-admin-service
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: helmChartResource

Helm 2

A HelmBlueGreenDeploy step using Helm 2.

HelmBlueGreenDeploy

pipelines: 
  - name: helmDeployPipeline
    steps:
      - name: helmDeployStep
        type: HelmBlueGreenDeploy
        configuration: 
          helmVersion: 2
          namespace: app-namespace
          blueReleaseName: app-blue
          greenReleaseName: app-green
          roleServices:
            - blueReferenceName: app-blue-service
              greenReferenceName: app-green-service 
              idleName: app-idle-service
              liveName: app-service          
          integrations:
            - name: kubernetes_integration
          inputResources:
            - name: helmChartResource