Amazon EC2 を使用したベアメタル K8s での PSA の設定
次のように、Amazon EC2 を使用して、ベアメタル K8s での Web モニタリング PSA と API モニタリング PSA を設定します。既存の Kubernetes クラスタで PSA を設定する場合は、「Kubernetes クラスタの作成」セクションをスキップします。
- Kubernetes クラスタを作成します。
- Docker イメージをプルします。
- Minikube の Docker デーモンにイメージを保存します。
- Web モニタリング PSA と API モニタリング PSA を展開します。
- Kubernetes クラスタをモニターします。
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
(オプション)プロキシサーバーの設定
プロキシサーバーを設定すると、すべてのドメインに適用されます。values.yaml ファイルにプロキシサーバーアドレスを指定して、プロキシサーバーを設定します。「キーと値のペアの設定」を参照してください。
プロキシサーバーからドメインをバイパスするには、次の手順を実行します。
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-psaAlternatively, you can also download the .tar file from the Splunk AppDynamics Download Center. This file includes pre-built docker images for sum-chrome-agent, sum-api-monitoring-agent, sum-heimdall, ignite, and the dependent libraries. So, you can use these images when you do not have access to the Internet and DockerHub.
.tar file and load the images using the following commands:-
sum-chrome-agent:
docker load < ${webAgentTag} -
sum-api-monitoring-agent:
docker load < ${apiAgentTag} -
sum-heimdall:
docker load < ${heimdallTag} -
ignite:
docker load < ${igniteTag}
# Load all Docker images
docker load -i heimdall-25.7.3098.tar
docker load -i api-monitoring-agent-1.0-415.tar
docker load -i chrome-agent-1.0-1067.tar
docker load -i ignite-2.16.0-jdk11.tardocker images | grep -E "(heimdall|api-monitoring|chrome-agent|ignite)"```
829771730735.dkr.ecr.us-west-2.amazonaws.com/sum/heimdall 25.7.3098 abc123def456 2 hours ago 500MB
829771730735.dkr.ecr.us-west-2.amazonaws.com/sum/api-monitoring-agent 1.0-415 def456ghi789 2 hours ago 300MB
829771730735.dkr.ecr.us-west-2.amazonaws.com/sum/chrome-agent 1.0-1067 ghi789jkl012 2 hours ago 800MB
apacheignite/ignite 2.16.0 jkl012mno345 2 hours ago 400MB
```(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-packages注: 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.
イメージのタグ付けとレジストリへのプッシュ
クラスタがアクセスできるように、イメージにタグを付けてレジストリにプッシュする必要があります。これは、次の方法で実行できます。
EC2 を使用した Bare Metal K8S
Vanilla K8S は AWS インフラストラクチャで動作します。kops は適切なロールを作成してクラスタノードに割り当てるため、他の設定なしで Elastic Container Registry(ECR)に直接アクセスできます。
イメージにタグを付けるには、次のように入力します。
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>
<aws_account_id> と <region> をアカウントとリージョンの値に置き換えます。
リポジトリを作成するには、次のように入力します。
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
イメージをプッシュするには、次のように入力します。
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
イメージにタグを付けるには、次のように入力します。
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>
<REGISTRY_HOST> および <REGISTRY_PORT> をレジストリの展開時に設定した値に置き換えます。
イメージをプッシュするには、次のように入力します。
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.
Kubernetes クラスタのモニタリング
ダウンロードした zip 内の Helm チャート sum-psa-monitoring.tgz により、モニタリングスタックがインストールされます。この Helm チャートは、Private Simple Synthetic Agent をモニタするためのカスタム Grafana ダッシュボードとともに kube-prometheus-stack をインストールします。
モニタリングスタックのインストール
別のモニタリングを作成するには、次のように入力します。
設定オプションを確認するには、次のように入力します。kubectl create namespace monitoring
これにより、すべての設定オプションを含むhelm show values sum-psa-monitoring.tgz > values-monitoring.yamlvalues-monitoring.yamlファイルが生成されます。Helm チャートのインストール中に生成されたvalues-monitoring.yamlファイルを変更して渡すには、次のように入力します。helm install psa-monitoring sum-psa-monitoring.tgz --values values-monitoring.yaml --namespace monitoring-
モニタリングスタックをインストールした後、(クラスタ内で実行される)Grafana を起動してダッシュボードを表示できます。クラスタの外部から Grafana にアクセスするには、ポートフォワーディングを設定するか、Ingress を設定します。ローカルにアクセスするようにポートフォワーディングを設定するには、次のように入力します。
kubectl port-forward svc/psa-monitoring-grafana 3000:80 --namespace monitoring -
ブラウザから localhost:3000 を起動し、デフォルトのログイン情報(ユーザー名:
admin、パスワード:prom-operator)を使用してログインします。Private Simple Synthetic Agent という名前のダッシュボードに、Kubernetes クラスタ、Apache Ignite、Heimdall、および実行中の測定に関する詳細が表示されます。
Bare Metal K8s での Private Synthetic Agent のアップグレード
プライベート合成エージェントのアップグレード
PSA をアップグレードするには、次の手順を実行します。
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
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.
-
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 measurement -
Wait 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 measurement -
After the status of the new Heimdall and Ignite pods changes to
running, uninstall the old Ignite namespace:helm uninstall synth -n ignite