Search…
Custom CatalogSource in a restricted environment
This page describes the instructions for deploying TVK through a CustomCatalogSource on OpenShift in a network restricted environment.
If TVK is available within OperatorHub, please follow the official instructions from Red Hat to install an Operator within a restricted environment. If the TVK operator is not available within OperatorHub yet, please follow the instructions below.
Note - please ensure that you reflect the correct version number in the steps below. Example 2.9.1

Steps to install TVK

There are 4 simple steps that a user needs to perform:
  1. 1.
    Step 1 - Set up local registry (refer 1. below for step by step instructions)
  2. 2.
    Step 2 - Push TVK images to local registry
  3. 3.
    Step 3 - Update OCP to use the local registry
  4. 4.
    Step 4 - Update CatalogSource with the image path of this local repo

Step 1 - Set up local registry

Set up local registry - Ref
Deploy a registry server
  1. 1.
    Set up local registry on Ubuntu 20.04
  2. 2.
    Install docker
  3. 3.
    Start docker registry (using one of the options below)
    1. 1.
      Unsecured registry
    2. 2.
      1
      docker run -d -p 5000:5000 --restart=always --name registry registry:2
      Copied!
    3. 3.
      A secured registry using TLS authentication (Valid certificates are required in “certs” dir)
    4. 4.
      1
      docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/skregistry.kulkarnisachin.ml.crt -e REGISTRY_HTTP_TLS_KEY=/certs/skregistry.kulkarnisachin.ml.key -p 443:443 registry:2
      Copied!
  4. 4.
    By default, the registry stores its data on the local filesystem, whether you use a bind mount or a volume. You can store the registry data in an Amazon S3 bucket, Google Cloud Platform, or on another storage back-end by using storage drivers.

Step 2 - Push TVK images to local registry

All the TVK images as listed below are available at Quay or
Google Cloud Platform
TVK operator images
1
k8s-triliovault-operator
2
operator-webhook-init
Copied!
TVK app images
1
backup-scheduler
2
control-plane
3
datamover
4
datastore-attacher
5
metamover
6
exporter
7
dex:v2.28.1
8
trilio-init
9
trilio-admission-webhook
10
backup-cleaner
11
resource-cleaner
12
web
13
web-backend
14
backup-retention
15
target-browser
16
hook-executor
17
analyzer
18
ingress-controller
Copied!
The bash script below can be used to download and push images to local registry. Please edit TVK_VERSION, the list of images and tags required for given TVK version. Please replace value of "local_reg" to point to the local registry.
1
#!/bin/bash
2
3
## TVK version
4
## e.g. tvk_version="2.9.1"
5
tvk_version="<TVK_VERSION>"
6
7
## Update below details as required for the specific TVK version
8
## TVK images list for specific version TVK_VERSION
9
img_list="k8s-triliovault-operator operator-webhook-init backup-scheduler control-plane datamover datastore-attacher metamover exporter trilio-init trilio-admission-webhook backup-cleaner resource-cleaner web web-backend backup-retention target-browser hook-executor analyzer ingress-controller"
10
gcr_link="eu.gcr.io/amazing-chalice-243510"
11
## Edit the value of local_reg below to point to local registry
12
## e.g. local_reg="skregistry.kulkarnisachin.ml"
13
local_reg="<local registry url>"
14
15
for img in ${img_list}
16
do
17
echo "Adding $img"
18
docker pull ${gcr_link}/${img}:${tvk_version}
19
docker tag ${gcr_link}/${img}:${tvk_version} ${local_reg}/${img}:${tvk_version}
20
docker push ${local_reg}/${img}:${tvk_version}
21
done
22
23
## Pushing dex:v2.28.1 image as the version is different
24
docker pull ${gcr_link}/dex:v2.28.1
25
docker tag ${gcr_link}/dex:v2.28.1 ${local_reg}/dex:v2.28.1
26
docker push ${local_reg}/dex:v2.28.1
27
28
## List all the pkgs
29
docker image ls
Copied!
Example command to pull TVK operator image from Quay or
Google Cloud Platform
1
docker pull quay.io/triliovault/k8s-triliovault-operator:TVK_VERSION
Copied!
Example command to tag the image
1
docker tag quay.io/triliovault/k8s-triliovault-operator:TVK_VERSION skregistry.kulkarnisachin.ml/local-k8s-triliovault-operator
Copied!
Example command to push the image
1
docker push skregistry.kulkarnisachin.ml/local-k8s-triliovault-operator
Copied!

Step 3 - Update OCP to use the local Registry

1
$ export LOCAL_DOCKER_REGISTRY=skregistry.kulkarnisachin.ml
2
$ echo $LOCAL_DOCKER_REGISTRY
3
skregistry.kulkarnisachin.ml
4
$ oc patch image.config.openshift.io/cluster --type=merge -p '{"spec":{"registrySources":{"insecureRegistries":["'${LOCAL_DOCKER_REGISTRY}'"]}}}'
5
image.config.openshift.io/cluster patched
6
$
Copied!

Step 4 - Update CatalogSource with the image path of this local repo

1
$ cat operator-local-v263.yaml
2
apiVersion: operators.coreos.com/v1alpha1
3
kind: CatalogSource
4
metadata:
5
name: k8s-triliovault-manifest-local
6
namespace: openshift-marketplace
7
spec:
8
sourceType: grpc
9
image: skregistry.kulkarnisachin.ml/local-k8s-triliovault-operator
10
$
11
$ oc create -f operator-local-v263.yaml
12
catalogsource.operators.coreos.com/k8s-triliovault-manifest-local created
13
$
Copied!
Now, install this operator using OCP UI and continue using TVK following Getting Started Guide.