Set up the Web Monitoring PSA and API Monitoring PSA in Amazon Elastic Kubernetes Service (Amazon EKS) as follows. If you want to set up PSA in an existing Kubernetes cluster, skip the Create the Kubernetes Cluster section.

  1. Create the Kubernetes Cluster.
  2. Deploy PSA in EKS
  3. Monitor the Kubernetes cluster.

This document contains links to AWS CLI documentation. AppDynamics makes no representation as to the accuracy of AWS CLI documentation because AWS CLI controls its own documentation.

You can deploy PSA on an existing Kubernetes cluster in public or private clouds. The automation scripts do not support Kubernetes cluster creation. 

  • If you use the automated script, you must manually set up the Kubernetes cluster and nodes and log in to container registries before deploying PSA.
  • If you use a separate registry, specify the registry in the automated script before deploying PSA:
    1. Open the install_psa file and go to the push_images_to_docker_registry() function.

    2. Under that function, after ${DOCKER_REGISTRY_URL}/, specify the registry names of sum-chrome-agentsum-api-monitoring-agent, and sum-heimdall.
    3. Under the generate_psa_k8s_deployment() function, update the repository names on the YAML values. 

  • You must build the images on the host with the same OS type of Kubernetes cluster nodes.

Create the Kubernetes Cluster

To create a Kubernetes cluster in Amazon EKS:

  1. Install and configure AWS CLI.

  2. Based on your platform, install eksctl following the instructions here.

  3. To create a Kubernetes cluster, enter:

    EKSCTL_CLUSTER_NAME=eks-heimdall-onprem-cluster
    EKSCTL_NODEGROUP_NAME=eks-heimdall-onprem-worker-nodes
    EKSCTL_KUBERNETES_VERSION=1.x.x
     
     
    eksctl create cluster \
    --name ${EKSCTL_CLUSTER_NAME} \
    --version ${EKSCTL_KUBERNETES_VERSION} \
    --region us-west-2 \
    --zones us-west-2a,us-west-2b,us-west-2c \
    --nodegroup-name ${EKSCTL_NODEGROUP_NAME} \
    --node-type t3.2xlarge \
    --nodes 4 \
    --nodes-min 2 \
    --nodes-max 6 \
    --ssh-access \
    --ssh-public-key ~/.ssh/id_rsa.pub \
    --managed \
    --vpc-nat-mode Disable
    CODE

    Replace the EKSCTL_KUBERNETES_VERSION with one of the EKS Kubernetes versions

    The node-type, nodes, nodes-min, and nodes-max in the code snippet are selected based on the recommended configuration type. You can specify a configuration of your choice with a different type and number of nodes. See EC2 instance types.

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
CODE

(Optional) Configure Proxy Server 

Configuring a proxy server is supported only on Web Monitoring PSA.

When you configure a proxy server, it applies to all the domains. To configure a proxy server only for certain domains, perform the following steps:

  1. Navigate to the sum-chrome-agent/agent directory.
  2. Open the chrome.py file.
  3. Navigate to the following string:

    if self._proxy_server: 
    chrome_options.add_argument('--proxy-server={}'.format(self._proxy_server))
    CODE
  4. Append the following details: 

    bypass_list = ["*abc.com", "*xyz1.com", "*xyz2.com"]
    chrome_options.add_argument('--proxy-bypass-list=%s' % ";".join(bypass_list))
    CODE

    Domain URLs that you specify in bypass_list are not redirected to the proxy server. You can add any number of domains in the bypass_list. All other unspecified domain URLs are redirected to the proxy server.

  5. Specify the proxy server address on the values.yaml file. See Key-Value Pairs Configuration.

    If you make any changes to the bypass_list after building the docker image, you must rebuild the docker image.

Deploy PSA in EKS

