Set up PSA in Minikube

Warning:
  • Minikube is installed in a single machine. Hence, it is not scalable or highly available when you set up PSA in Minikube.
  • Functionality-wise, there is no difference between PSA in Minikube and PSA in AKS, EKS, or any other Kubernetes cluster.

Set up the Web Monitoring PSA and API Monitoring PSA in Minikube as follows. If you want to set up PSA in an existing Kubernetes cluster, skip the Create the Kubernetes Cluster section.

Note: Most of the steps are common for both Web Monitoring PSA and API Monitoring PSA. Wherever applicable, the differences in steps are highlighted.
Note: You can deploy PSA on an existing Kubernetes cluster in public or private clouds. The automation scripts do not support Kubernetes cluster creation.

Kubernetes クラスタの作成

Minikube で Kubernetes クラスタを作成するには、次の手順を実行します。

  1. 次の手順に従って、Minikube をインストールします。
  2. クラスタを開始するには、次のように入力します。
    CODE
    minikube start --kubernetes-version=v1.x.x --cpus <number-of-cpus> --memory <amount-of-ram>
    注: Minikube は、デフォルトで Minikube のリリース時に使用可能な Kubernetes の最新バージョンをインストールします。OldestKubernetesVersionサポートされているバージョンの最新情報については、constants.goNewestKubernetesVersion を参照してください。
クラスタへのアクセス

Kubernetes クラスタにアクセスするには、次の手順に従って、クラスタとの対話型ユーティリティである kubectl をインストールします。

クラスタが実行されていることを確認するには、次のように入力します。

CODE
kubectl get nodes

(オプション)プロキシサーバーの設定

プロキシサーバーを設定すると、すべてのドメインに適用されます。values.yaml ファイルにプロキシサーバーアドレスを指定して、プロキシサーバーを設定します。「キーと値のペアの設定」を参照してください。

プロキシサーバーからドメインをバイパスするには、次の手順を実行します。

注: バイパスリストの設定は、Web モニタリング PSA でのみサポートされています。
  1. values.yaml ファイルを開きます。
  2. [browserMonitoringAgent:] の下の [bypassList] フィールドにドメイン URL を追加します
    CODE
    browserMonitoringAgent:
    enabled: true
    server: "<proxy server address>"
    bypassList: "<specify the domain URLs that you want to bypass separated by semicolon>"

    たとえば、 bypassList: "*abc.com;*xyz1.com;*xyz2.com"

    bypassList で指定したドメイン URL は、プロキシサーバーにリダイレクトされません。bypassList に任意の数のドメインを追加できます。他のすべての指定されていないドメイン URL は、プロキシサーバーにリダイレクトされます。

Docker イメージのプル

DockerHub から sum-chrome-agent、sum-api-monitoring-agent、sum- heimdall の既成の Docker イメージをプルします。既成イメージには依存ライブラリが含まれているため、インターネットにアクセスできない場合でもこれらのイメージを使用できます。

次のコマンドを実行して、エージェントイメージをプルします。

CODE
docker pull appdynamics/heimdall-psa
docker pull appdynamics/chrome-agent-psa
docker pull appdynamics/api-monitoring-agent-psa

(オプション)カスタム Python ライブラリの追加

注: このセクションは、Web モニタリング PSA にのみ適用されます。

使用可能な標準ライブラリセットに加えて、スクリプト測定で使用するカスタム Python ライブラリをエージェントに追加できます。ベースイメージとしてロードしたイメージに基づいて新しいイメージをビルドします。

  1. Dockerfile を作成し、Python pip を実行する RUN ディレクティブを作成します。たとえば、algorithms ライブラリをインストールするには、次のように Dockerfile を作成します。

    CODE
    # 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
    注: 任意の数の ディレクティブを作成して、必要なライブラリをインストールできます。
  2. 新しいイメージをビルドするには、次のように入力します。

    CODE
    docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile
    新しくビルドされたエージェントイメージには、必要なライブラリが含まれています。

Minikube の Docker デーモンへのイメージの保存

クラスタがアクセスできるように、イメージにタグを付けてレジストリにプッシュする必要があります。Minikube の Docker にイメージを保存するには、次のコマンドを実行します。

Web モニタリング PSA
CODE
docker save appdynamics/heimdall-psa:<heimdall-tag> | (eval $(minikube docker-env) && docker load)
docker save appdynamics/chrome-agent-psa:<agent-tag> | (eval $(minikube docker-env) && docker load)
API モニタリング PSA:
CODE
docker save appdynamics/heimdall-psa:<heimdall-tag> | (eval $(minikube docker-env) && docker load)
docker save appdynamics/api-monitoring-agent-psa:<agent-tag> | (eval $(minikube docker-env) && docker load)

PSA の手動展開

注: Web モニタリング PSA および API モニタリング PSA をインストールするときは、それぞれの該当する一連の手順に必ず従ってください。一部の手順は、両方で共通しています。

