Running the Radar Agent as a Container

This section provides information on how to run your Radar Agent on Docker or Kubernetes.

In this article:


Before You Begin

A Radar Agent running in a container supports all command line options detailed in Radar Agent Overview; however, we recommend that you use a valid Radar configuration file to centralize all the configuration options in a single location.

The configuration file is specifically required when running the Radar Agent on Kubernetes.

There are several ways to create a Radar configuration file:

Option 1: Create Config from Container Radar Agent Using Access Token

You can run the Radar Agent container by specifying the --token command line argument to provide the access token needed to connect to your API Monitoring account. For information on how to obtain an access token, see Radar Agent Overview.

To create a configuration file from the container Radar Agent:

  1. Run the container by providing an access token:

    Copy
    docker run \
    -it \
    us-east4-docker.pkg.dev/runscope-228819/blazemeter/radar:latest \
    --token={radar-agent-access-token}
  2. Complete the setup wizard. A configuration file will be generated.

  3. Copy the contents of the configuration file and paste into a local config file.

  4. Mount and reference the local file using the --configfile/-f command line option:

    Copy
    docker run \
    -it \
    us-east4-docker.pkg.dev/runscope-228819/blazemeter/radar:latest \
    -f /home/blazemeter/radar/radar.conf

Option 2: Create Config from Locally Installed Radar Agent Using Access Token

When you run the Radar Agent locally on your system, it will generate a configuration file for the desired agent and allow you to save it. Follow the instructions in Radar Agent Overview to download the agent for your operating system and generate your configuration file.

Option 3: Manually Create Configuration File

You can also manually create a configuration file using this template:

Copy
api-host=https://api.runscope.com
verbose=true
agent-id={valid-uuid}
team-id={team-id-for-radar-agent}
name={radar-agent-name-to-display}
token={radar-agent-access-token}

where:

  • team-id is the universally unique ID (UUID) of your Team in API Monitoring that the Radar Agent is associated with

  • agent-id is a universally unique ID (UUID) that identifies the Radar Agent within your Team in API Monitoring. Normally this is generated by the Radar agent, but any valid UUID can be used

  • name is the name to use when displaying the Radar Agent within your Team in API Monitoring.

  • token is the access token that gives the Radar Agent access to your Team in API Monitoring. You must create an Application within API Monitoring to generate this access token. See Radar Agent Overview for details.


Running Radar Agent on Docker

To run the Radar Agent on Docker, pull the latest Radar image, then configure the agent to run with a local config file and custom CA bundle. You can also supply a local certificate and key files to enable two-way SSL.

Pull Radar Image

To pull the latest Radar image, run:

docker pull us-east4-docker.pkg.dev/runscope-228819/blazemeter/radar:latest

Run Radar Agent with Local Config File

Make the local Radar Agent configuration file available to the agent running in the container by mounting it to /home/blazemeter/radar/radar.conf:

Copy
docker run \
--mount type=bind,source="{local-path-to-radar-config}",target="/home/blazemeter/radar/radar.conf" \
-it \
us-east4-docker.pkg.dev/runscope-228819/blazemeter/radar:latest \
-f /home/blazemeter/radar/radar.conf

Run Radar Agent with Custom Certificate Authority Bundle

Make a local custom certificate authority bundle file available to the agent running in the container by mounting it to /home/blazemeter/radar/certs/ca/ca.pem.

  1. Before running your container, make sure that the cafile option in your Radar agent configuration file is set to the correct location:

    cafile=/home/blazemeter/radar/certs/ca/ca.pem
  2. Run the container using the local Radar Agent configuration file and custom certificate authority bundle:

    Copy
    docker run \
    --mount type=bind,source="{local-path-to-radar-config}",target="/home/blazemeter/radar/radar.conf" \
    --mount type=bind,source="{local-path-to-ca-bundle}",target="/home/blazemeter/radar/certs/ca/ca.pem" \
    -it \
    us-east4-docker.pkg.dev/runscope-228819/blazemeter/radar:latest \
    -f /home/blazemeter/radar/radar.conf