Download the PSA installation zip file from the Appdynamics Downloads Portal or from the beta upload tool. This file contains Docker files for sum-chrome-agent, sum-api-monitoring-agent, sum-heimdall, Helm charts, and automation scripts. To build an image for sum-chrome-agent, sum-api-monitoring-agent, and sum-heimdall, ensure that Docker is installed. You can download and install Docker from here if it is not installed.

Perform the following steps to install PSA:

  1. Unzip the PSA installation zip file.
  2. Run the following command to install PSA in EKS:

    ./install_psa -e kubernetes -l -v -u <Shepherd-URL> -a <EUM-account> -k <EUM-key> -c <location-code> -d <location-description> -t <location-name> -s <location-state> -o <location-country> -i <location-latitude> -g <location-longitude> -p <PSA-tag> -r <heimdall-replica-count> -z <agent-type> -m <chrome-agent_min/max-memory> -n <API-agent_min/max-memory> -x <chrome-agent_min/max-CPU> -y <API-agent_min/max-CPU> -b <heimdall_min/max-memory> -f <heimdall_min/max-CPU> -q <ignite-persistence>
    CODE

    A sample installation command looks like this: 

    ./install_psa -e kubernetes -u <Shepherd-URL> -a <EUM-account> -k <EUM-key> -c DEL -d Delhi -t Delhi -s DEL -o India -i 28.70 -g 77.10 -p 23.5 -r 1 -z all -m 100Mi/500Mi -n 100Mi/100Mi -x 0.5/1.5 -y 0.1/0.1 -b 2Gi/2Gi -f 2/2 -q true 
    CODE

The following table describes the usage of the flags in the command. Asterisk (*) on the description denotes mandatory parameters.

FlagDescription
-e

Environment

For example, Docker, Minikube, or Kubernetes.

-lLoad images to the Minkube environment
-vDebug mode
-u

*Shepherd URL

For example, https://sum-shadow-master-shepherd.saas.appd-test.com/

-a

*EUM Account

For example, Ati-23-2-saas-nov2

-k

*EUM Key

For example, 2d35df4f-92f0-41a8-8709-db54eff7e56c

-c

*Location Code

For example, DEL for Delhi, NY for New York

-d

*Location Description

For example, 'Delhi, 100001'

-t

*Location City

For example, Delhi

-s

*Location State

For example, CA for California

-o

*Location Country

For example, India, United States

-i

Location Latitude

For example, 28.70 for Delhi

-g

Location Longitude

For example, 77.10 for Delhi

-p

*PSA release tag

For example, 23.5

-rHeimdall replica count
-z 

Agent type

For example, web, api, or all

-m  

Minimum/Maximum memory in Mi/Gi for sum-chrome-agent 
-n   Minimum/Maximum memory in Mi/Gi for sum-api-monitoring-agent 
-x   Minimum/Maximum CPU for sum-chrome-agent 
-y   Minimum/Maximum CPU for sum-api-monitoring-agent 
-bMinimum/Maximum memory in Mi/Gi for sum-heimdall 
-f Minimum/Maximum CPU for sum-heimdall 
-qSpecify true or false to enable or disable Ignite Persistence. 

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 recommend that you monitor the cluster to check its health periodically.  

Install the Monitoring Stack

  1. To create a separate monitoring namespace, enter:  

    kubectl create namespace monitoring
    CODE

    To review configuration options, enter: 

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

    This generates a values-monitoring.yaml file that contains all the configuration options. To modify and pass the generated values-monitoring.yaml file while installing the Helm chart, enter:

    helm install psa-monitoring sum-psa-monitoring.tgz --values values-monitoring.yaml --namespace monitoring
    CODE
  2. 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
    CODE
  3. Launch localhost:3000 from the browser and log in using the default credentials with username as admin and password as prom-operator. A dashboard named Private Simple Synthetic Agent displays and provides details about the Kubernetes cluster, Apache Ignite, Heimdall, and running measurements.

Uninstall PSA

To uninstall PSA, run the following command:

./uninstall_psa -e kubernetes -p
CODE