Installing the agent on Red Hat OpenShift

You can install the Instana agent on a Red Hat OpenShift cluster by using different methods depending on your requirements. See the following list to check the prerequisite conditions, learn about all the available installation methods, and install the agent on Red Hat OpenShift:

Prerequisites

Before you install the agent, ensure that the prerequisites are met.

Note:
To check the RBAC permissions that the Instana agent operator requires and installs, see Required RBAC.

Installing by using the operator

To install the Instana agent on Red Hat OpenShift by using the operator, complete the following steps:

  1. Complete the prerequisite steps before you proceed with installing the operator.

  2. Install the operator by using one of the following methods:

Note:
Before you install the agent by using the operator, you must first set up a project for the Instana agent and configure its permissions. For more information, see Setting up project and service accounts.

Installing the operator by using OLM

To install the Instana agent on Red Hat OpenShift by using OLM, complete the following steps:

  1. Install the Instana agent operator from OperatorHub.io or the Red Hat OpenShift catalog of Containerized applications.

  2. If you don't already have a target namespace, create a namespace where the Instana agent must be installed. For example, you can create a namespace instana-agent to run the operator. The agent does not need to run in the same namespace as the operator.

  3. Follow Step 2 to Step 6 in the Installing the operator manually section to create the custom resource for the agent and apply the custom resource. The operator picks up the configuration from the custom resource and deploys the Instana agent.

Installing the operator manually

To install the operator manually on Red Hat OpenShift, complete the following steps:

  1. On the home page of the Instana UI, click Agents & collectors. On the Instana agents tab, select Install agents.

  2. On the agent deployment catalog page, click the tile OpenShift - Operator.

  3. Deploy the latest operator version by using the following command:

    kubectl apply -f https://github.com/instana/instana-agent-operator/releases/latest/download/instana-agent-operator.yaml

    After you run this command, the operator is up and running in the namespace that you created, and waiting for the instana-agent custom resource to be created.

  4. Enter the cluster name and (optionally) the agent zone that you want the cluster to be part of.

    The cluster name (<your_cluster_name>) is the customized name of the cluster that is monitored by this DaemonSet.

    The agent zone (<your_zone_name>) is used to customize the zone grouping, which is displayed on the infrastructure map.

  5. Create a custom resource YAML file by copying the YAML template provided in the Instana UI.

    The YAML template is pre-filled with your agent key, host agent endpoint, cluster name, and agent zone.

  6. Edit the custom resource YAML file. For an example of the YAML file, see instana_v1_extended_instanaagent.yaml.

    1. The Instana agent custom resource supports the exact same configuration as the Instana Helm chart. For a detailed list of all the configuration parameters and examples, see Instana Helm chart.

      Also see the following topics:

    2. If you want to install the agent in a self-hosted environment, and the agent key does not have authority to download from the Instana public artifactory, add the download key as downloadKey: <your_download_key>. For example:

    agent:
      key: wPYpH7EGK0ucLaO0Nu7BYw
      downloadKey: m007YDoWNload6kE42yukg
      endpointHost: ...
    1. If you want to add TLS encryption for the agent endpoint, use an existing secret or use a certificate and private key:

      Using existing secret

      You can use an existing secret of the type kubernetes.io/tls for TLS encryption. But the agent.tls.secretName must be provided in the custom resource YAML file.

      Use a certificate and private key

      Instead of an existing secret, a certificate and a private key can be used. The certificate and private key must be base64-encoded.

      To use this variant, add the following two parameters to the custom resource YAML file:

      • agent.tls.certificate
      • agent.tls.key
      Note:
      If agent.tls.secretName is set, then agent.tls.certificate and agent.tls.key are ignored.
    2. Optional: You can replace the following values:

      • agent.env: Use this field to specify environment variables for the agent, such as the proxy configuration for the agent. For more possible environment values, see agent configuration. See the following example:

        spec:
            agent:
              env:
               INSTANA_AGENT_TAGS: staging
      • agent.configuration_yaml: Use this field to specify an agent configuration file configuration.yaml. See the following example:

        spec:
            agent:
              configuration_yaml: |
                # Example of configuration yaml template
                # Host
                com.instana.plugin.host:
                  tags:
                    - 'dev'
                    - 'app1'

        For more information, see Configuring host agents by using the agent configuration file.

    3. If you want to deploy the static agent, configure the custom resource YAML file with the static agent image. To list the static agent image, set agent.image.name to containers.instana.io/instana/release/agent/static. See the following example:

      spec:
       agent:
         image:
           name: containers.instana.io/instana/release/agent/static
  7. Apply the custom resource YAML file:

    kubectl apply -f instana-agent.customresource.yaml

    where instana-agent.customresource.yaml is the name of your custom resource YAML file.

    The operator picks up the configuration from the custom resource YAML file and deploys the Instana agent.

