Set up PSA in Bare Metal K8s Using Amazon EC2
Set up the Web Monitoring PSA and API Monitoring PSA in Bare Metal K8s using Amazon EC2 as follows. If you want to set up PSA in an existing Kubernetes cluster, skip the Create the Kubernetes Cluster section.
- Create the Kubernetes Cluster.
- Pull the Docker image.
- Save Images to Minikube's Docker Daemon.
- Deploy the Web Monitoring PSA and API Monitoring PSA.
- Monitor the Kubernetes cluster.
Create the Kubernetes Cluster
To create a Kubernetes cluster in Bare Metal K8s:
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(Optional) Configure Proxy Server
When you configure a proxy server, it applies to all the domains. Configure a proxy server by specifying the proxy server address on the values.yaml file. See Key-Value Pairs Configuration.
To bypass any domains from the proxy server, perform the following steps:
Configure Proxy Server at a Job Level
Pull the Docker Image
Pull the pre-built docker images for sum-chrome-agent, sum-api-monitoring-agent, and sum-heimdall from DockerHub. The pre-built images include the dependent libraries, so you can use these images even when you do not have access to the Internet.
Run the following commands to pull the agent images:
docker pull appdynamics/heimdall-psa
docker pull appdynamics/chrome-agent-psa
docker pull appdynamics/api-monitoring-agent-psa(Optional) Add Custom Python Libraries
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
Create a Dockerfile and create
RUNdirectives to run python pip. For example, to install the libraryalgorithmsyou can create a Dockerfile:# Use the sum-chrome-agent image you just loaded as the base image FROM appdynamics/chrome-agent-psa:<agent-tag> USER root RUN apk add py3-pip USER appdynamics # Install algorithm for python3 on top of that RUN python3 -m pip install algorithms==0.1.4 --break-system-packagesNote: You 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> - < DockerfileThe 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 the cluster to access it. It can be done in the following ways:
Bare Metal K8S using EC2
Vanilla K8S runs on AWS infrastructure. As kops create and assign appropriate roles to the cluster nodes, they can directly access Elastic Container Registry (ECR), without any other configuration.
To tag images, enter:
Web Monitoring PSA:
docker tag sum-heimdall:<heimdall-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-heimdall:<heimdall-tag>
docker tag sum-chrome-agent:<agent-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-chrome-agent:<agent-tag>
API Monitoring PSA:
docker tag sum-heimdall:<heimdall-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-heimdall:<heimdall-tag>
docker tag sum-api-monitoring-agent:<agent-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-api-monitoring-agent:<agent-tag>
Replace <aws_account_id> and <region> with your account and region values.
To create repositories, enter:
Web Monitoring PSA:
aws ecr create-repository --repository-name sum/sum-heimdall
aws ecr create-repository --repository-name sum/sum-chrome-agent
API Monitoring PSA:
aws ecr create-repository --repository-name sum/sum-heimdall
aws ecr create-repository --repository-name sum/sum-api-monitoring-agent
To push the images, enter:
Web Monitoring PSA:
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<region>.amazonaws.com
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-heimdall:<heimdall-tag>
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-chrome-agent:<agent-tag>
API Monitoring PSA:
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<region>.amazonaws.com
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-heimdall:<heimdall-tag>
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-api-monitoring-agent:<agent-tag>
Bare Metal K8S using Private Registry
To tag images, enter:
Web Monitoring PSA:
docker tag sum-heimdall:<heimdall-tag> <REGISTRY_HOST>:<REGISTRY_PORT>/sum-heimdall:<heimdall-tag>
docker tag sum-chrome-agent:<agent-tag> <REGISTRY_HOST>:<REGISTRY_PORT>/sum-chrome-agent:<agent-tag>
API Monitoring PSA:
docker tag sum-heimdall:<heimdall-tag> <REGISTRY_HOST>:<REGISTRY_PORT>/sum-heimdall:<heimdall-tag>
docker tag sum-api-monitoring-agent:<agent-tag> <REGISTRY_HOST>:<REGISTRY_PORT>/sum-api-monitoring-agent:<agent-tag>
Replace <REGISTRY_HOST> and <REGISTRY_PORT> to what you configured while deploying the registry.
To push the images, enter:
Web Monitoring PSA:
docker login <REGISTRY_HOST>:<REGISTRY_PORT>
docker push <REGISTRY_HOST>:<REGISTRY_PORT>/sum-heimdall:<heimdall-tag>
docker push <REGISTRY_HOST>:<REGISTRY_PORT>/sum-chrome-agent:<agent-tag>
API Monitoring PSA:
docker login <REGISTRY_HOST>:<REGISTRY_PORT>
docker push <REGISTRY_HOST>:<REGISTRY_PORT>/sum-heimdall:<heimdall-tag>
docker push <REGISTRY_HOST>:<REGISTRY_PORT>/sum-api-monitoring-agent:<agent-tag>
Deploy the Web Monitoring PSA and API 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.
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.
Install the Monitoring Stack
To create a separate monitoringTo review configuration options, enter:
To review configuration options, enter:kubectl create namespace monitoring
This generates ahelm show values sum-psa-monitoring.tgz > values-monitoring.yamlvalues-monitoring.yamlfile that contains all the configuration options. To modify and pass the generatedvalues-monitoring.yamlfile while installing the Helm chart, enter:helm install psa-monitoring sum-psa-monitoring.tgz --values values-monitoring.yaml --namespace monitoring-
After 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 -
Launch localhost:3000 from the browser and log in using the default credentials with username as
adminand password asprom-operator. A dashboard named Private Simple Synthetic Agent displays and provides details about the Kubernetes cluster, Apache Ignite, Heimdall, and running measurements.
Upgrade Private Synthetic Agent in Bare Metal K8s
Upgrade the Private Synthetic Agent
To upgrade the PSA, perform the following steps:
Pull the Docker Image
Pull the pre-built docker images for sum-chrome-agent, sum-api-monitoring-agent, and sum-heimdall from DockerHub. The pre-built images include the dependent libraries, so you can use these images even when you do not have access to the Internet.
Run the following commands to pull the agent images:
docker pull appdynamics/heimdall-psa
docker pull appdynamics/chrome-agent-psa
docker pull appdynamics/api-monitoring-agent-psaAdd 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.
Create a Dockerfile and then create
RUNdirectives to runpythonpip. For example, to install the libraryalgorithmsyou can create a Dockerfile:# Use the sum-chrome-agent image you just loaded as the base image FROM appdynamics/chrome-agent-psa:<agent-tag> USER root RUN apk add py3-pip USER appdynamics # Install algorithm for python3 on top of that RUN python3 -m pip install algorithms==0.1.4 --break-system-packagesNote: You can create any number of RUN directives to install the required libraries.To build the new image, run the following commands:
Web Monitoring PSA:
API Monitoring PSA:docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile
You must build the images on the host with the same OS type of Kubernetes cluster nodes. For example, if you are pushing the image to AWS, then run the following command:docker build -f Dockerfile-PSA -t sum-api-monitoring-agent:<agent-tag> .
The newly built agent image contains the required libraries.docker buildx build -f Dockerfile-PSA --platform=linux/amd64 -t sum-api-monitoring-agent:<api-tag> .
Tag and Push Images to the Registry
If you are managing your own Kubernetes cluster, then you must deploy your own registry server. For more details, see Deploy a Registry Server. After deploying the registry, tag and push the images.
<REGISTRY_HOST> and <REGISTRY_PORT> with the values that you used while deploying the registry.To tag the images, enter:
docker tag sum-heimdall:<heimdall-tag> <REGISTRY_HOST>:<REGISTRY_PORT>/sum-heimdall:<heimdall-tag>
docker tag sum-chrome-agent:<agent-tag> <REGISTRY_HOST>:<REGISTRY_PORT>/sum-chrome-agent:<agent-tag>
docker tag sum-api-monitoring-agent:<agent-tag> <REGISTRY_HOST>:<REGISTRY_PORT>/sum-api-monitoring-agent:<agent-tag>To push the images, enter:
docker login <REGISTRY_HOST>:<REGISTRY_PORT> docker push <REGISTRY_HOST>:<REGISTRY_PORT>/sum-heimdall:<heimdall-tag>
docker push <REGISTRY_HOST>:<REGISTRY_PORT>/sum-chrome-agent:<agent-tag>
docker push <REGISTRY_HOST>:<REGISTRY_PORT>/sum-api-monitoring-agent:<agent-tag>Update the Helm Chart
Follow these steps and update the configuration key value pairs in the values.yaml file:
Upgrade the PSA
Navigate to the new Linux distribution folder and run the following command:
helm install synth ignite-psa.tgz --values values-ignite.yaml --namespace measurementWait until the status of Ignite pods changes to
running. Then, run the following command:helm upgrade heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurementAfter the status of the new Heimdall and Ignite pods changes to
running, uninstall the old Ignite namespace:helm uninstall synth -n ignite