Installing a BlazeMeter Agent using a Helm Chart

You want to install a BlazeMeter Agent for Kubernetes on your server/instance behind your firewall. This article shows you how to deploy a BlazeMeter Private Location engine to your Kubernetes cluster using Helm, the package manager for Kubernetes. This procedure uses a Helm chart which enables you to make advanced configurations if required.

Prerequisites

  • A BlazeMeter account

  • A Kubernetes cluster

  • Latest Helm installed

  • Before proceeding with installation, ensure that your Kubernetes cluster meets the minimum requirements. For more information, see Private Location System Requirements.

Content

  1. Obtain Location ID, Agent ID, and Auth Token from BlazeMeter

  2. Download the chart

  3. Configure the chart values

  4. Verify the chart

  5. Install the chart

  6. Verify the installation

Obtain Location ID, Agent ID, and Auth Token from BlazeMeter

For this installation, identify your Private Location ID (formerly Harbour_ID), BlazeMeter Agent ID (formerly Ship_ID), and your BlazeMeter API Auth_token, and store them in a text file in a safe location.

harbor ship

Choose one of the following alternatives how to obtain these values:

Get the Location ID, Agent ID and Auth Token through BlazeMeter web UI

For more information, see Where can I find the Harbor ID and Ship ID?

  1. Log in to BlazeMeter with Workspace Admin permissions.

  2. Create a Private Location.

  3. After the Private Location has been created in BlazeMeter, copy the Private Location ID.

  4. Start following the procedure how to Create an Agent.

    1. Give the agent a name.

    2. (Optional) Enter the IP address of the agent.

    3. Click Create.

    4. Do not run any generated command.
      Instead, copy the following values from the Helm chart tab into a text file:

      • HARBOR_ID — your Private Location ID

      • SHIP_ID — your Agent ID

      • AUTH_TOKEN — your API authentication token

Get the Location ID, Agent ID and Auth Token through BlazeMeter API

Use your BlazeMeter API key and secret ready to log in.

  1. Create a Private Location using an API call.

  2. Copy the Private Location ID (Harbour ID) from the response.

  3. Create an Agent using an API call.

  4. Copy the Agent ID (Ship_ID) from the response.

  5. Generate the docker command using an API call.

  6. Copy the Auth_token from the response.

Do not run the generated command.

Download the chart

  1. Download the latest Helm chart TAR file from the GitHub repository.

  2. Unpack the chart with the given version using the following command:

    tar -xvf helm-crane-version.tgz

Configure the chart values

The values.yaml file contains the default values for your chart.

  1. Open the values.yaml file in a text editor of your choice.

  2. Add your Location ID, Agent ID, and Auth Token, in quotation marks, to the env: section, using the following format:

    env:
        authtoken: "your BlazeMeter API Auth token"
        harbour_id: "your Private Location ID"
        ship_id: "your Agent ID"
  3. Modify other settings according to your requirements.

Additional basic configurations

  • Do not switch the serviceAccount.create option to yes. A serviceAccount other than the default will currently prevent BlazeMeter crane deployments.

  • You can change the auto_update: option to false if you do not want the cluster to be auto-updated. This is not recommended. The default is true.

    auto_update: "true"
  • To name the namespace for this deployment, set the namespace attribute to your custom name, and the Helm chart will be installed under that namespace:

    deployment:
        name: crane
        namespace: "your_name_space"

(Optional) Configure the proxy

If your environment requires a proxy, configure it now:

  1. Set enable in the proxy: section to yes. By default, this is set to no.
  2. Set http_proxy or https_proxy to yes, or both.
  3. Make sure to set these values to yes before you add the proxy path.
    The section should look similar to this example:
    proxy:
        enable: yes
        http_proxy: yes
        http_path: "http://your_server:your_port" 
        https_proxy: yes
        no_proxy: "kubernetes.default,127.0.0.1,localhost,myHostname.com"

(Optional) Configure certificates

To configure your Kubernetes installation to use CA certificates, make changes to the ca_bundle: section of the values.yaml file.

  1. Change the enable option to yes. By default, this is set to no.

  2. Provide the path to your certificate file for both, ca_subpath and aws_subpath, respectively. The easiest way is to copy or move these cert files into the same directory as the Helm chart and define the name of the certs instead of a complete path.

ca_bundle:
    enable: yes
        ca_subpath: "certificate.crt"
        aws_subpath: "certificate.crt"
    volume:
        volume_name: "volume-cm"
        mount_path: "/var/cm"

