Set up PSA in Amazon EKS
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.
| Deploy Manually | Deploy Using the Automation Script |
|---|---|
- 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:
-
Open the
install_psafile and go to thepush_images_to_docker_registry()function. - Under that function, after ${DOCKER_REGISTRY_URL}/, specify the registry names of
sum-chrome-agent,sum-api-monitoring-agent,andsum-heimdall. -
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.
Kubernetes クラスタの作成
Amazon EKS で Kubernetes クラスタを作成するには、次の手順を実行します。
クラスタへのアクセス
Kubernetes クラスタにアクセスするには、次の手順に従って、クラスタとの対話型ユーティリティである kubectl をインストールします。
クラスタが実行されていることを確認するには、次のように入力します。
kubectl get nodes(オプション)プロキシサーバーの設定
プロキシサーバーを設定すると、すべてのドメインに適用されます。values.yaml ファイルにプロキシサーバーアドレスを指定して、プロキシサーバーを設定します。「キーと値のペアの設定」を参照してください。
プロキシサーバーからドメインをバイパスするには、次の手順を実行します。
Docker イメージのプル
DockerHub から sum-chrome-agent、sum-api-monitoring-agent、sum- heimdall の既成の Docker イメージをプルします。既成イメージには依存ライブラリが含まれているため、インターネットにアクセスできない場合でもこれらのイメージを使用できます。
次のコマンドを実行して、エージェントイメージをプルします。
docker pull appdynamics/heimdall-psa
docker pull appdynamics/chrome-agent-psa
docker pull appdynamics/api-monitoring-agent-psa
(オプション)カスタム Python ライブラリの追加
使用可能な標準ライブラリセットに加えて、スクリプト測定で使用するカスタム Python ライブラリをエージェントに追加できます。ベースイメージとしてロードしたイメージに基づいて新しいイメージをビルドします。
Tag and Push Images to the Registry
You must tag and push the images to a registry for the cluster to access it. The Amazon EKS clusters pull the images from Elastic Container Registry (ECR), which is the managed registry provided by AWS.
Tag the Images
docker tag appdynamics/heimdall-psa:<heimdall-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-heimdall:<heimdall-tag>
docker tag appdynamics/chrome-agent-psa:<agent-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-chrome-agent:<agent-tag>
docker tag appdynamics/api-monitoring-agent-psa:<agent-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-api-monitoring-agent:<agent-tag>You need to replace <aws_account_id> & <region> with your account id and region values.
To create repositories, enter:
aws ecr create-repository --repository-name sum/sum-heimdall
aws ecr create-repository --repository-name sum/sum-chrome-agent
aws ecr create-repository --repository-name sum/sum-api-monitoring-agent
Push the Images
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>
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-api-monitoring-agent:<agent-tag>Deploy PSA Manually
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.
Deploy PSA Using the Automation Script
Download the PSA installation zip file from the Splunk AppDynamics Download Center 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:
| Flag | Description |
|---|---|
| -e | *Environment For example, Docker, Minikube, or Kubernetes. |
| -l | Load images to the Minkube environment |
| -v | Debug mode |
| -u | *Shepherd URL For example, https://sum-shadow-master-shepherd.saas.appd-test.com/ For the list of Shepherd URLs, see Shepherd URL. |
| -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 NY |
| -d | *Location Description For example, 'Delhi, 100001' |
| -t | *Location City For example, Delhi |
| -s | *Location State For example, CA |
| -o | *Location Country For example, India, United States |
| -i | Location Latitude For example, 28.70 |
| -g | Location Longitude For example, 77.10 |
| -p | *PSA release tag For example, 23.12 |
| -r | *Heimdall 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 |
| -b | *Minimum/Maximum memory in Mi/Gi for sum-heimdall |
| -f | *Minimum/Maximum CPU for sum-heimdall |
| -q | Specify true or false to enable or disable Ignite Persistence. |
| -w | Specify the proxy servers for Heimdall, API, and Web monitoring, separated by a tilde(~). If you do not need to set up any proxy server, you can leave it blank. |
| -B | Specify the domain URLs that you want to bypass from the proxy server. For example, "*abc.com;*xyz1.com;*xyz2.com" |
| -C | Specify true to enable performance logs on the Chrome browser. The default value is false. |
Kubernetes クラスタのモニタリング
ダウンロードした zip 内の Helm チャート により、モニタリングスタックがインストールされます。この Helm チャートは、Private Simple Synthetic Agent をモニタするためのカスタム Grafana ダッシュボードとともに kube-prometheus-stack をインストールします。
モニタリングスタックのインストール
PSA のアンインストール
PSA をアンインストールするには、次のコマンドを実行します。
./uninstall_psa -e kubernetes -p
Amazon Elastic Kubernetes Service の PSA のアップグレード
プライベート合成エージェントのアップグレード
PSA をアップグレードするには、次の手順を実行します。
Docker イメージのプル
DockerHub から sum-chrome-agent、sum-api-monitoring-agent、sum- heimdall の既成の Docker イメージをプルします。既成イメージには依存ライブラリが含まれているため、インターネットにアクセスできない場合でもこれらのイメージを使用できます。
次のコマンドを実行して、エージェントイメージをプルします。
docker pull appdynamics/heimdall-psa
docker pull appdynamics/chrome-agent-psa
docker pull appdynamics/api-monitoring-agent-psa
カスタム Python ライブラリの追加
この手順は任意です。使用可能な標準ライブラリセットに加えて、スクリプト測定で使用するカスタム Python ライブラリをエージェントに追加できます。ベースイメージとしてロードしたイメージに基づいて新しいイメージをビルドします。
-
Dockerfile を作成し、
pythonpipを実行するRUNディレクティブを作成します。たとえば、algorithmsライブラリをインストールするには、次のように 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-packages注: 任意の数の ディレクティブを作成して、必要なライブラリをインストールできます。 -
新しいイメージを作成するには、次のコマンドを実行します。[Web モニタリング PSA ]:
API モニタリング PSA:docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile
Kubernetes クラスタノードと同じ OS タイプのホストでイメージをビルドする必要があります。たとえば、イメージを AWS にプッシュする場合は、次のコマンドを実行します。docker build -f Dockerfile-PSA -t sum-api-monitoring-agent:<agent-tag> .
新しくビルドされたエージェントイメージには、必要なライブラリが含まれています。docker buildx build -f Dockerfile-PSA --platform=linux/amd64 -t sum-api-monitoring-agent:<api-tag> .
イメージのタグ付けとレジストリへのプッシュ
クラスタがアクセスできるように、イメージにタグを付けてレジストリにプッシュする必要があります。Amazon EKS クラスタは、AWS が提供するマネージドレジストリである Elastic Container Registry(ECR)からイメージをプルします。
Vanilla K8S は AWS インフラストラクチャで実行されるため、Kubernetes Operations(kops)が適切なロールを作成してクラスタノードに割り当て、それらは ECR に直接アクセスできます。その他の設定は必要ありません。そのため、プロセスは、EC2 を使用する EKS と Vanilla K8S の両方で同じです。
イメージにタグを付けるには、次のように入力します。
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>
docker tag sum-api-monitoring-agent:<agent-tag> <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-api-monitoring-agent:<agent-tag>
と をアカウント ID とリージョンの値に置き換える必要があります。
リポジトリを作成するには、次のように入力します。
aws ecr create-repository --repository-name sum/sum-heimdall
aws ecr create-repository --repository-name sum/sum-chrome-agent
aws ecr create-repository --repository-name sum/sum-api-monitoring-agent
イメージをプッシュするには、次のように入力します。
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>
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-api-monitoring-agent:<agent-tag>
Helm チャートの更新
次の手順に従って、values.yaml ファイル内の設定キーと値のペアを更新します。
PSA のアップグレード
-
新しい Linux ディストリビューション フォルダに移動して、次のコマンドを実行します。
helm install synth ignite-psa.tgz --values values-ignite.yaml --namespace measurement -
Ignite ポッドのステータスが
runningに変わるまで待ちます。その後、次のコマンドを実行します。helm upgrade heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement -
新しい Heimdall ポッドと Ignite ポッドのステータスが
runningに変更されたら、古い Ignite 名前空間をアンインストールします。helm uninstall synth -n ignite