• Minikube is installed in a single machine. Hence, it is not scalable or highly available when you set up PSA in Minikube.
  • Functionality-wise, there is no difference between PSA in Minikube and PSA in AKS, EKS, GKE, or any other Kubernetes cluster.

Set up the Web Monitoring PSA in a Windows environment using Minikube as follows:

  1. Create an Azure Windows Virtual Machine
  2. Set up Minikube in the Azure Windows Virtual Machine
  3. Deploy Heimdall in the Minikube Cluster

Create an Azure Windows Virtual Machine

Perform the following steps:

  1. Log in to the Azure Portal.
  2. Navigate to Virtual Machines
  3. Click Create > Virtual Machine, and then under Instance details, specify the following details:

    FieldDescription
    Virtual machine nameSpecify a name for the virtual machine.
    ImageWindows Server 2019 Datacenter - Gen2
    SizeStandard_D8s_v3 - 8 vcpus, 32 GiB memory (US$ 483.26/month)

    In the above scenario, a basic machine with 8 vCPUs and 32Gb memory is selected. For a higher load, you may have to select a bigger machine.

  4. Under Administrator account, specify a username and password.
  5. Click Review + create.

    The virtual machine deployment may take a few minutes to complete. When the deployment is complete, you can view the new virtual machine Under Virtual Machines.

  6. Open the virtual machine, and click Connect > RDP.
  7. On the next page, click Download RDP File to download the file.
  8. Open the RDP file that you downloaded in the previous step.
    You will be prompted to specify a username and password. Use the username and password you created in step 4.

    Any Remote Desktop application must be installed on your machine to open the file.

Set up Minikube in the Azure Windows Virtual Machine

Perform the following steps:

  1. Log in to the Virtual Machine that you created.
  2. Install the Chocolatey package manager.
  3. Restart the Virtual Machine and open a new Powershell as an administrator.
  4. Install Minikube:

    choco install minikube
    CODE
  5. Install the Docker Desktop application:

    choco install docker-desktop
    CODE
  6. Restart the Virtual Machine.
  7. Launch the Docker Desktop application, then go to Settings > Resources.

    By default, only limited CPUs and Memory are allotted to Docker. Increase the resources allocation becasue the agent setup will run inside docker.

    Example resource allocation:

    ResourcesValue
    CPUs8
    Memory25 GB
    Swap1 GB
    Disk image size64 GB
  8. Start the Minikube cluster:

    minikube start --driver=docker
    CODE

    This command also sets up kubectl.

Deploy Heimdall in the Minikube Cluster

  1. Create the Kubernetes Cluster.
  2. Build and customize the Docker image.
  3. Save Images to Minikube's Docker Daemon.
  4. Deploy the Private Synthetic Agent.

Create the Kubernetes Cluster

When you install Minikube on your machine, it comes with its Docker environment. If you build the Docker images on your machine and use those images for the Kubernetes deployment, it pulls the images from the Docker registry or hub and produces an error while starting the pod. This occurs because your machine's docker daemon and the Minikube docker daemon are different. Therefore, you must ensure that you use the Minikube docker daemon to build the docker images.

To use Minikube docker daemon, run this command:

minikube -p minikube docker-env | Invoke-Expression
CODE

Download the zip file for Simple Synth PSA installation from the Appdynamics Downloads Portal or from the beta upload tool, and then copy the file to your virtual machine.

To start the Kubernetes cluster:

minikube start --kubernetes-version=v1.x.x
CODE

Build and Customize Image

Extract the SimpleSynthPrivateAgent.zip file in the virtual machine and perform these steps:

For sum-chrome-agent:

  1. Unzip the zip file to access the sum-chrome-agent directory.
  2. Navigate to the directory and run the following command: 

    docker build -f Dockerfile-PSA -t sum-chrome-agent:<agent-tag> .
    CODE

For sum-heimdall:

  1. Unzip the zip file to access the sum-heimdall directory. 
  2. Navigate to the directory and run the following command:

    docker build -f Dockerfile-PSA -t sum-heimdall:<heimdall-tag> .
    CODE

You can use any value for <heimdall-tag> and <agent-tag>, but ensure that you use the same value in the subsequent steps.

Verify that the images are built:

docker images
CODE

Add Custom Python Libraries 

This is an optional step. In addition to the available standard set of libraries, you can add custom Python libraries to the agent to use in scripted measurements. You build a new image based on the image you loaded as the base image.

  1. Create a Dockerfile and create RUN directives to run python pip. For example, to install the library algorithms you can create a Dockerfile: 

    # Use the sum-chrome-agent image we just loaded as the base image
    FROM sum-chrome-agent:<agent-tag>
       
    # Install algorithm for python3 on top of that
    RUN python3 -m pip install algorithms==0.1.4
       
       
    # We can add more RUN directives for installing more libraries
    # RUN python3 -m pip install ...
    CODE

    You can create any number of RUN directives to install the required libraries.

  2. To build the new image, enter: 

    docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile
    CODE

    The newly built agent image contains the required libraries. 

Save Images to Minikube's Docker Daemon 

You must tag and push the images to a registry for the cluster to access them. Execute the following command to save the images to Minikube docker:

docker save sum-heimdall:<heimdall-tag> | (eval $(minikube docker-env) && docker load)
docker save sum-chrome-agent:<agent-tag> | (eval $(minikube docker-env) && docker load)
CODE

Deploy the Web Monitoring PSA

The application is deployed to the cluster after the images are in the Registry. You use the Helm chart to deploy and create all Kubernetes resources in the required order. 

  1. Install Helm using the Chocolatey package manager:

    choco install kubernetes-helm
    CODE
  2. Create a new measurement namespace where Heimdall, Postgres database, and measurement pods will run.

  3. To create a new measurement namespace, enter

    kubectl create namespace measurement
    CODE

    Using a single command, you can deploy the Helm chart which contains the deployment details. To deploy the agent, you use the Helm chart sum-psa-heimdall.tgz in the zip file that you downloaded previously. Before you deploy the Private Synthetic Agent, you must set some configuration options. To view the configuration options, navigate to the previously downloaded sum-psa-heimdall.tgz file and enter: 

    helm show values sum-psa-heimdall.tgz > values.yaml
    CODE

    These are the configuration key value pairs that you need to edit in the values.yaml file:

    Configuration Key

    Value

    heimdall > repositorysum-heimdall
    heimdall > tag<heimdall-tag>
    heimdall > pullPolicyNever
    agent > repositorysum-chrome-agent
    agent > tag<agent-tag>
    shepherd > urlShepherd URL
    shepherd > credentialscredentials
    shepherd > locationagent location

    You can leave the rest of the values set to their defaults or configure them based on your requirements. 

  4. To deploy the Helm chart using the above-mentioned configuration, navigate to the previously downloaded sum-psa-heimdall.tgz file and enter

    helm install heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
    CODE

    All the Kubernetes resources are created in the cluster and you can use Heimdall. After a few seconds, Heimdall initializes and is visible in the Controller.

  5. To verify if the pods are running, enter: 

    kubectl get pods --namespace measurement
    CODE

    To make any changes to the values.yaml after the initial deployment, navigate to the previously downloaded sum-psa-heimdall.tgz file and enter: 

    helm upgrade heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
    CODE

    To remove the deployment:

    helm uninstall heimdall-onprem --namespace measurement
    CODE

    This is not recommended unless it is required.