Configuring your local environment

The subsequent commands in this guide use environment variables for configuring the various parameters of the GCP project and OpenShift or OKD cluster. For this purpose, a vars.sh file can be created with the following contents, replacing the values in angle brackets <> with the relevant values for your GCP project and cluster:

$ cat << EOF > vars.sh
export ANJ_PROJ=<ProjectName>
export ANJ_SACCT=<ServiceAccountName>
export ANJ_VPC=<NetworkName>
export ANJ_INSTANCE=<InstanceName>
export ANJ_REGION=<Region>
export ANJ_ZONE=<Zone>
export ANJ_IMAGE_REGISTRY=<ImageRegistry>
export ANJ_IMAGE_PATH=<ImagePath>
export ANJ_IMAGE_TAG=latest
export ANJ_NODE_LABEL_KEY="node-role.kubernetes.io/worker"
export ANJ_NODE_LABEL_VALUE=""
export ANJ_SACCT_IMAGE_PULLER="anjimagepuller"
export ANJ_BUCKET_NAME=<BucketName>
export ANJ_CLUSTER_REPLICAS=3
export ANJ_K8S_TOOLSET_DIR=<Directory where to find the {TOOLSET_NAME} files>
EOF

Description of configuration values

Environment variable Usage

ANJ_PROJ

The GCP project name where your cluster has been set up.

ANJ_VPC

The GCP VPC network name where your cluster is running.

ANJ_INSTANCE

The name of the VM instance used as the publicly available "bastion" gateway to the cluster.

ANJ_REGION

The GCP region, such as us-central1.

ANJ_ZONE

The GCP zone, such as us-central1-a.

ANJ_IMAGE_REGISTRY

The artifact registry used for storing the example Anjuna Confidential Pod container images. For example: ${ANJ_REGION}-docker.pkg.dev

ANJ_IMAGE_PATH

The path in the container image registry to store the images. For example: anjuna-openshift/anjuna-k8s-toolset-examples

ANJ_NODE_LABEL_KEY

The Node selector label key to help determine which Nodes of your cluster will have the Anjuna Kubernetes Toolset installed. E.g., node-role.kubernetes.io/worker.

ANJ_NODE_LABEL_VALUE

The Node selector label value. Empty is allowed.

ANJ_SACCT_IMAGE_PULLER

The name of the service account that will be created to enable access to the artifact registry for the Anjuna Kubernetes Toolset images.

ANJ_BUCKET_NAME

The name of a GCP bucket for storing the Confidential Container disk images you will build.

ANJ_K8S_TOOLSET_DIR

The directory where the Anjuna Kubernetes Toolset files are located.

The Anjuna Kubernetes Toolset uses Node labels to know on which Nodes of your cluster it should be installed. To query the existing Node labels of your cluster, run oc get nodes --show-labels.

Usually, the Anjuna Kubernetes Toolset is installed on all worker Nodes. In OpenShift, all worker Nodes are labeled with key node-role.kubernetes.io/worker and an empty value.

If you want to install the Anjuna Kubernetes Toolset to specific Nodes, label the Nodes with oc label nodes <node-name> <label-key>=<label-value>. Then change both ANJ_NODE_LABEL_KEY and ANJ_NODE_LABEL_VALUE to reflect the new values.

Load the configuration

For each terminal session, the configuration should be loaded in order for the values to be used in the commands in this guide. To do so, run the following command from within the directory where the vars.sh file is stored:

$ source vars.sh

Download and extract the Toolset archive

Download the Anjuna Kubernetes Toolset archive from the Anjuna Resource Center, and extract it to the directory defined by the ANJ_K8S_TOOLSET_DIR environment variable. To do so, run the following commands in the directory with the archive:

$ mkdir -p ${ANJ_K8S_TOOLSET_DIR}
$ tar -C ${ANJ_K8S_TOOLSET_DIR} -xf anjuna-k8s-sev*.tar.gz