Now the agent is installed. For what you can do after the installation, go to the What to do next section.

To update the agent, see Updating an operator installation.

Installing by using the operator in an air-gapped environment

In a fully air-gapped environment, the cluster nodes cannot pull images directly from icr.io or containers.instana.io. Use a jump host (bastion) with internet access to copy all required images to a private registry that the cluster can access. Then, deploy the operator from the mirrored images.

The steps in this section use a private namespace in IBM Cloud Container Registry (ICR) as the target registry. Any OCI-compliant registry that is reachable from the jump host and from the target cluster works equally well, for example JFrog Artifactory, Red Hat Quay, Harbor, or a self-hosted Distribution registry. If you use a registry other than ICR, skip the ICR-specific steps and substitute your own registry URL and authentication credentials wherever icr.io appears.

The overall flow is as follows:
[internet] ──pull──▶ jump host ──push──▶ <private-registry>/instana-airgap-mirror ◀──pull── OCP cluster
                      (skopeo)

The scripts/mirror-instana-images.sh script handles mirroring all three components in one invocation:

Table 1. Components and source images
Component Source image
Operator icr.io/instana/instana-agent-operator:latest
Agent (static) containers.instana.io/instana/release/agent/static:latest
Kubernetes sensor icr.io/instana/k8sensor:latest
Note:
The script copies the static agent image. Use the dynamic agent image only if you want automatic dynamic agent updates.

Prerequisites for air-gapped operator installation

Install the following tools on the jump host before you proceed:

Table 2. Required tools for jump host
Tool Purpose Install guide
skopeo Copy container images between registries without a Docker daemon dnf install skopeo and brew install skopeo
jq Parse image metadata JSON returned by skopeo inspect dnf install jq and brew install jq
oc OpenShift CLI Distributed with OpenShift
ibmcloud CLI + Container Registry plug-in Create and authenticate with the ICR namespace ibmcloud plugin install container-registry
Note:
The ibmcloud CLI is only required when ICR is used as the target registry. Skip it if you are using a different registry such as Artifactory, Quay, or Harbor.
Verify that the required tools are available:
skopeo --version
jq --version
oc version --client

Installation

