cf-runtime

by codefresh-io

Helm chartv11.0.9Verified publisher

A Helm chart for Codefresh Runner

About this chart

Codefresh Runner

Helm chart for deploying Codefresh Runner to Kubernetes.

Table of Content

  • Prerequisites
  • Get Chart Info
  • Install Chart
  • Chart Configuration
  • Upgrade Chart
    • ⚠️ Known issues
    • To 2.x
    • To 3.x
    • To 4.x
    • To 5.x
    • To 6.x
    • To 7.x
    • To 7.9.x
    • To 8.x
    • To 8.2.x
    • To 9.x
    • To 10.1.x
    • To 11.x
  • Architecture
  • Configuration
    • Runtime spec synchronization
    • EBS backend volume configuration in AWS
    • Azure Disks backend volume configuration in AKS
    • GCE Disks backend volume configuration in GKE
    • Custom volume mounts
    • Custom global environment variables
    • Volume reuse policy
    • Volume cleaners
    • Rootless DinD
    • ARM
    • Openshift
    • On-premise
  • Migrating from CLI-based installation to Helm chart

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.8.0+

⚠️⚠️⚠️

Since version 6.2.x chart is pushed only to OCI registry at oci://quay.io/codefresh/cf-runtime

Versions prior to 6.2.x are still available in ChartMuseum at http://chartmuseum.codefresh.io/cf-runtime

Get Chart Info

helm show all oci://quay.io/codefresh/cf-runtime

See Use OCI-based registries

Install Chart

Important: only helm3 is supported

  • Specify the following mandatory values

values.yaml

# -- Global parameters
# @default -- See below
global:
  # -- User token in plain text (required if `global.codefreshTokenSecretKeyRef` is omitted!)
  # Ref: https://g.codefresh.io/user/settings (see API Keys)
  # Minimal API key scopes: Runner-Installation(read+write), Agent(read+write), Agents(read+write)
  codefreshToken: ""
  # -- User token that references an existing secret containing API key (required if `global.codefreshToken` is omitted!)
  codefreshTokenSecretKeyRef: {}
  # E.g.
  # codefreshTokenSecretKeyRef:
  #   name: my-codefresh-api-token
  #   key: codefresh-api-token

  # -- Account ID (required!)
  # Can be obtained here https://g.codefresh.io/2.0/account-settings/account-information
  accountId: ""

  # -- K8s context name (required!)
  context: ""
  # E.g.
  # context: prod-ue1-runtime-1

  # -- Agent Name (optional!)
  # If omitted, the following format will be used '{{ .Values.global.context }}_{{ .Release.Namespace }}'
  agentName: ""
  # E.g.
  # agentName: prod-ue1-runtime-1

  # -- Runtime name (optional!)
  # If omitted, the following format will be used '{{ .Values.global.context }}/{{ .Release.Namespace }}'
  runtimeName: ""
  # E.g.
  # runtimeName: prod-ue1-runtime-1/namespace
  • Install chart
helm upgrade --install cf-runtime oci://quay.io/codefresh/cf-runtime -f values.yaml --create-namespace --namespace codefresh

Chart Configuration

See Customizing the Chart Before Installing.

Upgrade Chart

⚠️ Known issues

Please check the following known issues before upgrading the chart:

  • Charts 7.1.1–7.4.3 contain a bug because of which the following feature does not work: “Secret Store — Kubernetes-Runtime Secret”.
  • Charts 8.0.5–8.3.11 contain a bug that prevents builds from terminating properly. To work around this, set the following values:
runtime:
  engine:
    command:
      - "node"
      - "dist/server/index.js"
  • Charts 10.0.0-10.0.17 contain a bug because of which Git LFS is not supported by the clone step. Please upgrade to version 10.0.18 or later to fix this issue.
  • Chart 10.3.7 contains a bug that was causing steps of type "deploy" to fail while pulling secrets. Please upgrade to version 10.3.8.

To 2.x

This major release renames and deprecated several values in the chart. Most of the workload templates have been refactored.

