Download PDF
Download page Set up the Web Monitoring PSA and API Monitoring PSA in Azure AKS.
Set up the Web Monitoring PSA and API Monitoring PSA in Azure AKS
Set up the Web Monitoring PSA and API Monitoring PSA in Azure AKS as follows:
- Create the Kubernetes Cluster.
- Build and customise the Docker image..
- Tag and push images to the Registry.
- Deploy the Web Monitoring PSA and API Monitoring PSA.
- Monitor the Kubernetes cluster.
Most of the steps are common for both Web Monitoring PSA and API Monitoring PSA. Wherever applicable, the differences in steps are highlighted.
This document contains links to Azure CLI documentation. AppDynamics makes no representation as to the accuracy of Azure CLI documentation because Azure CLI controls its own documentation.
Create the Kubernetes Cluster
To create a Kubernetes cluster in Azure AKS:
Install and authenticate Azure CLI.
To create a resource group, enter
RESOURCE_GROUP=heimdall-onprem az group create --name $RESOURCE_GROUP --location eastus
CODETo create a container registry, enter:
ACR_NAME=heimdallonprem az acr create --resource-group $RESOURCE_GROUP --name $ACR_NAME --sku Basic
CODETo create a cluster, enter:
CLUSTER_NAME=heimdall-onprem az aks create \ --resource-group $RESOURCE_GROUP \ --name $CLUSTER_NAME \ --enable-managed-identity \ --kubernetes-version 1.x.x \ --node-count 4 \ --node-vm-size Standard_D8s_v3 \ --generate-ssh-keys \ --attach-acr $ACR_NAME
CODEReplace the
kubernetes-version
in the above code with one of the supported versions. See Supported Kubernetes versions.The
node-vm-size
andnode-count
in the above code are selected according to the recommended configuration type. You can specify a configuration of your choice with a different type and number of nodes. See node-vm-size.You must be the owner or administrator of the Azure subscription to run the
--attach-acr
command.
Access the Cluster
To access the Kubernetes cluster, follow these instructions to install kubectl, a utility to interact with the cluster.
To verify that the cluster is running, enter:
kubectl get nodes
Build and Customise the Docker Image
You can download the zip file for Simple Synth PSA installation from the Appdynamics Downloads Portal or from the beta upload tool.
This file contains Dockerfiles to install the agents and set up monitoring:
- Web Monitoring PSA: Dockerfiles for sum-chrome-agent, sum-heimdall, and Helm charts
- API Monitoring PSA: Dockerfiles for synth-api-monitoring-agent, sum-heimdall, and Helm charts
To build an image for sum-chrome-agent, synth-api-monitoring-agent, and sum-heimdall, ensure that Docker is installed. If it is not installed, you can download and install Docker from here.
For sum-chrome-agent:
- Unzip the zip file to access the sum-chrome-agent directory.
Navigate to the directory and run the following command:
docker build -f Dockerfile-PSA -t sum-chrome-agent:<agent-tag> .
CODE
For synth-api-monitoring-agent:
- Unzip the zip file to access the synth-api-monitoring-agent directory.
Navigate to the directory and run the following command:
docker build -f Dockerfile-PSA -t synth-api-monitoring-agent:<agent-tag> .
CODE
For sum-heimdall:
- Unzip the zip file to access the sum-heimdall directory.
Navigate to this 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.
Add Custom Python Libraries
This section is applicable only for Web Monitoring PSA.
In addition to the standard set of libraries, you can add the custom Python libraries to the agent for the scripted measurements. To add the custom Python libraries, build an image using the downloaded base image.
Create a Dockerfile and create
RUN
directives to run python pip. For example, to install the libraryalgorithms
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 ...
CODEYou can create any number of
RUN
directives to install the required libraries.To build the new image, enter:
docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile
CODEThe newly built agent image contains the required libraries.
Tag and Push Images to the Registry
You must tag and push the images to a registry for cluster to access it. You have to use the ACR_NAME
environment variable while creating the cluster.
To tag the images, enter:
Web Monitoring PSA:
ACR_LOGIN_SERVER=$ACR_NAME.azurecr.io
docker tag sum-heimdall:<heimdall-tag> $ACR_LOGIN_SERVER/sum-heimdall:<heimdall-tag>
docker tag sum-chrome-agent:<agent-tag> $ACR_LOGIN_SERVER/sum-chrome-agent:<agent-tag>
API Monitoring PSA:
ACR_LOGIN_SERVER=$ACR_NAME.azurecr.io
docker tag sum-heimdall:<heimdall-tag> $ACR_LOGIN_SERVER/sum-heimdall:<heimdall-tag>
docker tag synth-api-monitoring-agent:<agent-tag> $ACR_LOGIN_SERVER/synth-api-monitoring-agent:<agent-tag>
To push the images, enter:
Web Monitoring PSA:
az acr login --name $ACR_NAME
docker push $ACR_LOGIN_SERVER/sum-heimdall:<heimdall-tag>
docker push $ACR_LOGIN_SERVER/sum-chrome-agent:<agent-tag>
API Monitoring PSA:
az acr login --name $ACR_NAME
docker push $ACR_LOGIN_SERVER/sum-heimdall:<heimdall-tag>
docker push $ACR_LOGIN_SERVER/synth-api-monitoring-agent:<agent-tag>
Deploy the Web Monitoring PSA and API Monitoring PSA
Ensure that you follow the applicable sequence of steps when installing Web Monitoring PSA and API Monitoring PSA, respectively; some steps are common for both the procedures.
The application is deployed to the cluster after the images are in the Registry. You use Helm chart to deploy and create all Kubernetes resources in the required order.
Install Helm following the instructions here.
Create a new measurement namespace where Heimdall, postgres database, and measurement pods will run.
To create measurement namespace:
kubectl create namespace measurement
CODEUsing 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 downloadedsum-psa-heimdall.tgz
file and enter:helm show values sum-psa-heimdall.tgz > values.yaml
CODEThese are the configuration key value pairs that you need to edit in the
values.yaml
file:Web Monitoring PSA:
Configuration Key
Value
heimdall > repository
$ACR_LOGIN_SERVER/sum-heimdall
heimdall > tag
<heimdall-tag>
chromeAgent > repository
$ACR_LOGIN_SERVER/sum-chrome-agent
chromeAgent > tag
<agent-tag>
shepherd > url
Shepherd URL
shepherd > credentials
credentials
shepherd > location
agent location
API Monitoring PSA:
Configuration Key
Value
heimdall > repository
$ACR_LOGIN_SERVER/sum-heimdall
heimdall > tag
<heimdall-tag>
apiMonitoringAgent > repository
$ACR_LOGIN_SERVER/synth-api-monitoring-agent
apiMonitoringAgent > tag
<agent-tag>
shepherd > url
Shepherd URL
shepherd > credentials
credentials
shepherd > location
agent location
You can leave the rest of the values set to their defaults or configure them based on your requirements. See Configure Web Monitoring PSA and API Monitoring PSA for details on shepherd URL, credentials, location, and optional key-value pairs.
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
CODEAll 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.
To verify if the pods are running, enter:
kubectl get pods --namespace measurement
CODETo make any changes to the
values.yaml
after the initial deployment, navigate to the previously downloadedsum-psa-heimdall.tgz
file and enter:helm upgrade heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
CODETo remove the deployment:
helm uninstall heimdall-onprem --namespace measurement
CODEThis is not recommended unless it required.
Monitor the Kubernetes Cluster
The Helm chart sum-psa-monitoring.tgz
in the zip you downloaded installs the monitoring stack. This Helm chart installs kube-prometheus-stack along with a custom Grafana dashboard to monitor the Private Simple Synthetic Agent.
Monitoring the deployment is optional; however, we highly recommended that you monitor the cluster to periodically check its health.
Install the Monitoring Stack
To create a separate
monitoring
namespace, enter:kubectl create namespace monitoring
CODETo review configuration options, enter:
helm show values sum-psa-monitoring.tgz > values.yaml
CODEThis generates a
values.yaml
file which contains all the configuration options. To modify and pass the generatedvalues.yaml
file while installing the Helm chart, enter:helm install psa-monitoring sum-psa-monitoring.tgz --values values.yaml --namespace monitoring
CODEAfter the monitoring stack is installed, you can Launch Grafana (which runs inside the cluster) to view the dashboard. To access Grafana from outside of the cluster, you can configure port forwarding or set up Ingress. To configure port forward to access it locally, enter:
kubectl port-forward svc/psa-monitoring-grafana 3000:80 --namespace monitoring
CODELaunch localhost:3000 from the browser and log in using the default credentials with username as
admin
and password asprom-operator
. A dashboard named Private Simple Synthetic Agent displays and provides details about the Kubernetes cluster, Heimdall, Postgres, and running measurements.