Relocate Container Images

This topic describes how to relocate the container images supplied in the PFS thick bundle.

Requirements

  • The PFS thick bundle and duffle have been downloaded.
  • A container registry is available for hosting images.
    • To install PFS on a cluster not running on GCP you can use your own registry.
    • To install PFS on your development machine, first follow the instructions to install a local registry for Minikube or Docker Desktop.
  • docker is installed and the docker CLI can push images to the registry.
    • for Docker Hub or other registries using basic authentication log in using docker login <registry-server>
    • for GCR see Configuring Google Cloud to configure a docker credential helper to push images.

Configure a REPOSITORY_PREFIX

The relocation process will create a relocation mapping file which you can use, together with the PFS thick bundle, to install PFS on a Kubernetes cluster. It will also push the images to your registry.

When you use duffle relocate, you will need to specify the following:

  • The path to the PFS thick bundle, together with --bundle-is-file
  • The path to the output relocation mapping file
  • The prefix to use for the repositories, usually your registry’s domain name and user or account name

For example, to use the Google Container Registry, the prefix is the registry domain name which is gcr.io plus your GCP Project ID.

REPOSITORY_PREFIX=gcr.io/$(gcloud config get-value core/project)
To install PFS on PKS or GKE, use the same GCP Project for Google Container Registry as you will use for your PKS or GKE cluster.

To use a pfs project in a Harbor registry deployed at say harbor.example.com:

REPOSITORY_PREFIX=harbor.example.com/pfs

For the local registry used with Minikube or Docker Desktop, use registry name registry.pfs.svc.cluster.local:5000 and a dummy username.

REPOSITORY_PREFIX=registry.pfs.svc.cluster.local:5000/testuser

Relocate using duffle

Change to the directory with the downloaded PFS thick bundle and run duffle relocate, saving the location mapping in pfs-relmap.json.

duffle relocate pfs-bundle-thick.tgz --bundle-is-file \
  --relocation-mapping pfs-relmap.json \
  --repository-prefix $REPOSITORY_PREFIX