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:
- Follow the steps for creating an agent, but stop where you get the command.
- 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"] - 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.ioNote: The
namespace
value is provided by the user based on the namespace where thisrolebinding
will be applied. - You will need to build the following
clusterrole
andclusterrolebinding
, 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} - 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: ${harbor_id}
- name: SHIP_ID
value: ${ship_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: 30See this table for the details on the environment variables from this file.
Note: If you want to incorporate a proxy connection for your OPL, please visit this article.
Note: The values
auth_token
,harbor_id
, andship_id
can be found in the docker run command generated as variablesAUTH_TOKEN
,HARBOR_ID
, andSHIP_ID
, respectively. - 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
) - Use the following command to check on the status of the pod launch for the crane deployment:
kubectl get pods
- 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 shipId of the agent |
HARBOR_ID | Required | The harborId of the agent |
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). Note: The required format for BlazeMeter's images is 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: |
AUTO_KUBERNETES_UPDATE | Required | Controls the auto-update functionality for the BlazeMeter images. Set to Note: This option should be configured as |
0 Comments