Installing License Service Reporter on disconnected and air gapped cluster
To install IBM License Service Reporter offline using the ibm-pak
plug-in, complete the following steps to download the CASE bundle, mirror images from your host to your private container registry, and create catalog sources:
- Set the environment and download the CASE file
- Generate mirror manifests
- Authenticating the registry
- Mirror images to final location
- Configure the cluster
- Install IBM Cloud Paks® by way of Red Hat OpenShift Container Platform
Set the environment and download the CASE file
If your host must connect to the internet via a proxy, you must set environment variables on the machine that accesses the internet via the proxy server.
If you are mirroring via connected mirroring, set the following environment variables on the machine that accesses the internet via the proxy server:
export https_proxy=http://proxy-server-hostname:port
export http_proxy=http://proxy-server-hostname:port
# Example:
export https_proxy=http://server.proxy.xyz.com:5018
export http_proxy=http://server.proxy.xyz.com:5018
Before mirroring your images, you can set the environment variables on your mirroring device, and connect to the internet so that you can download the corresponding CASE files. To finish preparing your host, complete the following steps:
Note: Save a copy of your environment variable values to a text editor. You can use that file as a reference to cut and paste from when you finish mirroring images to your registry.
-
Create the following environment variables with the installer image name and the version.
export CASE_NAME=<ibm-license-service-reporter-bundle> export CASE_VERSION=4.2.2
To find the CASE name and version, see IBM: Product CASE to Application Version.
-
Connect your host to the intranet.
-
The plug-in can detect the locale of your environment and provide textual help and messages. You can optionally set the locale by running the following command:
oc ibm-pak config locale -l LOCALE
Where LOCALE can be one of
de_DE
,en_US
,es_ES
,fr_FR
,it_IT
,ja_JP
,ko_KR
,pt_BR
,zh_Hans
,zh_Hant
. -
Configure the plug-in to download CASEs as OCI artifacts from IBM Cloud Container Registry (ICCR).
oc ibm-pak config repo 'IBM Cloud-Pak OCI registry' -r oci:cp.icr.io/cpopen --enable
-
Enable color output (optional with v1.4.0 and later)
oc ibm-pak config color --enable true
-
Download the image inventory for your IBM Cloud Pak to your host.
Tip: If you do not specify the CASE version, it downloads the latest CASE.
oc ibm-pak get \ ibm-license-service-reporter-bundle \ --version 4.2.2
By default, the root directory that is used by plug-in is ~/.ibm-pak
. This means that the preceding command will download the CASE under ~/.ibm-pak/data/cases/ibm-license-service-reporter-bundle/4.2.2
. You can configure
this root directory by setting the IBMPAK_HOME
environment variable. Assuming IBMPAK_HOME
is set, the preceding command will download the CASE under $IBMPAK_HOME/.ibm-pak/data/cases/ibm-license-service-reporter-bundle/4.2.2
.
The logs files will be available at $IBMPAK_HOME/.ibm-pak/logs/oc-ibm_pak.log
.
Your host is now configured and you are ready to mirror your images.
See the following notes:
-
Starting with v1.4.0, the plug-in creates a file,
component-set-config.yaml
, in the directory~/.ibm-pak/data/cases/ibm-license-service-reporter-bundle/4.2.2
to download the CASEs withoc ibm-pak get
. This file captures all the CASEs that were downloaded, pinning down their exact versions during this particular download. You can use this file later to download the same CASEs with same versions in another environment. You can check in this file to your source code repository and re-create the same environment each time you use this to download the CASEs. Run the following command:oc ibm-pak get -c file:///home/user/ibm-pak/data/cases/ibm-license-service-reporter-bundle/4.2.2/component-set-config.yaml
- Note that the path after
file://
should be an absolute path.
- Note that the path after
-
You can also edit this file defining the CASEs with pinned down versions that should include your product. The following is an example file,
my-csc.yaml
:name: "example-product" # <required> defines the name for the "product"; this is NOT a CASE name, but follows IBM CASE name rules. For more information, see https://ibm.biz/case-yaml version: "1.0.0" # <required> defines a version for the "product" description: "an example product targeting OCP 4.9" # <optional, but recommended> defines a human readable description for this listing of components cases: # list of CASEs. First item in the list is assumed to be the "top-level" CASE, and all others are dependencies - name: ibm-mas version: 5.5.2 launch: true # Exactly one CASE should have this field set to true. The launch scripts of that CASE are used as an entry point while executing 'ibm-pak launch' with a ComponentSetConfig - name: ibm-license-service-reporter-operator version: 1.15.2
Generate mirror manifests
Notes:
- If you want to install subsequent updates to your air-gapped environment, you must do a
CASE get
to get the image list when performing those updates. A registry namespace suffix can optionally be specified on the target registry to group-mirrored images.
-
Define the environment variable
$TARGET_REGISTRY
by running the following command:export TARGET_REGISTRY=<target-registry>
The
<target-registry>
refers to the registry (hostname and port) where your images will be mirrored to and accessed by the oc cluster. For example, setting TARGET_REGISTRY tomyregistry.com:5000/mynamespace
will create manifests such that images will be mirrored to the top-level namespacemynamespace
. -
Run the following commands to generate mirror manifests to be used when mirroring from a bastion host (connected mirroring):
oc ibm-pak generate mirror-manifests \ ibm-license-service-reporter-bundle \ $TARGET_REGISTRY \ --version 4.2.2
Example ~/.ibm-pak
directory structure for connected mirroring
The ~/.ibm-pak
directory structure is built over time as you save CASEs and mirror. The following tree shows an example of the ~/.ibm-pak
directory structure for connected mirroring:
tree ~/.ibm-pak
/root/.ibm-pak
├── config
│ └── config.yaml
├── data
│ ├── cases
│ │ └── $CASE_NAME
│ │ └── $CASE_VERSION
│ │ ├── XXXXX
│ │ ├── XXXXX
│ └── mirror
│ └── $CASE_NAME
│ └── $CASE_VERSION
│ ├── catalog-sources.yaml
│ ├── image-content-source-policy.yaml
│ └── images-mapping.txt
└── logs
└── oc-ibm_pak.log
Notes: A new directory ~/.ibm-pak/mirror
is created when you issue the oc ibm-pak generate mirror-manifests
command. This directory holds the image-content-source-policy.yaml
, images-mapping.txt
,
and catalog-sources.yaml
files.
Tip: If you are using a Red Hat® Quay.io registry and need to mirror images to a specific organization in the registry, you can target that organization by specifying:
```cmd {: codeblock}
export ORGANIZATION=<your-organization>
oc ibm-pak generate mirror-manifests
ibm-license-service-reporter-bundle
$TARGET_REGISTRY/$ORGANIZATION
--version 4.2.2
```
You can also generate manifests to mirror images to an intermediate registry server, then mirroring to a final registry server. This is done by passing the final registry server as an argument to --final-registry
:
``` {: codeblock}
export INTERMEDIATE_REGISTRY=
```cmd {: codeblock}
oc ibm-pak generate mirror-manifests \
ibm-license-service-reporter-bundle \
$INTERMEDIATE_REGISTRY \
--version 4.2.2
--final-registry $FINAL_REGISTRY
In this case, in place of a single mapping file (images-mapping.txt), two mapping files are created.
-
images-mapping-to-registry.txt
-
images-mapping-from-registry.txt
-
Run the following commands to generate mirror manifests to be used when mirroring from a file system (disconnected mirroring):
oc ibm-pak generate mirror-manifests \ ibm-license-service-reporter-bundle \ file://local \ --final-registry $TARGET_REGISTRY
Example ~/.ibm-pak
directory structure for disconnected mirroring
The following tree shows an example of the ~/.ibm-pak
directory structure for disconnected mirroring:
tree ~/.ibm-pak
/root/.ibm-pak
├── config
│ └── config.yaml
├── data
│ ├── cases
│ │ └── $CASE_NAME
│ │ └── $CASE_VERSION
│ │ ├── XXXX
│ │ ├── XXXX
│ └── mirror
│ └── $CASE_NAME
│ └── $CASE_VERSION
│ ├── catalog-sources.yaml
│ ├── image-content-source-policy.yaml
│ ├── images-mapping-to-filesystem.txt
│ └── images-mapping-from-filesystem.txt
└── logs
└── oc-ibm_pak.log
Note: A new directory ~/.ibm-pak/mirror
is created when you issue the oc ibm-pak generate mirror-manifests
command. This directory holds the image-content-source-policy.yaml
, images-mapping-to-filesystem.txt
,
images-mapping-from-filesystem.txt
, and catalog-sources.yaml
files.
Tip: Some products support the ability to generate mirror manifests only for a subset of images by using the --filter
argument and image grouping. The --filter
argument provides the ability to customize
which images are mirrored during an air-gapped installation. As an example for this function, ibm-license-service-reporter-bundle
CASE can be used, which contains groups that allow mirroring-specific variant of ibm-license-service-reporter-bundle
(Standard or Enterprise). Use the --filter
argument to target a variant of ibm-license-service-reporter-bundle
to mirror rather than the entire library. The filtering can be applied for groups and architectures.
Consider the following command:
oc ibm-pak generate mirror-manifests \
ibm-license-service-reporter-bundle \
file://local \
--final-registry $TARGET_REGISTRY \
--filter $GROUPS
The command was updated with a --filter
argument. For example, for $GROUPS
equal to ibmEdbStandard
the mirror manifests will be generated only for the images associated with ibm-license-service-reporter-bundle
in its Standard variant. The resulting image group consists of images in the ibm-license-service-reporter-bundle
image group in addition to any images that are not associated with any groups. This allows products to include
common images and the ability to reduce the number of images that you need to mirror.
Note: You can use the following command to list all the images that will be mirrored and the publicly accessible registries from where those images will be pulled from:
oc ibm-pak describe ibm-license-service-reporter-bundle --version 4.2.2 --list-mirror-images
Tip: The output of the preceding command will have two sections:
- Mirroring Details from Source to Target Registry
- Mirroring Details from Target to Final Registry. A connected mirroring path that does not involve an intermediate registry will only have the first section.
Note down the Registries found
sub sections in the preceding command output. You will need to authenticate against those registries so that the images can be pulled and mirrored to your local registry. See the next steps on authentication.
The Top-level namespaces found
section shows the list of namespaces under which the images will be mirrored. These namespaces should be created manually in your registry (which appears in the Destination column in the preceding
command output) root path if your registry does not allow automatic creation of namespaces.
Authenticating the registry
Complete the following steps to authenticate your registries:
-
Store authentication credentials for all source Docker registries.
Your product might require one or more authenticated registries. The following registries require authentication:
cp.icr.io
registry.redhat.io
registry.access.redhat.com
You must run the following command to configure credentials for all target registries that require authentication. Run the command separately for each registry:
Note: The
export REGISTRY_AUTH_FILE
command only needs to run once.export REGISTRY_AUTH_FILE=<path to the file which will store the auth credentials generated on podman login> podman login <TARGET_REGISTRY>
Important: When you log in to
cp.icr.io
, you must specify the user ascp
and the password, which is your Entitlement key from the IBM Cloud Container Registry. For example:podman login cp.icr.io Username: cp Password: Login Succeeded!
For example, if you export REGISTRY_AUTH_FILE=~/.ibm-pak/auth.json
, then after performing podman login
, you can see that the file is populated with registry credentials.
If you use docker login
, the authentication file is typically at $HOME/.docker/config.json
on Linux or %USERPROFILE%/.docker/config.json
on Windows. After docker login
you should export REGISTRY_AUTH_FILE
to point to that location. For example, in Linux you can issue the following command:
export REGISTRY_AUTH_FILE=$HOME/.docker/config.json
Directory | Description |
---|---|
~/.ibm-pak/config |
Stores the default configuration of the plug-in and has information about the public GitHub URL from where the cases are downloaded. |
~/.ibm-pak/data/cases |
This directory stores the CASE files when they are downloaded by issuing the oc ibm-pak get command. |
~/.ibm-pak/data/mirror |
This directory stores the image-mapping files, ImageContentSourcePolicy manifest in image-content-source-policy.yaml and CatalogSource manifest in one or more catalog-sourcesXXX.yaml . The files images-mapping-to-filesystem.txt and images-mapping-from-filesystem.txt are input to the oc image mirror command, which copies the images to the file system and from the file system to the registry respectively. |
~/.ibm-pak/data/logs |
This directory contains the oc-ibm_pak.log file, which captures all the logs that are generated by the plug-in. |
Mirror images to final location
Complete the steps in this section on your host that is connected to both the local Docker registry and the OpenShift Container Platform cluster.
-
Mirror images to the final location.
-
For mirroring from a bastion host (connected mirroring):
Mirror images to the
TARGET_REGISTRY
:oc image mirror \ -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping.txt \ --filter-by-os '.*' \ -a $REGISTRY_AUTH_FILE \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1 \ --continue-on-error=true
If you generated manifests in the previous steps to mirror images to an intermediate registry server followed by a final registry server, run the following commands:
-
Mirror images to the intermediate registry server:
oc image mirror \ -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping-to-registry.txt \ --filter-by-os '.*' \ -a $REGISTRY_AUTH_FILE \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1 \ --continue-on-error=true
-
Mirror images from the intermediate registry server to the final registry server:
oc image mirror \ -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping-from-registry.txt \ --filter-by-os '.*' \ -a $REGISTRY_AUTH_FILE \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1 \ --continue-on-error=true
The
oc image mirror --help
command can be run to see all the options available on the mirror command. Note that we usecontinue-on-error
to indicate that the command should try to mirror as much as possible and continue on errors.oc image mirror --help
Note: Sometimes based on the number and size of images to be mirrored, the
oc image mirror
might take longer. If you are issuing the command on a remote machine, it is recommended that you run the command in the background with a nohup so even if network connection to your remote machine is lost or you close the terminal, the mirroring will continue. For example, the following command will start the mirroring process in background and write the log tomy-mirror-progress.txt
.nohup oc image mirror \ -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping.txt \ -a $REGISTRY_AUTH_FILE \ --filter-by-os '.*' \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1 \ --continue-on-error=true > my-mirror-progress.txt 2>&1 &
You can view the progress of the mirror by issuing the following command on the remote machine:
tail -f my-mirror-progress.txt
-
-
For mirroring from a file system (disconnected mirroring):
Mirror images to your file system:
export IMAGE_PATH=<image-path> oc image mirror \ -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping-to-filesystem.txt \ --filter-by-os '.*' \ -a $REGISTRY_AUTH_FILE \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1 \ --continue-on-error=true \ --dir "$IMAGE_PATH"
The
<image-path>
refers to the local path to store the images. For example, in the previous section if providedfile://local
as input during generate mirror-manifests, then the preceding command will create a subdirectory v2/local inside directory that is referred by<image-path>
and copy the images under it.
The following command can be used to see all the options available on the mirror command. Note that
continue-on-error
is used to indicate that the command should try to mirror as much as possible and continue on errors.oc image mirror --help
Note: Sometimes based on the number and size of images to be mirrored, the
oc image mirror
might take longer. If you are issuing the command on a remote machine, it is recommended that you run the command in the background withnohup
so that even if you lose network connection to your remote machine or you close the terminal, the mirroring will continue. For example, the following command will start the mirroring process in the background and write the log tomy-mirror-progress.txt
.export IMAGE_PATH=<image-path> nohup oc image mirror \ -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping-to-filesystem.txt \ --filter-by-os '.*' \ -a $REGISTRY_AUTH_FILE \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1 \ --continue-on-error=true \ --dir "$IMAGE_PATH" > my-mirror-progress.txt 2>&1 &
You can view the progress of the mirror by issuing the following command on the remote machine:
tail -f my-mirror-progress.txt
-
-
For disconnected mirroring only: Continue to move the following items to your file system:
- The
<image-path>
directory that you specified in the previous step - The
auth
file referred by$REGISTRY_AUTH_FILE
~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping-from-filesystem.txt
- The
-
For disconnected mirroring only: Mirror images to the target registry from file system
Complete the steps in this section on your file system to copy the images from the file system to the
$TARGET_REGISTRY
. Your file system must be connected to the target docker registry.Important: If you used the placeholder value of
TARGET_REGISTRY
as a parameter to--final-registry
at the time of generating mirror manifests, then before running the following command, find and replace the placeholder value ofTARGET_REGISTRY
in the file,images-mapping-from-filesystem.txt
, with the actual registry where you want to mirror the images. For example, if you want to mirror images tomyregistry.com/mynamespace
then replaceTARGET_REGISTRY
withmyregistry.com/mynamespace
.-
Run the following command to copy the images (referred in the
images-mapping-from-filesystem.txt
file) from the directory referred by<image-path>
to the final target registry:export IMAGE_PATH=<image-path> oc image mirror \ -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/images-mapping-from-filesystem.txt \ -a $REGISTRY_AUTH_FILE \ --from-dir "$IMAGE_PATH" \ --filter-by-os '.*' \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1 \ --continue-on-error=true
-
Configure the cluster
-
Update the global image pull secret for your Red Hat OpenShift Container Platform cluster. Follow the steps in Updating the global cluster pull secret.
The documented steps in the link enable your cluster to have proper authentication credentials in place to pull images from your
TARGET_REGISTRY
as specified in theimage-content-source-policy.yaml
which you will apply to your cluster in the next step. -
Create ImageContentSourcePolicy
Important:
-
Before you run the command in this step, you must be logged in to your OpenShift cluster. Using the
oc login
command, log in to the Red Hat OpenShift Container Platform cluster where your final location resides. You can identify your specific oc login by clicking the user drop-down menu in the Red Hat OpenShift Container Platform console, then clicking Copy Login Command. -
If you used the placeholder value of
TARGET_REGISTRY
as a parameter to--final-registry
at the time of generating mirror manifests, then before running the following command, find and replace the placeholder value ofTARGET_REGISTRY
in file,~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/image-content-source-policy.yaml
with the actual registry where you want to mirror the images. For example, replaceTARGET_REGISTRY
withmyregistry.com/mynamespace
.
Run the following command to create ImageContentSourcePolicy:
oc apply -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/image-content-source-policy.yaml
If you are using Red Hat OpenShift Container Platform version 4.7 or earlier, this step might cause your cluster nodes to drain and restart sequentially to apply the configuration changes.
-
-
Verify that the ImageContentSourcePolicy resource is created.
oc get imageContentSourcePolicy
-
Verify your cluster node status and wait for all the nodes to be restarted before proceeding.
oc get MachineConfigPool
$ oc get MachineConfigPool -w NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE master rendered-master-53bda7041038b8007b038c08014626dc True False False 3 3 3 0 10d worker rendered-worker-b54afa4063414a9038958c766e8109f7 True False False 3 3 3 0 10d
After the
ImageContentsourcePolicy
and global image pull secret are applied, the configuration of your nodes will be updated sequentially. Wait until allMachineConfigPools
are in theUPDATED=True
status before proceeding. -
Create a new project for the CASE commands by running the following commands:
Note: You must be logged in to a cluster before performing the following steps.
export NAMESPACE=<YOUR_NAMESPACE>
oc new-project $NAMESPACE
-
Optional: If you use an insecure registry, you must add the target registry to the cluster insecureRegistries list.
oc patch image.config.openshift.io/cluster --type=merge \ -p '{"spec":{"registrySources":{"insecureRegistries":["'${TARGET_REGISTRY}'"]}}}'
-
Verify your cluster node status and wait for all the nodes to be restarted before proceeding.
oc get MachineConfigPool -w
After the
ImageContentsourcePolicy
and global image pull secret are applied, the configuration of your nodes will be updated sequentially. Wait until allMachineConfigPools
are updated.
Create the catalog source and install the IBM Cloud Pak
Important: Before you run any of the oc ibm-pak launch \
command, you must be logged in to your cluster. Using the oc login
command, log in to the Red Hat OpenShift Container Platform cluster where
your final location resides. You can identify your specific oc login by clicking the user drop-down menu in the Red Hat OpenShift Container Platform console, then clicking Copy Login Command.
-
Set the namespace to install the IBM Cloud Pak catalog:
export NAMESPACE=<YOUR_NAMESPACE>
-
Set the environment variable of the
--inventory
parameter:export CASE_INVENTORY_SETUP=<YOUR_CASE_INVENTORY_SETUP>
-
Create and configure a catalog source.
The recommended way to install the catalog is to run the following command:
oc apply -f ~/.ibm-pak/data/mirror/ibm-license-service-reporter-bundle/4.2.2/catalog-sources.yaml
-
Verify that the
CatalogSource
for your IBM Cloud Pak operator is created.oc get pods -n openshift-marketplace oc get catalogsource -n openshift-marketplace
Installing the operator from OperatorHub (console)
-
In the All Items field, enter
IBM License Service Reporter
. The IBM License Service Reporter operator is displayed. -
Click the IBM License Service Reporter tile. The IBM Cert Manager window is displayed.
-
Click Install. You see the Install Operator page.
-
Set Update Channel to the
v4.2
version. -
Set Installation Mode to
All namespaces on the cluster (default)
. -
Set Update approval to
Automatic
. -
Click Install.
Installing the operator using CLI
-
Create a YAML file named,
def-ibmlicenseservicereporter.yaml
, with the resources definitions that you need. -
Apply this YAML file:
oc apply -f def-ibmlicenseservicereporter.yaml
apiVersion: v1 kind: Namespace metadata: name: ibm-license-service-reporter --- apiVersion: operators.coreos.com/v1alpha2 kind: OperatorGroup metadata: name: operatorgroup namespace: ibm-license-service-reporter spec: targetNamespaces: - ibm-license-service-reporter --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: ibm-license-service-reporter-operator namespace: $(LSR_NAMESPACE) spec: channel: {{site.data.keyword.cs_channel_cert}} installPlanApproval: Automatic name: ibm-license-service-reporter-operator source: ibm-license-service-reporter-bundle-catalog sourceNamespace: openshift-marketplace
Installing the operator using script
-
If you want to migrate IBM License Service Reporter and licensing, you can add
./setup_singleton.sh --license-accept --operator-namespace <Cloud Pak 2 Fooundational Service Namespace> --enable-licensing
.Note: Ensure that IBM License Service Reporter and licensing catalogsources exist in the
openshift-marketplace
namespace. -
If it is a fresh install, execute the following script:
./setup_singleton.sh --license-accept --enable-licensing