Create a manifest for the F5 Artifact Registry pull secret

Introduction

If you did not store Helm charts and Docker container images in a private artifact registry, you must create a pull-secret manifest for authenticating to F5 Artifact Registry. F5 Artifact Registry always requires authentication.

How the pull-secret manifest is used

When you later perform a clean installation of the CNE core and CNE instances (each in its own namespace), you’ll use the pull-secret manifest to create a pull secret for F5 Artifact Registry in each namespace. Kubernetes uses the F5 Artifact Registry’s pull secret to authenticate to F5 Artifact Registry when pulling Docker container images from it.

Create a manifest for the F5 Artifact Registry pull secret

Note

If you stored Helm charts and Docker container images in a private artifact registry, skip this task. You already created a manifest for your private artifact registry’s pull secret and don’t need a manifest for the F5 Artifact Registry pull secret.

  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 file to use as a script that creates a manifest for the F5 Artifact Registry pull secret:

    $ touch create-far-pull-secret-manifest.sh
    
  3. Open the file in a text editor.

  4. Copy the following code and paste it into the file:

    #!/bin/bash
    
    # Store the service account key in SERVICE_ACCOUNT_KEY.
    # The name of the file that contains the service account key may be
    # provided as the first argument to this script. If not,
    # the filename defaults to ../cne_pull_64.json.
    SERVICE_ACCOUNT_KEY=$(cat ${1:-../cne_pull_64.json})
    
    # Create the SERVICE_ACCOUNT_K8S_SECRET variable by prefixing SERVICE_ACCOUNT_KEY with "_json_key_base64:".
    SERVICE_ACCOUNT_K8S_SECRET=$(echo "_json_key_base64:${SERVICE_ACCOUNT_KEY}" | base64 -w 0)
    
    cat <<EOF > far-pull-secret.yaml
    ---
    apiVersion: v1
    kind: Secret
    metadata:
      name: far-pull-secret
    data:
      .dockerconfigjson: $(echo '{"auths": {"repo.f5.com": {"auth": "'$SERVICE_ACCOUNT_K8S_SECRET'"}}}' \
        | base64 -w 0)
    type: kubernetes.io/dockerconfigjson
    EOF
    
  5. Save and close the file.

  6. Make the file executable:

    $ chmod +x create-far-pull-secret-manifest.sh
    
  7. Run the script:

    $ ./create-far-pull-secret-manifest.sh ../cne_pull_64.json
    

    The script creates a file named far-pull-secret.yaml in the release-manifest directory.