To install the agent by using the operator in an air-gapped environment, complete the following steps:

  1. Prepare your private registry and authenticate skopeo to it.
    Note:
    If you are using ICR, complete the following steps. If you are using a different registry (Artifactory, Quay, Harbor, or Distribution), create the equivalent target repository, authenticate skopeo with your registry's credentials, and then continue with step 2.
    1. Log in to IBM Cloud and create a dedicated namespace for the mirrored images:
      ibmcloud login --sso
      ibmcloud cr region-set global
      ibmcloud cr namespace-add instana-airgap-mirror
    2. Create a dedicated IAM API key for non-interactive registry access:
      ibmcloud iam api-key-create instana-mirror-key -d "skopeo mirror key"
    3. Export the key without echoing it to the terminal, and verify that the login works:
      read -rs ICR_API_KEY
      skopeo login --username iamapikey --password "$ICR_API_KEY" icr.io
      Note:
      If a previous ibmcloud cr login wrote an identitytoken field into ~/.docker/config.json that skopeo cannot overwrite, open the file, delete the icr.io entry, save it, and retry skopeo login.
  2. Obtain an Instana agent download key.

    The static agent image lives on containers.instana.io, which requires an agent download key. Retrieve it from the Instana UI Settings → Agents → Install Agent, or ask your Instana account team. Store it without echoing:

    read -rs INSTANA_AGENT_DOWNLOAD_KEY
  3. Mirror the images to the private registry by running the mirror script from the jump host. The script resolves the current :latest version for each image, copies both the :latest tag and the versioned tag to the destination, and writes a properties file with all resolved coordinates.
    ./scripts/mirror-instana-images.sh \
      --registry      icr.io \
      --namespace     instana-airgap-mirror \
      --dest-creds    "iamapikey:$ICR_API_KEY" \
      --dest-tls-verify true \
      --agent-download-key "$INSTANA_AGENT_DOWNLOAD_KEY"

    The script produces a mirror-instana-images.properties file that contains the exact image coordinates resolved during mirroring. For example:

    operator_version=2.2.14
    operator_destination=icr.io/instana-airgap-mirror/instana-agent-operator
    agent_version=1.320.3
    agent_destination=icr.io/instana-airgap-mirror/agent
    k8sensor_version=1.4.16
    k8sensor_destination=icr.io/instana-airgap-mirror/k8sensor
    Note:
    Store this file alongside your deployment manifests. The image coordinates it contains are used to configure the InstanaAgent custom resource in a later step.
  4. Confirm that all three repositories are present in the registry and have the expected tags. For ICR, run the following command:
    ibmcloud cr images --restrict instana-airgap-mirror
  5. Create the target namespace and grant the service accounts the required Security Context Constraints (SCCs). The agent pod runs privileged (host network and host PID), and the remote-agent service account needs anyuid for its init container.
    INSTANA_AGENT_NAMESPACE=instana-agent
    
    oc new-project ${INSTANA_AGENT_NAMESPACE}
    oc adm policy add-scc-to-user privileged -z instana-agent -n "${INSTANA_AGENT_NAMESPACE}"
    oc adm policy add-scc-to-user anyuid -z instana-agent-remote -n "${INSTANA_AGENT_NAMESPACE}"
  6. Create a Kubernetes pull secret with the registry credentials, then pre-create the operator service account and link the secret to it before you deploy. Pre-create the service account. If you do not, the operator manifest creates it in the next step, which causes an ImagePullBackOff error on first startup.
    oc create secret docker-registry icr-pull-secret \
      --docker-server=icr.io \
      --docker-username=iamapikey \
      --docker-password="$ICR_API_KEY" \
      -n instana-agent
    
    oc create serviceaccount instana-agent-operator -n instana-agent
    oc secrets link instana-agent-operator icr-pull-secret --for=pull -n instana-agent
  7. Download the latest release manifest and replace the upstream operator image reference with the mirrored one:
    curl -fsSL \
      https://github.com/instana/instana-agent-operator/releases/latest/download/instana-agent-operator.yaml \
      -o instana-agent-operator.yaml
    
    sed 's|image: icr.io/instana/instana-agent-operator:|image: icr.io/instana-airgap-mirror/instana-agent-operator:|g' \
      instana-agent-operator.yaml > instana-agent-operator-mirrored.yaml
    Note:
    Only the operator image line is replaced here. The InstanaAgent custom resource that references the agent and k8sensor images is configured separately in a later step.
  8. Apply the patched manifest and wait for the rollout to complete:
    oc apply -f instana-agent-operator-mirrored.yaml
    oc rollout status deployment/instana-agent-controller-manager \
      -n instana-agent --timeout=120s
  9. Pre-create the agent service accounts and link the pull secret to each one. The operator creates instana-agent and instana-agent-k8sensor when you first apply the InstanaAgent custom resource, but OpenShift does not propagate pull secrets from the default service account to pods running under these operator-managed accounts. If you pre-create them, you avoid an ErrImagePull error on first pod scheduling.
    oc create serviceaccount instana-agent -n instana-agent
    oc create serviceaccount instana-agent-k8sensor -n instana-agent
    
    oc secrets link instana-agent icr-pull-secret --for=pull -n instana-agent
    oc secrets link instana-agent-k8sensor icr-pull-secret --for=pull -n instana-agent
    Note:
    If you already applied the custom resource and pods are in ErrImagePull, the service accounts exist, but the secret is not linked yet. Run the preceding two oc secrets link commands and then delete the failing pods, so they are rescheduled.
  10. Create the InstanaAgent custom resource manifest. Replace the placeholder values with your actual configuration:
    • Replace <INSTANA_AGENT_KEY> and <INSTANA_AGENT_DOWNLOAD_KEY> with the keys from the Instana UI Agents & Collectors → Install Agents → OpenShift Operator.
    • Substitute the image tags with the versions from mirror-instana-images.properties.
    • Update the proxy fields to match your environment.
    • Set proxyUser and proxyPassword to empty strings if no proxy authentication is required.
    apiVersion: instana.io/v1
    kind: InstanaAgent
    metadata:
      name: instana-agent
      namespace: instana-agent
    spec:
      zone:
        name: <your_zone_name>
      cluster:
        name: <your_cluster_name>
      agent:
        key: <INSTANA_AGENT_KEY>
        downloadKey: <INSTANA_AGENT_DOWNLOAD_KEY>
        endpointHost: <your-ingress-endpoint>
        endpointPort: "443"
        proxyHost: <proxy-host>
        proxyPort: "3128"
        proxyProtocol: http
        proxyUser: ""
        proxyPassword: ""
        image:
          name: icr.io/instana-airgap-mirror/agent
          tag: "<agent_version>"       # value of agent_version in mirror-instana-images.properties
        env: {}
        configuration_yaml: |
          # You can leave this empty, or use this to configure your Instana agent.
          # See https://docs.instana.io/setup_and_manage/host_agent/on/kubernetes/
      k8s_sensor:
        image:
          name: icr.io/instana-airgap-mirror/k8sensor
          tag: "<k8sensor_version>"    # value of k8sensor_version in mirror-instana-images.properties
    Note:
    No pullSecrets field is required in the custom resource because you provided image pull credentials by patching icr-pull-secret onto the service accounts in the previous step.
  11. Apply the custom resource:
    oc apply -f instana-agent-cr.yaml
  12. Verify the deployment by listing the pods in the instana-agent namespace:
    oc get pods -n instana-agent

    When the deployment is complete, you see one instana-agent-controller-manager pod, one instana-agent DaemonSet pod per node, and three instana-agent-k8sensor pods, all in Running status. Once the backend connection is established through the configured proxy, the cluster appears in the Instana UI under the configured zone and cluster name.