Affected values:

  • dockerRegistry is deprecated. Replaced with global.imageRegistry
  • re is renamed to runtime
  • storage.localVolumeMonitor is replaced with volumeProvisioner.dind-lv-monitor
  • volumeProvisioner.volume-cleanup is replaced with volumeProvisioner.dind-volume-cleanup
  • image values structure has been updated. Split to image.registry image.repository image.tag
  • pod's annotations is renamed to podAnnotations

To 3.x

⚠️⚠️⚠️

READ this before the upgrade!

This major release adds runtime-environment spec into chart templates. That means it is possible to set parametes for dind and engine pods via values.yaml.

If you had any overrides (i.e. tolerations/nodeSelector/environment variables/etc) added in runtime spec via codefresh CLI (for example, you did use get and patch commands to modify the runtime-environment), you MUST add these into chart's values.yaml for .Values.runtime.dind or(and) .Values.runtime.engine

For backward compatibility, you can disable updating runtime-environment spec via .Values.runtime.patch.enabled=false

Affected values:

  • added mandatory global.codefreshToken/global.codefreshTokenSecretKeyRef You must specify it before the upgrade!
  • runtime.engine is added
  • runtime.dind is added
  • global.existingAgentToken is replaced with global.agentTokenSecretKeyRef
  • global.existingDindCertsSecret is replaced with global.dindCertsSecretRef

To 4.x

This major release adds agentless inCluster runtime mode (relevant only for Codefresh On-Premises users)

Affected values:

  • runtime.agent / runtime.inCluster / runtime.accounts / runtime.description are added

To 5.x

This major release converts .runtime.dind.pvcs from list to dict

4.x chart's values example:

runtime:
  dind:
    pvcs:
      - name: dind
        storageClassName: my-storage-class-name
        volumeSize: 32Gi
        reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName'
        reuseVolumeSortOrder: pipeline_id

5.x chart's values example:

runtime:
  dind:
    pvcs:
      dind:
        name: dind
        storageClassName: my-storage-class-name
        volumeSize: 32Gi
        reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName'
        reuseVolumeSortOrder: pipeline_id

Affected values:

  • .runtime.dind.pvcs converted from list to dict

To 6.x

⚠️⚠️⚠️

READ this before the upgrade!

This major release deprecates previously required codefresh runner init --generate-helm-values-file.

Affected values:

  • Replaced .monitor.clusterId with .global.context as mandatory value!
  • Deprecated .global.agentToken / .global.agentTokenSecretKeyRef
  • Removed .global.agentId
  • Removed .global.keys / .global.dindCertsSecretRef
  • Removed .global.existingAgentToken / existingDindCertsSecret
  • Removed .monitor.clusterId / .monitor.token / .monitor.existingMonitorToken

Migrate the Helm chart from version 5.x to 6.x

Given this is the legacy generated_values.yaml values:

legacy generated_values.yaml

{
    "appProxy": {
        "enabled": false,
    },
    "monitor": {
        "enabled": false,
        "clusterId": "my-cluster-name",
        "token": "1234567890"
    },
    "global": {
        "namespace": "namespace",
        "codefreshHost": "https://g.codefresh.io",
        "agentToken": "0987654321",
        "agentId": "agent-id-here",
        "agentName": "my-cluster-name_my-namespace",
        "accountId": "my-account-id",
        "runtimeName": "my-cluster-name/my-namespace",
        "codefreshToken": "1234567890",
        "keys": {
            "key": "-----BEGIN RSA PRIVATE KEY-----...",
            "csr": "-----BEGIN CERTIFICATE REQUEST-----...",
            "ca": "-----BEGIN CERTIFICATE-----...",
            "serverCert": "-----BEGIN CERTIFICATE-----..."
        }
    }
}

Update values.yaml for new chart version:

For existing installation for backward compatibility .Values.global.agentToken/agentTokenSecretKeyRef must be provided! For installation from scratch this value is no longer required.

updated values.yaml

global:
  codefreshToken: "1234567890"
  accountId: "my-account-id"
  context: "my-cluster-name"
  agentToken: "0987654321"  # MANDATORY when migrating from < 6.x chart version !
  agentName: "my-cluster-name_my-namespace" # optional
  runtimeName: "my-cluster-name/my-namespace" # optional