Optional: Run Radar Agent with Client Certificate and Key Files

If you would like to use local certificate and key files for mutual authentication (mTLS/two-way SSL) on all Radar Agent requests, you can make them available by mounting them to the following locations in the container:

  • Client certificate: /home/blazemeter/radar/certs/client/tls.crt

  • Client key: /home/blazemeter/radar/certs/client/tls.key

  • Certificate authority bundle containing all server certificates to trust, including ones for mutual authentication: /home/blazemeter/radar/certs/ca/ca.pem

  1. Ensure that the following options are set in your Radar Agent configuration file:

    Copy
    cafile=/home/blazemeter/radar/certs/ca/ca.pem
    cert=/home/blazemeter/radar/certs/client/tls.crt
    key=/home/blazemeter/radar/certs/client/tls.key
    pass={client-key-password-if-required}
  2. Run the container with the CA bundle, client certificate and client key:

    Copy
    docker run \
    --mount type=bind,source="{local-path-to-radar-config}",target="/home/blazemeter/radar/radar.conf" \
    --mount type=bind,source="{local-path-to-ca-bundle}",target="/home/blazemeter/radar/certs/ca/ca.pem" \
    --mount type=bind,source="{local-path-to-client-cert}",target="/home/blazemeter/radar/certs/client/tls.crt" \
    --mount type=bind,source="{local-path-to-client-key}",target="/home/blazemeter/radar/certs/client/tls.key" \
    -it \
    us-east4-docker.pkg.dev/runscope-228819/blazemeter/radar:latest \
    -f /home/blazemeter/radar/radar.conf

Use HTTP/S Proxy

The Radar Agent image supports the following proxy environment variables:

  • HTTP_PROXY

  • HTTPS_PROXY

  • NO_PROXY

Here’s an example of running the container using the local Radar Agent configuration file and proxy environment variables:

Copy
docker run \
--mount type=bind,source="{local-path-to-radar-config}",target="/home/blazemeter/radar/radar.conf" \
--env HTTP_PROXY={http-proxy-url} \
--env HTTPS_PROXY={https-proxy-url} \
--env NO_PROXY={hostnames-to-skip-proxying} \
-it \
us-east4-docker.pkg.dev/runscope-228819/blazemeter/radar:latest \
-f /home/blazemeter/radar/radar.conf

For more information, see Radar Agent HTTP/HTTPS Proxy Setup.


Running Radar Agent on Kubernetes

You can deploy your Radar Agent on Kubernetes using the remote-radar Helm chart, available from the Development Radar Helm repository.

Prerequisite: Mount Radar Config File Using a ConfigMap

Currently, the Radar Agent running in a container expects for a valid configuration file to be located at /home/blazemeter/radar/radar.conf.

In order to provide this file to a container running in Kubernetes, you must create a ConfigMap containing an entry called radar.conf. It is also required that this ConfigMap is in the same namespace as the Radar Agent container that uses it.

Here is an example of creating a ConfigMap named radar-conf with an entry named radar.conf that is populated with a local configuration file:

kubectl create cm radar-conf --from-file=radar.conf={local-path-to-radar-config}

Optional: Mount Custom Certificate Authority Bundle Using a Secret

You can make a local custom certificate authority bundle file available to the Radar Agent running in the container by mounting it to /home/blazemeter/radar/certs/ca/ca.pem.

In order to provide this file to a container running in Kubernetes, you must create a ConfigMap containing an entry called ca.pem. It is also required that this ConfigMap is in the same namespace as the Radar agent container that uses it.

  1. Ensure that the cafile option in your configuration file is set to the correct location:

    cafile=/home/blazemeter/radar/certs/ca/ca.pem
  2. Once the configuration file is updated in the ConfigMap that will be used by the container, you can create the ConfigMap for the custom certificate authority bundle file. Here is an example of creating a ConfigMap named radar-ca-bundle with an entry named ca.pem that is populated with a local configuration file:

    kubectl create cm radar-ca-bundle --from-file=ca.pem={local-path-to-ca-bundle}

