Download the release manifest and create its companion script

Introduction

Download a release manifest so you know the names and versions of the Helm charts and Docker container images that are included in a release of F5 BIG-IP Cloud-Native Edition.

Definition: Release manifest

A release manifest is a YAML file for a release that:

  • Serves as a bill of materials for that release

  • Specifies the following:

    • The release version

    • The names and versions of the Helm charts and Docker container images that are included in that release

    • The address of the F5 Artifact Registry repository in which the charts and images are stored

Example: Release manifest

This is a shortened example of a release manifest:

f5_helm_repo: oci://repo.f5.com
f5_docker_repo: repo.f5.com
releases:
  - version: 2.4.0
    helm_charts:
      - name: charts/cwc
        version: 0.92.22-0.0.14
      - name: utils/f5-cert-gen
        version: 0.9.3
      - name: charts/f5-cert-manager
        version: 0.27.9-0.0.2

...

    docker_images:
      - name: images/cert-manager-cainjector
        version: v2.7.1
      - name: images/cert-manager-controller
        version: v2.7.1
      - name: images/cert-manager-startupapicheck
        version: v2.7.1

...

Definition: Release-manifest chart

A release-manifest chart is a pseudo Helm chart that you download from an F5 Artifact Registry repository and that includes the following items for a specific release:

  • A release manifest

Note

As a pseudo Helm chart, a release-manifest chart does not include templates for Kubernetes resources or a values.yaml file. It includes only the items listed above. Packaging the release manifest in a Helm chart allows you to download the manifest using Helm.

Log in to F5 Artifact Registry with Helm

Note

Unless you log out (or get logged out), you need to log in to F5 Artifact Registry only once with Helm.

  1. Make sure your computer is connected to the public internet.

  2. In a terminal window on your computer, make sure you’re in the F5 BIG-IP Cloud-Native Edition directory (for example, f5-big-ip-cne), which contains your F5 Artifact Registry service-account key (cne_pull_64.json).

  3. Log in to F5 Artifact Registry with Helm:

    cat cne_pull_64.json | helm registry login \
      --username _json_key_base64 \
      --password-stdin repo.f5.com
    

    You can now use Helm commands on your computer to reference Helm charts in F5 Artifact Registry.

Set the release-manifest version

  • Set the CNE_RELEASE_MANIFEST_VERSION environment variable to the F5 BIG-IP Cloud-Native Edition version.

    Example

    export CNE_RELEASE_MANIFEST_VERSION=2.4.0
    

Download the archive file for the release-manifest chart

  1. In a terminal window on your computer, make sure you’re in the F5 BIG-IP Cloud-Native Edition directory (for example, f5-big-ip-cne).

  2. Set the CNE_REPO environment variable to the address of F5 Artifact Registry:

    Note

    There is only one repository in F5 Artifact Registry, so the address of the registry is also the address of the repository.

    export CNE_REPO=repo.f5.com
    
  3. Set the CNE_CHART environment variable to the name of the release-manifest chart:

    export CNE_CHART=f5-bigip-k8s-manifest
    
  4. Download the archive file for the release-manifest chart:

    helm pull oci://$CNE_REPO/release/$CNE_CHART \
        --version $CNE_RELEASE_MANIFEST_VERSION
    

Extract the archive file for the release-manifest chart

  • Extract the archive file for the release-manifest chart:

    tar zxvf ${CNE_CHART}-${CNE_RELEASE_MANIFEST_VERSION}.tgz
    

    Note

    This command creates a directory (f5-bigip-k8s-manifest-<VERSION>) that’s referred to as the release-manifest directory.

Create a script to get the version of a chart you specify from a release manifest

Note

The script you’ll create below (get-cne-chart-version.sh) looks at a release-manifest file whose version you’ve specified in the CNE_RELEASE_MANIFEST_VERSION environment variable. You give the script the name of a Helm chart, and the script provides the version of that chart. You’ll use this script when performing a clean installation or an upgrade of F5 BIG-IP Cloud-Native Edition.

  1. In a terminal window on your computer, make sure you’re in the release-manifest directory, which contains the release manifest (bigip-k8s-manifest-<VERSION>.yaml).

  2. Create a script that gets the version of a chart you specify from a release manifest:

    cat <<'EOF' > get-cne-chart-version.sh
    #!/bin/sh
    
    # To run this script:
    # ./get-cne-chart-version.sh <CHART_NAME>
    # or
    # ./get-cne-chart-version.sh <CHART_FILEPATH>
    #
    # Example (chart located in the charts directory; specify only the chart name):
    # ./get-cne-chart-version.sh cwc
    #
    # Example (chart located in a directory other than charts; specify the chart's filepath):
    # ./get-cne-chart-version.sh utils/f5-cert-gen
    
    # Ensure CNE_RELEASE_MANIFEST_VERSION is set
    if [ -z "${CNE_RELEASE_MANIFEST_VERSION:-}" ]; then
      echo "Error: CNE_RELEASE_MANIFEST_VERSION is not set. Please set this environment variable and try again." >&2
      exit 1
    fi
    
    case "$1" in
        */*) chart_path="$1" ;;
          *) chart_path="charts/$1" ;;
    esac
    
    CHART_PATH="$chart_path" \
      yq -r '
        .releases[]
        | select(.version == env(CNE_RELEASE_MANIFEST_VERSION))
        | .helm_charts[]
        | select(.name == env(CHART_PATH))
        | .version
      ' bigip-k8s-manifest-$CNE_RELEASE_MANIFEST_VERSION.yaml
    EOF
    
  3. Make the file executable:

    chmod +x get-cne-chart-version.sh