イメージがレジストリに登録されると、アプリケーションはクラスタに展開されます。Helm チャートを使用して、必要な順序ですべての Kubernetes リソースを展開および作成します。

  1. 次の手順に従って、Helm をインストールします。
  2. Apache Ignite ポッドを実行するための新しい名前空間を作成します。
    警告: 最初に Apache Ignite のコマンドを実行してから、Heimdall のコマンドを実行してください。
    Ignite の新しい名前空間を作成するには、次のように入力します。
    CODE
    kubectl create namespace measurement
    Apache Ignite を展開する前に、いくつかの設定オプションを設定する必要があります。設定オプションを表示するには、すでにダウンロードした ignite-psa.tgz ファイルに移動し、次のように入力します。
    CODE
    helm show values ignite-psa.tgz > values-ignite.yaml
    注: 永続性を有効にする場合は、[永続性(persistence)] を [有効(enabled)] に設定します。この設定は、オプションです。
  3. 上記の設定を使用して Helm チャートを展開するには、すでにダウンロードした ignite-psa.tgz ファイルに移動し、次のように入力します。
    :
    CODE
    helm install synth ignite-psa.tgz --values values-ignite.yaml --namespace measurement
    すべての Kubernetes リソースがクラスタに作成され、Apache Ignite を使用できます。数秒後、Apache Ignite が初期化され、コントローラに表示されます。
  4. ポッドが実行されているかどうかを確認するには、次のように入力します。
    CODE
    kubectl get pods --namespace measurement
    Apache Ignite ポッドが正常に実行された後にのみ、次の手順に進みます。1 つのコマンドを使用して、展開の詳細を含む Helm チャートを展開できます。エージェントを展開するには、以前にダウンロードした zip ファイルの Helm チャート を使用します。Private Synthetic Agent を展開する前に、いくつかの設定オプションを設定する必要があります。設定オプションを表示するには、すでにダウンロードした sum-psa-heimdall.tgz ファイルに移動し、次のように入力します。
    CODE
    helm show values sum-psa-heimdall.tgz > values.yaml
    Web モニタリング PSA:
    設定キー
    heimdall > repository sum-heimdall
    heimdall > tag <heimdall-tag>
    heimdall > pullPolicy Never
    chromeAgent > repository sum-chrome-agent
    chromeAgent > tag <agent-tag>
    shepherd > url Shepherd URL
    shepherd > credentials credentials
    shepherd > location agent location
    API モニタリング PSA:
    設定キー
    heimdall > repository sum-heimdall
    heimdall > tag <heimdall-tag>
    heimdall > pullPolicy Never
    apiMonitoringAgent > repository sum-api-monitoring-agent
    apiMonitoringAgent > tag <agent-tag>
    shepherd > url Shepherd URL
    shepherd > credentials credentials
    shepherd > location agent location
    シェパード URL、ログイン情報、場所、およびオプションのキーと値のペアの詳細については、「Web モニタリング PSA および API モニタリング PSA」を参照してください。
    注: Kubernetes クラスタがロックダウンされていて、クラスタ全体の設定を行うことができない場合は、ポッドレベルの変更を行うことができます。

    たとえば、ポッドレベルの DNS サーバー設定を変更して、DNS 名の解決に内部ネームサーバーを使用する場合は、values.yaml ファイルで次の詳細を指定します。

    設定キー
    agentDNSConfig:
    enabled: true
    dnsConfig:
    nameservers: ["4.4.4.4"]
    searches: ["svc.cluster.local", "cluster.local"]
  5. 上記の設定を使用して Helm チャートを展開するには、すでにダウンロードした sum-psa-heimdall.tgz ファイルに移動し、次のように入力します。
    CODE
    helm install heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
    すべての Kubernetes リソースがクラスタに作成され、Heimdall を使用できます。数秒後、Heimdall が初期化され、コントローラに表示されます。
  6. ポッドが実行されているかどうかを確認するには、次のように入力します。
    CODE
    kubectl get pods --namespace measurement
    初期導入後に values.yaml に変更を加えるには、すでにダウンロードした sum-psa-heimdall.tgz ファイルに移動して、次のように入力します。
    CODE
    helm upgrade heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
    警告:

    展開を削除するには、次のコマンドを実行します。

    CODE
    helm uninstall heimdall-onprem --namespace measurement

    これは、必要でない限り推奨されません。

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:

  1. Unzip the PSA installation zip file.
  2. Run the following command to install PSA in Minikube:
    CODE
    ./install_psa -e minikube -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> -j <ingress-and-egress-bandwidth-value-for-the-API-monitoring-pod> -w <heimdall_proxy_server>~<api_monitoring_proxy_server>~<web_monitoring_proxy_server> -B <"bypassURL1;bypassURL2;bypassURL3"> -C true
    A sample installation command looks like this:
    CODE
    ./install_psa -e minikube -l -v -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 -j 1024k -w 127.0.0.1:8887~127.0.0.1:8888~127.0.0.1:8889 -B "*abc.com;*xyz1.com;*xyz2.com" -C true
    The following table describes the usage of the flags in the command. Asterisk (*) on the description denotes mandatory parameters.
The following table describes the usage of the flags in the command. Asterisk (*) on the description denotes mandatory parameters.
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.
-j Ingress and egress bandwidth value for the API monitoring pod.
-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 クラスタのモニタリング