Install Helm

Follow the official documentation to install and set up Helm.

Configure Helm Repository for the remote-radar Chart

To configure the Helm repository:

  1. Use the following command to a new Helm repo called radar-repo that points to the Radar Helm repository:

    helm repo add radar-repo https://storage.googleapis.com/runscope-downloads/helm
  2. List Helm repositories:

    helm repo list

    You should see the development Radar Helm repository:

    Copy
    NAME              URL
    radar-dev-repo    https://storage.googleapis.com/runscope-downloads/helm
  3. Search Helm repositories for the remote-radar chart:

    helm search repo remote-radar

Install the remote-radar Helm Chart

To install the remote-radar chart:

  1. Update your Helm installation to get the latest information about charts from the radar-repo Development Radar Helm repository. This will also allow you to install the latest version of the chart:

    helm repo update radar-repo
  2. Perform a dry run of the Helm chart installation by adding the --dry-run flag. This is helpful to see what Kubernetes resources are created as part of the release:

    Copy
    helm upgrade \
    --install {release-name} radar-repo/remote-radar \
    --wait \
    --debug \
    --set config.radarConfigMap={radar-configmap-name} \
    --dry-run
  3. Once ready, remove the --dry-run flag and perform the install.

    Here is an example of installing the Radar Helm chart with a release name of my-remote-radar and using the radar-conf ConfigMap to provide the Radar configuration file:

    Copy
    helm upgrade \
    --install my-remote-radar radar-repo/remote-radar \
    --wait \
    --set config.radarConfigMap=radar-conf

Supported Values for Radar Helm Chart

Use the following command to show the values supported by the Helm chart:

helm show values radar-repo/remote-radar

Set Replica Count

By default, only a single replica is created when installing the Radar Helm chart.

To adjust this, set the replicaCount value when installing or upgrading the Helm chart:

--set replicaCount={desired-replica-count}

Set Resource Requests and Limits

The amount of memory and CPU requested and limited for each Pod created by the Radar Helm chart can be configured. By default, memory is requested and limited to 1GB (1024Mi) and CPU is requested and limited to 1.

To adjust this, you can use the Helm --set flag to set the following requests and limits value overrides for memory and CPU.

  • resources.limits.memory

  • resources.limits.cpu

  • resources.requests.memory

  • resources.requests.cpu

Refer to the official Kubernetes documentation for the meaning of these values and the notation supported.

Use HTTP/S Proxy

The Radar Agent image supports the following proxy environment variables:

  • HTTP_PROXY

  • HTTPS_PROXY

  • NO_PROXY

These proxy environment variables can be configured using the Helm --set flag for the following values:

Environment Variable

Helm Value

HTTP_PROXY

config.httpProxy

HTTPS_PROXY

config.httpsProxy

NO_PROXY

config.noProxy

For more information, see Radar Agent HTTP/HTTPS Proxy Setup.

Upgrade Radar Helm Chart

To upgrade your Helm chart: 

  1. Update your Helm installation to get the latest information about charts from the radar-repo Development Radar Helm repository. This will also allow you to install the latest version of the chart:

    helm repo update radar-repo
  2. Perform a dry run of the Helm release upgrade by adding the --dry-run flag. This is helpful to see what Kubernetes resources are created as part of the release:

    Copy
    helm upgrade \
    {release-name} radar-repo/remote-radar \
    --wait \
    --debug \
    --set config.radarConfigMap={radar-configmap-name} \
    --dry-run
  3. Once ready, remove the --dry-run flag and perform the upgrade.

    Here is an example of upgrading the Radar Helm chart with a release name of my-remote-radar and using the radar-conf ConfigMap to provide the Radar configuration file:

    Copy
    helm upgrade \
    my-remote-radar radar-repo/remote-radar \
    --wait \
    --set config.radarConfigMap=radar-conf

Uninstall Radar Helm Chart

To uninstall the Helm chart, run:

helm uninstall {release-name}