(Optional) Deploy non_privilege container - non-root deployment

If you plan to deploy the BlazeMeter crane as a non-privileged installation, make changes to the non_privilege_container: part of the values file. By default, this is set to no. Change the enable to yes to automatically run the deployment and consecutive pods as non-root/non-privilege.

non_privilege_container:
    enable: no
    runAsGroup: 1337
    runAsUser: 1337

(Optional) Install Istio-based crane for Service Virtualization deployment within the k8s cluster.

If you have installed and configured istio because this Private Location is intended to run virtual services using istio-ingress, make changes to the istio_ingress: section of the values file. For more information, see Installing a BlazeMeter Agent for Kubernetes (Service Virtualization). By default, this is set to no.

istio_ingress:
    enable: no
    credentialName: "wildcard-credential"
    web_expose_subdomain: "mydomain.local"
    pre_pulling: "true"
    istio_gateway_name: "bzm-gateway"

Change the enable option to yes to automatically set up istio-ingress for this installation. This option lets outside traffic access the mock-service pod.

(Optional) Install Nginx Ingress-based crane for Service Virtualization deployment

If you have installed and configured nginx because this Private Location is intended to run virtual services using nginx-ingress, make changes to the nginx_ingress: section of the values file. The default is no. For more information, see Installing a BlazeMeter Agent for Kubernetes (Service Virtualization).

nginx_ingress:
    enable: no
    credentialName: "wildcard-credential"
    web_expose_subdomain: "mydomain.local"

Change the enable option to yes to automatically set up nginx-ingress for this installation. This option lets outside traffic access the mock-service pod.

(Optional) Inherit the AUTH_TOKEN for crane from your k8s secret

If users or admins require the AUTH_TOKEN for any crane installation to be secret and secure, inherit the ENV values for the AUTH_TOKEN from the k8s secret. In this case, make changes to the env: section of the values file.

env:
    authToken:
        # if you want to pass the AUTH_TOKEN through secret in the crane ENV variables set secret to yes and add secret name and key
        secret:
            enable: yes
            secretName: "your-secretName"
            secretKey: "auth-token"
        # if secret is not enabled, please enter the AUTH_TOKEN below directly.
        token:  "MY_SAMPLE_TOKEN-shfowh243owijoidh243o2nosIOIJONo2414"

Change the enable option to yes to automatically inherit the AUTH_TOKEN values from the secret user provided in the following values. Make sure the cluster and namespace has the secret applied in the following format:

apiVersion: v1
    kind: Secret
    metadata:
        name: your-secretName
        namespace: blazemeter
    type: Opaque
    data:
        auth-token: ZjI...Mzg2Yw==

(Optional) Configure deployment to support child pods to inherit labels from the crane

If users or admins require certain set of labels as part of the deployment of a cluster resource, configure the labels values. These labels are inherited from the crane when the child pods are deployed. Note that labels added to crane deployment are not automatically inherited by the child pods. Switch the enable option to yes and add labels in JSON format.
Example:

labels:
    enable: yes
    labelsJson: {"label_1": "label_1_value", "label_2": "label2value"}

(Optional) Configure deployment to support child pods to inherit resource limits from the crane

If users or admins require a CPU or memory limit to be applied to all cluster resources, configure the resourceLimit values. These resource limits will be inherited from the crane ENV when the child pods are deployed. Note that resource limits added to crane deployment will not be automatically inherited by the child pods. Switch the enable option to yes and add resource limits in string format.

Example:

resourceLimit:
    enable: yes
    CPU: "800m"
    MEM: "4Gi"

Verify the chart

After you have configured the values, run the following command to verify if the values are correctly used in the Helm chart:

helm template chart_path/chart_name

The command prints the template that Helm will use to install this chart.

Check the values and if something is missing, edit the values.yaml file again according to your requirements.

Install the chart

To install the BlazeMeter Agent through the Helm chart, use the following command.

  1. Replace crane by the name you are setting for the chart on your system.

  2. Replace blazemeter-crane by the actual name of the chart.

  3. Make sure the namespace declared here is the same as the one you declared in the values file.

  4. Run the final command:

helm install crane helm-crane --create-namespace --namespace=your_namespace

Verify the installation

To verify the installation of the BlazeMeter Agent through the Helm chart, run:

helm list -A