The agent is installed. For more information about the next steps, see the What to do next section.

Installing by using the Helm chart

You can use the Helm chart to install the agent. The Helm chart adds the Instana agent to all nodes that can be scheduled in your cluster by using a DaemonSet.

To install the Instana agent by using Helm chart, you must first install or upgrade to Helm version 3.

The Instana agent Helm chart supports Red Hat OpenShift 4.x.

To install the Instana agent on Red Hat OpenShift by using the Helm chart, complete the following steps:

  1. On the home page of the Instana UI, click Agents & collectors. On the Instana Agents tab, select Install agents.

  2. On the agent deployment catalog page, click the tile OpenShift - Helm chart.

  3. Enter the cluster name and (optionally) the agent zone that you want the cluster to be part of.

    The cluster name (<your_cluster_name>) is the customized name of the cluster that is monitored by this DaemonSet.

    The agent zone (<your_zone_name>) is used to customize the zone grouping displayed on the infrastructure map.

    The agent deployment code is updated with the values that you provide. All the other required parameters are pre-populated in the agent deployment code, which looks like the following example:

    INSTANA_AGENT_NAMESPACE=instana-agent
    oc login -u system:admin
    oc new-project ${INSTANA_AGENT_NAMESPACE}
    oc adm policy add-scc-to-user privileged -z instana-agent -n "${INSTANA_AGENT_NAMESPACE}"
    oc adm policy add-scc-to-user anyuid -z instana-agent-remote -n "${INSTANA_AGENT_NAMESPACE}"
    helm install instana-agent \
    --repo https://agents.instana.io/helm \
    --namespace ${INSTANA_AGENT_NAMESPACE} \
    --set agent.key='<your_agent_key>' \
    --set agent.endpointHost='<your_host_agent_endpoint>' \
    --set agent.endpointPort=443 \
    --set cluster.name='<your_cluster_name>' \
    --set zone.name='<your_zone_name>' \
    instana-agent
  4. When you install the Instana agent on IBM Z or LinuxONE, configure distinct zones during the installation process. This separation is important because both the Instana agent and the application workloads it monitors is within the same cluster.

    Unlike other environments where Instana and the monitored applications are deployed separately, IBM Z or LinuxONE setups share the same cluster. It makes isolating zones essential. To isolate zones, ensure that the nodes where Instana is installed are properly labeled and tainted.

    If the label used is node-role.kubernetes.io/monitor=true. To verify that the Instana nodes are labelled correctly, run the following command:

    kubectl get nodes -l node-role.kubernetes.io/monitor=true

    To verify that the Instana nodes are tainted as expected with the sample taint node.instana.io/monitor=true, run the following command:

    kubectl get nodes -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range .spec.taints[*]}{.key}{"="}{.value}{"\t"}{end}{"\n"}{end}' | grep 'node\.instana\.io/monitor'

    After verifying Instana nodes are labelled and tainted, you can follow these steps:

    1. Label application worklad nodes Ensure that the nodes running application workloads are appropriately labeled to differentiate them from infrastructure nodes.

      NODE=<your node name>
      CLUSTER=<your cluster name>
      oc label node worker${NODE}.${CLUSTER_NAME} workload="true"
    2. Define Two Zones

      • Set the Instana nodes to the INFRASTRUCTURE mode.
      • Set the application workload nodes to the APM mode.
      • Create a YAML file agent_values.yaml and speify the zones along with their affinity and tolerations in the file.
      zones:
        - name: workloads
          mode: APM
          affinity:
             nodeAffinity:
             requiredDuringSchedulingIgnoredDuringExecution:
                nodeSelectorTerms:
                  - matchExpressions:
                      - key: workload
                        operator: Exists
        - name: instana-nodes
          mode: INFRASTRUCTURE
          tolerations:
            - key: node.instana.io/monitor
              operator: Equal
              effect: NoSchedule
              value: "true"
          affinity:
            nodeAffinity:
              requiredDuringSchedulingIgnoredDuringExecution:
                nodeSelectorTerms:
                  - matchExpressions:
                      - key: node-role.kubernetes.io/monitor
                        operator: In
                        values:
                          - "true"

      In this sample YAML file, it is assumed that the Instana nodes are labeled with node-role.kubernetes.io/monitor=true and tainted with key: node.instana.io/monitor=true. Update these values according to your own node labeling and tainting conventions.

      Append your custom yaml file at the end of agent deployment code as shown in the following example:

      INSTANA_AGENT_NAMESPACE=instana-agent
      oc login -u system:admin
      oc new-project ${INSTANA_AGENT_NAMESPACE}
      oc adm policy add-scc-to-user privileged -z instana-agent -n "${INSTANA_AGENT_NAMESPACE}"
      oc adm policy add-scc-to-user anyuid -z instana-agent-remote -n "${INSTANA_AGENT_NAMESPACE}"
      helm install instana-agent \
      --repo https://agents.instana.io/helm \
      --namespace ${INSTANA_AGENT_NAMESPACE} \
      --set agent.key='<your_agent_key>' \
      --set agent.endpointHost='<your_host_agent_endpoint>' \
      --set agent.endpointPort=443 \
      --set cluster.name='<your_cluster_name>' \
      --set zone.name='<your_zone_name>' \
      instana-agent -f agent_values.yaml
  5. Edit the agent deployment code.

    • To configure the installation, you can specify the values on the command line by using the --set flag or provide a YAML file with your values by using the -f flag. For a detailed list of all the configuration parameters and examples, see Instana Helm chart. Also, see the following topics:

    • Optional: To deploy the static agent, set the flag --set agent.image.name=containers.instana.io/instana/release/agent/static.

    • The Kubernetes service that is created by default exposes the following items to the cluster:

    • Optional: If you want to add TLS encryption for the agent endpoint, use an existing secret or use a certificate and private key:

      • Using existing secret of type kubernetes.io/tls

        You can use an existing secret of the type kubernetes.io/tls for TLS encryption. But you must specify the secretName with --set 'agent.tls.secretName=<YOUR_SECRET_NAME>' during the installation. The files from the provided secret is then included in the agent.

      • Use a certificate and private key

        The certificate and private key must be base64-encoded. To use this variant, run helm install with the following extra parameters:

        --set 'agent.tls.certificate=<YOUR_CERTIFICATE_BASE64_ENCODED>'
        --set 'agent.tls.key=<YOUR_PRIVATE_KEY_BASE64_ENCODED>'
        Note:
        If agent.tls.secretName is set, then agent.tls.certificate and agent.tls.key are ignored.
  6. Copy and then run the agent deployment code.

