Optional Installation Step: Manual Kubernetes Agent Installation

BlazeMeter provides auto-generated command and configuration for easy installation of Docker and Kubernetes agents. However, you can also perform manual Kubernetes agent installation, which is recommended in special use cases, for example, when configuring a Kubernetes installation to use CA certificates.

Manual Installation Steps

Below are the manual steps required to finish the agent installation on Kubernetes.

Follow these steps:

  1. Follow the steps for creating an agent, but stop where you get the command.
  2. Create a new YAML file (i.e. role-crane.yaml) and add the following to it:
    kind: Role
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
    name: role-crane
    rules:
    - apiGroups: [""] resources: ["pods/exec"] verbs: ["create"] - apiGroups: [""] resources: ["pods", "pods/log"] verbs: ["get", "list"] - apiGroups: ["extensions", "apps", ""] # leave empty string for core resources: ["pods", "services", "endpoints", "daemonsets", "pods/*", "pods/exec", "deployments", "replicasets", "ingresses", "deployments/scale"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection", "createcollection"]
  3. Create a new YAML file (i.e. role-binding-crane.yaml) and add the following to it:
    apiVersion: rbac.authorization.k8s.io/v1
    kind: RoleBinding
    metadata:
    name: role-binding-crane
    subjects:
    - kind: ServiceAccount
    name: default
    namespace: ${namespace}
    roleRef:
    kind: Role
    name: role-crane
    apiGroup: rbac.authorization.k8s.io
    The namespace value is provided by the user based on the namespace where this rolebinding will be applied.
  4. You will need to build the following clusterrole and clusterrolebinding, as well:

    Cluster Role File (i.e. cluster-role.yaml)
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
    name: cluster-role-crane
    rules:
    - apiGroups:
    - ""
    resources:
    - nodes
    verbs:
    - get
    - list
    - watch
    - update
    - patch

    Cluster Role Binding File (i.e. cluster-role-binding.yaml)
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
    name: cluster-role-binding-crane
    roleRef:
    apiGroup: rbac.authorization.k8s.io
    kind: ClusterRole
    name: cluster-role-crane
    subjects:
    - kind: ServiceAccount
    name: default
    namespace: ${namespace}
  5. Create a new YAML file (i.e. dpl-crane.yaml) and add the following to it:
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    role: role-crane
    name: crane
    spec:
    replicas: 1
    selector:
    matchLabels:
    role: role-crane
    strategy:
    type: Recreate
    template:
    metadata:
    labels:
    role: role-crane
    spec:
    serviceAccountName: default
    automountServiceAccountToken: true
    containers:
    - env:
    - name: AUTH_TOKEN
    value: ${auth_token}
    - name: HARBOR_ID
    value: ${location_id}
    - name: SHIP_ID
    value: ${agent_id}
    - name: CONTAINER_MANAGER_TYPE
    value: KUBERNETES
    - name: IMAGE_OVERRIDES
    value: '{}'
    - name: DOCKER_REGISTRY
    value: gcr.io/verdant-bulwark-278
    - name: AUTO_KUBERNETES_UPDATE
    value: 'true'
    image: gcr.io/verdant-bulwark-278/blazemeter/crane:latest-master
    imagePullPolicy: Always
    name: crane-container
    restartPolicy: Always
    terminationGracePeriodSeconds: 30

    See this table for the details on the environment variables from this file.

    If you want to incorporate a proxy connection for your Private location, see Optional Installation Step - Configuring Private Location Agents To Use a Corporate Proxy.
    The values auth_token, location_id, and agent_id can be found in the docker run command generated as variables AUTH_TOKEN, HARBOR_ID, and SHIP_ID, respectively.
  6. Use the following commands to apply the configurations to your Kubernetes instance:
    kubectl apply -f ${roleFilename} (i.e.role-crane.yaml)
    kubectl apply -f ${rolebindingFilename} (i.e.role-binding-crane.yaml)
    kubectl apply -f ${deploymentFilename} (i.e. dpl-crane.yaml)
  7. Use the following command to check on the status of the pod launch for the crane deployment:
    kubectl get pods
  8. Once you see the pod is showing as 'Running' in Kubernetes, return to agent installation steps.

Environment Variables

Environment Variable Required? Description
AUTH_TOKEN Required The auth token for the agent
SHIP_ID Required The agent ID. See also shipId.
HARBOR_ID Required The Private Location ID. See also harborId.
DOCKER_REGISTRY Required The internal/public docker registry that contains the BlazeMeter images. For public images, use: gcr.io/verdant-bulwark-278
IMAGE_OVERRIDES Optional

Set this environment variable to override the images' version configured by BlazeMeter's backend (images can be hosted on different docker registries). This is required if you are using your own registry (not the BlazeMeter one).

The required format for BlazeMeter's images is component_name:latest.
The following component names are currently in use and will depend on the functionality you choose (see here for more details).

The value should be a JSON formatted dictionary; Keys are the original BlazeMeter's components and Values are the new full docker registry paths. Example: '{"taurus-cloud:latest": "<my_docker_registry>/taurus-cloud:<taurus-cloud version>"}'

AUTO_KUBERNETES_UPDATE Required

Controls the auto-update functionality for the BlazeMeter images.

Set to true to enable, false to disable.

Set this option to false if you are using a custom internal registry.