Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
2.2M

Release a Helm chart helm

Update or install a Helm chart.

arguments

  • action - The helm operation mode is set by the ACTION variable, where the value is install/auth/push
  • app_version - Version of the application. This field is informational, and has no impact on chart version calculations.
  • chart_name - Helm chart name to release (path to chart folder, or name of packaged chart)
  • chart_repo_url - Helm chart repository URL (overriden by injected Helm repository context)
  • chart_subdir - optional subfolder (inside JFrog Artifactory helm repository)
  • chart_version - Application chart version to install
  • cmd_ps - Variable to provide other Helm cli flags. For example: '--wait --timeout', etc
  • commands - Commands to execute in plugin container after authorization (for `auth` action)
  • credentials_in_arguments - Add credentials to helm command as arguments (username, password). Otherwise its will be added to url http(s)://username:password@url. Should be enabled for JFrog Artifactory helm repository.
  • custom_value_files - Values file to provide to Helm (as --values or -f). see usage information below
  • custom_values - Variables to provide to Helm (as --set). see usage information below
  • helm_repository_context - Helm context to use (the name of the helm repository as configured in Codefresh)
  • helm_version - Version of cfstep-helm image
  • kube_context - Kubernetes context to use (the name of the cluster as configured in Codefresh) (required)
  • namespace - Target Kubernetes namespace
  • primary_helm_context - When multiple contexts are attached to the pipeline this argument lets to select one of them for using in helm command. When omit the last added repo is used
  • release_name - Helm release name
  • repos - array of custom repos
  • set_file - Set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
  • skip_cf_stable_helm_repo - Don't add stable repository
  • tiller_namespace - Kubernetes namespace where tiller is at
  • timeout - A value in seconds to wait for Kubernetes commands to complete
  • use_debian_image - Use debian based cfstep-helm image
  • use_repos_for_auth_action - Add helm repositories from contexts for auth action
  • wait - Waits until all Pods are in a ready state, PVCs are bound, Deployments have minimum Pods in ready state and Services have an IP address before marking the release as successful
    deploy:
  type: helm
  arguments:
    chart_name: test_chart
    release_name: first
    kube_context: my-kubernetes-context
    tiller_namespace: kube-system
    namespace: project
    custom_values:
      - KEY1=VAL1
      - KEY2=VAL2
      - KEY3=VAL3
    custom_value_files:
      - /path/to/values.yaml
      - /path/to/values2.yaml
    cmd_ps: '--wait --timeout 5'

  
    deploy:
  type: helm
  arguments:
    action: install
    chart_name: test_chart
    release_name: first
    helm_version: 3.0.1
    kube_context: my-kubernetes-context
    skip_cf_stable_helm_repo: true
    credentials_in_arguments: true
    custom_values:
      - 'pat.arr="{one,two,three}"'
      - 'STR_WITH_COMAS="one\,two\,three"'

  
    deploy:
  type: helm
  arguments:
    action: push
    chart_name: /codefresh/volume/repo/chart
    chart_repo_url: 'cm://h.cfcr.io/useraccount/default'

  
    deploy:
  type: helm
  arguments:
    action: auth
    kube_context: my-kubernetes-context
    commands:
      - helm list

  
github.com
Roman Kuchuk
Jan 30, 2023