Now the agent is installed. For what you can do after the installation, go to the What to do next section.

To update the agent, see Updating an operator installation.

Installing by using Helm chart in an air-gapped environment

Red Hat OpenShift provides an internal container registry that you can use in air-gapped environments to store images to run workloads in the cluster.

Make sure that you install the following software before installing the agent:

  • OpenShift CLI (oc)
  • jq
  • skopeo
Note:
The following steps are tested on Red Hat Enterprise Linux 9.4, and are applicable to most Linux distributions.

To install the Instana agent by using Helm chart in an air-gapped environment, complete the following steps:

  1. Log in to the Red Hat OpenShift cluster as administrator by running the following command:

    oc login --server=https://api.myopenshiftcluster.com:6443 -u kubeadmin -p $OPENSHIFT_PASSWORD
  2. Expose the internal container registry to be accessible from your jump host:

    oc patch configs.imageregistry.operator.openshift.io/cluster --type merge -p '{"spec":{"defaultRoute":true}}'
  3. Retrieve the hostname that is used to access the registry externally:

    HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
  4. Create a project 'instana' (if it is not created earlier) in the Red hat OpenShift cluster to enable pushing images to the specified namespace:

    oc get project instana || oc new-project instana
  5. Display the registry host information:

    echo "${HOST}" # default-route-openshift-image-registry.apps.myopenshiftcluster.com
  6. Obtain the certificate of the trusted ingress operator and add it in the certificate authority (CA) directory of the system:

    oc extract secret/$(oc get ingresscontroller -n openshift-ingress-operator default -o json | jq '.spec.defaultCertificate.name // "router-certs-default"' -r) -n openshift-ingress --confirm

    Failing this step might result in certificate warnings (for example, tls: failed to verify certificate: x509: certificate signed by unknown authority) when you try to push the image to the target registry.

  7. Import the CA into the system's trusted certificate authority store by using the following commands:

    sudo mv tls.crt /etc/pki/ca-trust/source/anchors/
    sudo update-ca-trust
  8. Log in to both the source and destination registries by using Skopeo:

    skopeo login -u kubeadmin -p $(oc whoami -t) $HOST
    skopeo login -u _ -p $AGENT_DOWNLOAD_KEY containers.instana.io
  9. Determine the latest versions available for each component:

    LATEST_OPERATOR_VERSION=$(skopeo inspect docker://icr.io/instana/instana-agent-operator:latest | jq -r ".Labels.version")
    LATEST_AGENT_VERSION=$(skopeo inspect docker://containers.instana.io/instana/release/agent/static:latest | jq -r ".Labels.version")
    LATEST_K8S_SENSOR_VERSION=$(skopeo inspect docker://icr.io/instana/k8sensor:latest | jq -r '.Labels["org.opencontainers.image.revision"]')
  10. Copy the required components to the local registry:

    skopeo copy docker://icr.io/instana/instana-agent-operator:latest "docker://${HOST}/instana/instana-agent-operator:${LATEST_OPERATOR_VERSION}"
    skopeo copy docker://containers.instana.io/instana/release/agent/static:latest "docker://${HOST}/instana/instana-agent-static:${LATEST_AGENT_VERSION}"
    skopeo copy docker://icr.io/instana/k8sensor:latest "docker://${HOST}/instana/k8sensor:${LATEST_K8S_SENSOR_VERSION}"

Deploying the agent Helm chart

To fetch the Helm chart, complete the following steps:

  1. Create a new namespace for the agent deployment:

    INSTANA_AGENT_NAMESPACE=instana-agent
    oc new-project ${INSTANA_AGENT_NAMESPACE}
  2. Fetch the Helm chart on the jump host:

    helm pull instana-agent --repo https://agents.instana.io/helm --untar

    If you're performing an upgrade instead of an initial installation, manually apply the CRDs (Custom Resource Definitions) from the crds folder that is located within the extracted Helm chart directory:

    oc apply -f instana-agent/crds/
  3. Create a new file custom-values.yaml to overwrite the default image references with those specific to your air-gapped environment:

    Note:
    Note: When you deploy the Helm chart to the OCP cluster, you can use the internal registry URLs. image-registry.openshift-image-registry.svc:5000/instana/instana-agent-operator:${LATEST_OPERATOR_VERSION} image-registry.openshift-image-registry.svc:5000/instana/instana-agent-static:${LATEST_AGENT_VERSION} image-registry.openshift-image-registry.svc:5000/instana/k8sensor:${LATEST_K8S_SENSOR_VERSION}

    See the following sample custom-values.yaml file:

    cluster:
      name: demo-cluster
    
    zone:
      name: airgapped-demo
    
    agent:
      endpointHost: ingress-red-saas.instana.io
      endpointPort: 443
      key: xxx
      image:
        name: image-registry.openshift-image-registry.svc:5000/instana/instana-agent-static
        tag: 1.290.20
    
      configuration_yaml: |
        # Manual a-priori configuration. Configuration will be only used when the sensor
        # is actually installed by the agent.
        # Host
        #com.instana.plugin.host:
        #  tags:
        #    - 'dev'
        #    - 'app1'
    
    k8s_sensor:
      image:
        name: image-registry.openshift-image-registry.svc:5000/instana/k8sensor
        tag: b4eac7d
    
    controllerManager:
      image:
        name: image-registry.openshift-image-registry.svc:5000/instana/instana-agent-operator
        tag: v2.1.20
  4. Grant the necessary permissions to the 'instana-agent' user or group to run the agent DaemonSet and remote agent Deployment:

    oc adm policy add-scc-to-user privileged -z instana-agent -n ${INSTANA_AGENT_NAMESPACE}
    oc adm policy add-scc-to-user anyuid -z instana-agent-remote -n ${INSTANA_AGENT_NAMESPACE}
  5. Adjust the pull policy to enable all service accounts within the 'instana-agent' namespace to access images from the 'instana' namespace:

    oc policy add-role-to-group system:image-puller system:serviceaccounts:instana-agent -n instana
  6. Deploy the Helm chart that is located in the './instana-agent' directory into the newly created 'instana-agent' namespace by using the following commands:

    helm install instana-agent \
       --namespace ${INSTANA_AGENT_NAMESPACE} \
       -f custom-values.yaml \
       ./instana-agent

Validating the deployment

To validate the private images that are deployed to the cluster, complete the following steps:

  1. List all pods in the instana-agent namespace by running the following command:

    oc get pods -n instana-agent

    See the following sample response:

    NAME                                                READY   STATUS    RESTARTS   AGE
    instana-agent-6275r                                 1/1     Running   0          2m52s
    instana-agent-controller-manager-5c9bd89b7c-697mf   1/1     Running   0          3m
    instana-agent-k8sensor-5466f8cb4d-9j7p2             1/1     Running   0          2m52s
    instana-agent-k8sensor-5466f8cb4d-fdwsj             1/1     Running   0          2m52s
    instana-agent-k8sensor-5466f8cb4d-jstc4             1/1     Running   0          2m52s
    instana-agent-sjmtc                                 1/1     Running   0          2m52s
    instana-agent-z5plx                                 1/1     Running   0          2m52s

    Make sure that three k8sensor pods, and one instana-agent-controller-manager pod, and one instana-agent pod per each worker node are running.

  2. Validate the images by running the following command:

    oc get ds,deployment -o yaml | grep "image:"

    See the following sample response:

    image: image-registry.openshift-image-registry.svc:5000/instana/instana-agent-static:1.290.20
           image: image-registry.openshift-image-registry.svc:5000/instana/instana-agent-operator:v2.1.20
           image: image-registry.openshift-image-registry.svc:5000/instana/k8sensor:b4eac7d

Now the agent is installed. For what you can do after the installation, see the What to do next section.

For more information about the agent endpoints, see Host Agent Configuration.