カスタムの Grafana ダッシュボードと共に、Helm チャート sum-psa-monitoring.tgz kube-prometheus-stackを使用して、Private Simple Synthetic Agent を監視します。

注: この展開のモニタリングはオプションです。ただし、クラスタをモニターして正常性を定期的に確認することを強く推奨します。

モニタリングスタックのインストール

  1. 別の monitoring 名前空間を作成するには、次のように入力します。

    CODE
    kubectl create namespace monitoring
    設定オプションを確認するには、次のように入力します。
    CODE
    helm show values sum-psa-monitoring.tgz > values-monitoring.yaml
    これにより、すべての設定オプションを含む values-monitoring.yaml ファイルが生成されます。Helm チャートのインストール中に生成された values-monitoring.yaml ファイルを変更して渡すには、次のように入力します。
    CODE
    helm install psa-monitoring sum-psa-monitoring.tgz --values values-monitoring.yaml --namespace monitoring
  2. モニタリングスタックをインストールした後、(クラスタ内で実行される)Grafana を起動してダッシュボードを表示できます。クラスタの外部から Grafana にアクセスするには、ポートフォワーディングを設定するか、Ingress を設定します。ローカルにアクセスするようにポートフォワーディングを設定するには、次のように入力します。

    CODE
    kubectl port-forward svc/psa-monitoring-grafana 3000:80 --namespace monitoring
  3. ブラウザから localhost:3000 を起動し、デフォルトのログイン情報(ユーザー名:admin、パスワード:prom-operator)を使用してログインします。Private Simple Synthetic Agent という名前のダッシュボードに、Kubernetes クラスタ、Apache Ignite、Heimdall、および実行中の測定に関する詳細が表示されます。

PSA のアンインストール

PSA をアンインストールするには、次のコマンドを実行します。

CODE
./uninstall_psa -e -p -m

次の表では、コマンドでのフラグの使用について説明します。

フラグ 説明
-e

環境

たとえば、Docker、Minikube、または Kubernetes などです。

-p PSA のみをアンインストールします。
-m PSA と Minikube をアンインストールします。

Minikube での PSA のアップグレード

Docker イメージのプル

DockerHub から sum-chrome-agent、sum-api-monitoring-agent、sum- heimdall の既成の Docker イメージをプルします。既成イメージには依存ライブラリが含まれているため、インターネットにアクセスできない場合でもこれらのイメージを使用できます。

次のコマンドを実行して、エージェントイメージをプルします。

CODE
docker pull appdynamics/heimdall-psa
docker pull appdynamics/chrome-agent-psa
docker pull appdynamics/api-monitoring-agent-psa

カスタム Python ライブラリの追加

この手順は任意です。使用可能な標準ライブラリセットに加えて、スクリプト測定で使用するカスタム Python ライブラリをエージェントに追加できます。ベースイメージとしてロードしたイメージに基づいて新しいイメージをビルドします。

  1. Dockerfile を作成してから、pythonpip を実行する RUN ディレクティブを作成します。たとえば、algorithms ライブラリをインストールするには、次のように Dockerfile を作成します。
    CODE
    # 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
    注: 任意の数の ディレクティブを作成して、必要なライブラリをインストールできます。
  2. 新しいイメージをビルドするには、Web Monitoring PSA: を入力します。
    CODE
    docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile
    新しくビルドされたエージェントイメージには、必要なライブラリが含まれています。 API Monitoring PSA:
    CODE
    docker build -f Dockerfile-PSA -t sum-api-monitoring-agent:<monitoring-tag> .
    新しくビルドされたエージェントイメージには、必要なライブラリが含まれています。

イメージのタグ付けとレジストリへのプッシュ

注: EKS や AKS などのマネージド Kubernetes サービスは、イメージをプッシュできるコンテナレジストリを提供します。その他の設定は必要ありません。EKS または AKS 内の Kubernetes クラスタは、これらのイメージにアクセスできます。

イメージにタグを付けるには、次のように入力します。

CODE
docker save sum-heimdall:<heimdall-tag> | (eval $(minikube docker-env) && docker load)
docker save sum-chrome-agent:<agent-tag> | (eval $(minikube docker-env) && docker load)
docker save sum-api-monitoring-agent:<agent-tag> | (eval $(minikube docker-env) && docker load)

Helm チャートの更新

次の手順に従って、values.yaml ファイル内の設定キーと値のペアを更新します。

PSA のアップグレード

注: PSA 23.12 以降、Ignite と Heimdall を measurement という名前の単一の名前空間に展開する必要があります。
  1. 新しい Linux ディストリビューション フォルダに移動して、次のコマンドを実行します。
    CODE
    helm install synth ignite-psa.tgz --values values-ignite.yaml --namespace measurement
  2. Ignite ポッドのステータスが running に変わるまで待ちます。その後、次のコマンドを実行します。
    CODE
    helm upgrade heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
  3. 新しい Heimdall ポッドと Ignite ポッドのステータスが runningに変更されたら、古い Ignite 名前空間をアンインストールします。
    CODE
    helm uninstall synth -n ignite