Tanzu Service Mesh supports using a customer registry for pulling client-side images. For example, your organization may mandate that all images deployed would be pulled to a local registry and scanned for vulnerabilities before used. If your private image registry requires authentication to be accessed, you will need to use secrets on your client Kubernetes clusters. This topic explains how to create a secret for authenticating your private image registry during cluster onboarding.

Customer-owned registry support is used as a part of cluster onboarding. For more details on how to onboard a cluster and prerequisites, see Onboard a Cluster to Tanzu Service Mesh. The steps below explain how to create a secret. For more information on secret authentication for private registry, refer to Pull an Image from a Private Registry.

Prerequisites

In a terminal, run the following commands to set the shell variables:

password=<<password/token for the registry>>
username=<<username for registry>> 
registryURL=<<URL for the registry>> 
registrySecret=<<Name of the secret for registry account in TSM>>

Procedure

  1. Run the following commands to set up namespaces. To install TSM successfully, we need secret in these three namespaces: istio-system, kube-system, and vmware-system-tsm. As the Kubernetes installation includes kube-system by default, we now create istio-system and vmware-system-tsm namespaces.
    kubectl create namespace istio-system 
    kubectl create namespace vmware-system-tsm 

    The response message looks like:

    namespace/istio-system created
    namespace/vmware-system-tsm created

    If any of the namespaces already exist, you may receive the following error and there is no need to recreate it:

    Error from server (AlreadyExists): namespaces "<<namespace>>" already exists
  2. Run the following commands to create secret with name ${registrySecret} in istio-system, kube-system, and vmware-system-tsm namespaces respectively.
    Important:

    Use the code below to create a secret in any other namespaces that require authentication to the custom registry in order to pull images.

    kubectl create secret docker-registry "${registrySecret}" \ 
    --docker-server="${registryURL}" \ 
    --docker-username="${username}" \ 
    --docker-password="${password}" \ 
    --namespace=istio-system
    kubectl create secret docker-registry "${registrySecret}" \ 
    --docker-server="${registryURL}" \ 
    --docker-username="${username}" \ 
    --docker-password="${password}" \ 
    --namespace=kube-system
    kubectl create secret docker-registry "${registrySecret}" \ 
    --docker-server="${registryURL}" \ 
    --docker-username="${username}" \ 
    --docker-password="${password}" \ 
    --namespace=vmware-system-tsm
    Caution:

    When the secret name already exists, the kubectl create secret command will throw an error. You can either recreate the secret or update the existing secret with correct value.

    error: failed to create secret secrets "<<secret-name>>" already exists

    The secret is created which can be used in pod specification to pull images from your private image registry. A typical response message looks like:

    secret/<<registrysecret>> created

What to do next

Create a new custom image registry account by following these steps:

  1. In the navigation panel on the left side of the Tanzu Service Mesh console, select Image Registries under Tanzu Admin.

  2. Click Add Image Registry to open the New Image Registry Configuration modal window.

  3. Fill out the following details:

    Name

    Enter your account name.

    Description (optional)

    Optionally provide comments about your private image registry.

    Registry URL

    Enter the base URL of your private image registry.

    Authentication(optional)

    If authentication is required for your private image registry, select Use a Secret and enter the Secret Name.

  4. Click Save. Your private image registry account is created and saved for use during cluster onboarding.

Important:

As a prerequisite for onboarding a cluster using Tanzu Service Mesh images from your private registry, you need to mirror the required repositories from the TSM's public ECR registry located at public.ecr.aws/v6x6b8s5. For private registries that do not support mirroring, download the images from TSM's public ECR registry and push them into your private registries.

To mirror: list of repositories

  • public.ecr.aws/v6x6b8s5/config-service

  • public.ecr.aws/v6x6b8s5/k8s-cluster-manager

  • public.ecr.aws/v6x6b8s5/metrics-proxy

  • public.ecr.aws/v6x6b8s5/telegraf

  • public.ecr.aws/v6x6b8s5/tsm-agent-operator

  • public.ecr.aws/v6x6b8s5/vmwareallspark/install-cni

  • public.ecr.aws/v6x6b8s5/vmwareallspark/mixer

  • public.ecr.aws/v6x6b8s5/vmwareallspark/pilot

  • public.ecr.aws/v6x6b8s5/vmwareallspark/proxyv2

  • public.ecr.aws/v6x6b8s5/vmwareallspark/service-mesh-installer

  • public.ecr.aws/v6x6b8s5/vmwareallspark/service-mesh-manifests

  • public.ecr.aws/v6x6b8s5/ws-client

  • public.ecr.aws/v6x6b8s5/deployment_utils

To download: list of images

  • public.ecr.aws/v6x6b8s5/config-service:2294257dfbb51d081bb7a69dad80dedd4ee6a0ff

  • public.ecr.aws/v6x6b8s5/k8s-cluster-manager:v4.4.1

  • public.ecr.aws/v6x6b8s5/metrics-proxy:v3.2.0

  • public.ecr.aws/v6x6b8s5/telegraf:1.18.3

  • public.ecr.aws/v6x6b8s5/tsm-agent-operator:v3.5.0

  • public.ecr.aws/v6x6b8s5/vmwareallspark/install-cni:1.12.2-release-tsm-advance-distroless

  • public.ecr.aws/v6x6b8s5/vmwareallspark/mixer:1.7.3-custom-mixer-0.1-distroless

  • public.ecr.aws/v6x6b8s5/vmwareallspark/pilot:1.12.2-release-tsm-advance-distroless

  • public.ecr.aws/v6x6b8s5/vmwareallspark/proxyv2:1.12.2-release-tsm-advance-distroless

  • public.ecr.aws/v6x6b8s5/vmwareallspark/proxyv2:1.7.3-distroless

  • public.ecr.aws/v6x6b8s5/vmwareallspark/service-mesh-installer:v0.4.0

  • public.ecr.aws/v6x6b8s5/vmwareallspark/service-mesh-manifests:tsm-v5.0.4

  • public.ecr.aws/v6x6b8s5/ws-client:v3.3.0

  • public.ecr.aws/v6x6b8s5/deployment_utils:8d8b5b1d

Caution:

Deleting a custom image registry account: Tanzu service mesh does not currently support editing a registry location for an already onboarded cluster. In the rare case that you will need to change your registry the only option would be to delete the registry location definition and reonboard the cluster.

If you delete an image registry account from Tanzu Admin> Image Registries > More Actions > Delete Account, you will be notified that you have to reonboard the cluster to avoid ImagePullBackOff issue.