To 7.x

⚠️⚠️⚠️ BREAKING CHANGE ⚠️⚠️⚠️

7.0.0 release adds image digests to all images in default values, for example:

runtime:
  engine:
    image:
      registry: quay.io
      repository: codefresh/engine
      tag: 1.174.15
      pullPolicy: IfNotPresent
      digest: sha256:d547c2044c1488e911ff726462cc417adf2dda731cafd736493c4de4eb9e357b

Which means any overrides for tags won't be used and underlying Kubernetes runtime will pull the image by the digest.

See Pull an image by digest (immutable identifier)

To 7.9.x

We changed the type of .Values.runtime.engine.runtimeImages from key-value maps to a list of maps with registry, repository, tag and digest fields.

If you used this value, please migrate like below:

# before
runtime:
  engine:
    runtimeImages:
      COMPOSE_IMAGE: quay.io/codefresh/compose:v2.37.0-1.5.4@sha256:e74494370100678ccb1c1058e6ef3ddcf67b21fcd37da8b3482376c8282549ad

# after
runtime:
  engine:
    runtimeImages:
      compose:
        registry: quay.io
        repository: codefresh/compose
        tag: v2.37.0-1.5.4
        digest: sha256:e74494370100678ccb1c1058e6ef3ddcf67b21fcd37da8b3482376c8282549ad

To 8.x

⚠️⚠️⚠️ BREAKING CHANGE ⚠️⚠️⚠️

Docker engine in dind component is upgraded to 28.x. The main change is that in this version the image manifest v2 schema 1 and "Docker Image v1" formats were deprecated in favor of the v2 schema 2 and OCI image spec formats. Read the official Docker documentation for more details.

This means that any existing images in your pipelines that were created using these older formats will no longer be pulled after upgrade. This may affect pipelines operation.

To avoid operation disruption, you have to identify and convert such deprecated images to modern formats. Tutorial: https://codefresh.io/docs/docs/kb/articles/upgrade-deprecated-docker-images/

To 8.2.x

⚠️⚠️⚠️ BREAKING CHANGE in metrics configuration ⚠️⚠️⚠️

In this release, the engine component has migrated its metrics collection to OpenTelemetry, using the push model by default.

You can still switch to the pull model by setting the OTEL_METRICS_EXPORTER=prometheus environment variable for the engine. However, we recommend using the default configuration, as it is better suited for the short-lived nature of Classic Builds and provides more precise and complete metrics.

View default chart values for more configuration options.

The engine metrics have also been redesigned to follow OpenTelemetry standards and to deliver more actionable insights. Full list of metrics: https://codefresh.io/docs/docs/installation/runner/classic-runtime-monitoring/

For a smooth transition, the previous Prometheus metrics are still available but are now disabled by default. These legacy metrics will be removed in future releases. If you need to temporarily retain the old metrics, add the following values to your chart configuration:

runtime:
  engine:
    env:
      CF_TELEMETRY_PROMETHEUS_ENABLE: "false" # Disable new Prometheus metrics to avoid ports conflict and data duplication
      CF_TELEMETRY_OTEL_ENABLE: "false" # Disable new OTel metrics to avoid data duplication
      METRICS_PROMETHEUS_ENABLED: "true" # Enable old Prometheus metrics

To 9.x

  • Removed: deploy step (docs) drops support for Kubernetes versions older than 1.32. Supported versions are: 1.34, 1.33, 1.32.

  • Removed: Legacy Prometheus metrics emitted by the engine component and controlled by METRICS_PROMETHEUS_ENABLED and METRICS_PROMETHEUS_ENABLE_LEGACY_METRICS environment variables are dropped. Use modern OpenTelemetry-based metrics instead. See To 8.2.x for more details.

  • Removed: OTel metric codefresh.classic.build.deprecated_images.pulled emitted by the engine component is dropped.

To 10.1.x

  • Removed: deploy step ([docs](

Deploy cf-runtime with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cf-runtime on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcf-runtime is pinned at v11.0.9 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply