To deploy your MAR-based Mock Services on a containerized VSE, install a BlazeMeter Virtual Service Environment.
You can install a BlazeMeter Virtual Service Environment on a Kubernetes cluster in a BlazeMeter private location (OPL).
Note: This feature is not available by default. If you are interested in using BlazeMeter Virtual Service Environments, contact BlazeMeter Support.
System Requirements
Ensure that the server on which you are installing the BlazeMeter Virtual Service Environment adheres to all Kubernetes installation requirements on the Private Location System Requirements page.
Note: We do not support sharing of private locations across Workspaces for BlazeVSE. It is recommended that a new private location is created for each BlazeVSE within a workspace.
A BlazeMeter Virtual Service Environment server also requires an implementation of Ingress Contour version 1.6 or higher.
Create Private Location
The BlazeMeter Virtual Service Environment must be associated with a private location (OPL) and a BlazeMeter agent.
- Click the Cog icon at the top right of the BlazeMeter UI to open the Settings.
- Click Private Location under Workspaces.
If you don't see this option, you don't have the appropriate credentials. Either request to become an admin in your workspace, or work with an administrator to create the private location. - Click the Add button.
- Name the private location, choose Shared run type, and click Next.
- Select Mock Services and Service Virtualization Bridge under Functionalities, and click Create.
- Click Add Agent.
- Name the agent and click Create Agent.
A window appears that includes a Docker command for running the agent. - Copy the Docker run command to a text file.
Install BlazeMeter Virtual Service Environment on a Kubernetes Cluster
- Create a Kubernetes deployment YAML file using the following text as a template:
apiVersion: apps/v1 kind: Deployment metadata: labels: role: role-crane name: sample-crane-deployment 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: A_ENVIRONMENT value: https://a.blazemeter.com - name: AUTH_TOKEN value: <authtokenforOPLagent> - name: HARBOR_ID value: <privatelocationID> - name: SHIP_ID value: <OPLagentID> - name: CONTAINER_MANAGER_TYPE value: KUBERNETES - name: DOCKER_REGISTRY value: gcr.io/verdant-bulwark-278 - name: AUTO_KUBERNETES_UPDATE value: "true" - name: KUBERNETES_USE_PRE_PULLING value: "true" - name: KUBERNETES_WEB_EXPOSE_TYPE value: CONTOUR - name: KUBERNETES_SERVICE_USE_TYPE value: CLUSTERIP - name: KUBERNETES_WEB_EXPOSE_SUB_DOMAIN value: <dns-suffix> - name: KUBERNETES_WEB_EXPOSE_TLS_SECRET_NAME value: <tls-secretname> image: gcr.io/verdant-bulwark-278/blazemeter/crane:latest-master imagePullPolicy: Always name: crane-container restartPolicy: Always terminationGracePeriodSeconds: 30
- Refer to the Docker run command copied in the previous procedure, and copy the following values into the corresponding properties in the deployment file:
-
- HARBOR_ID
- SHIP_ID
- AUTH_TOKEN
-
- Update the following values in the deployment file as needed:
- name: Provide your own cluster name.
- KUBERNETES_WEB_EXPOSE_SUB_DOMAIN: Provide the sub domain to use in all Mock Service URLs, if needed.
- Save and close the file.
- Run the following command from the terminal on your installation system:
kubectl apply -f <deployment file name>
Kubernetes creates a cluster based on the deployment file with the necessary components running for a BlazeMeter Virtual Service Environment. - Return to the BlazeMeter Private Location page and verify that the agent appears as running.
- Click the Mock Services tab, and click Environments.
The BlazeMeter Virtual Service Environment should appear on this page.
If the agent is running but you do not see anything on the Environment page, verify that your workspace has access to the BlazeMeter Virtual Service Environment feature.
The BlazeMeter Virtual Service Environment is installed. You can deploy MAR-based Mock Services to it by choosing the private location name as the Location during deployment.
Accept Mock Services Network Traffic on Kubernetes
For a Kubernetes-based deployment of a BlazeMeter Virtual Service Environment, you must perform an additional step to ensure that your Mock Service network traffic is allowed.
Once deployed, each Mock Service is assigned a fully qualified domain name. Kubernetes must have a record of this name to accept the traffic to the Mock Services endpoint.
To accept Mock Services endpoint traffic on Kubernetes, add the Mock Service's fully qualified domain name to the DNS record for your location. For local testing, you could also use the local hosts file, but in most cases, you must add to the DNS record.
0 Comments