Minikube を使用した Windows 環境での PSA の設定

警告:
  • Minikube は単一のマシンにインストールされます。したがって、Minikube で PSA を設定する場合は、スケーラブルでも高可用性でもありません。
  • 機能的には、Minikube の PSA と AKS、EKS、またはその他の Kubernetes クラスタの PSA に違いはありません。

次のように、Minikube を使用して Windows 環境で Web モニタリング PSA を設定します。

  1. Azure Windows 仮想マシンの作成
  2. Azure Windows 仮想マシンでの Minikube の設定
  3. Minikube クラスタへの Heimdall の展開

Create an Azure Windows Virtual Machine

Perform the following steps:

  1. Log in to the Azure Portal.
  2. Navigate to Virtual Machines.
  3. Click Create > Virtual Machine, and then under Instance details, specify the following details:
    FieldDescription
    Virtual machine nameSpecify a name for the virtual machine.
    ImageWindows Server 2019 Datacenter - Gen2
    SizeStandard_D8s_v3 - 8 vcpus, 32 GiB memory (US$ 483.26/month)
    注: In the above scenario, a basic machine with 8 vCPUs and 32Gb memory is selected. For a higher load, you may have to select a bigger machine.
  4. Under Administrator account, specify a username and password.
  5. Click Review + create.
    注: The virtual machine deployment may take a few minutes to complete. When the deployment is complete, you can view the new virtual machine Under Virtual Machines.
  6. Open the virtual machine, and click Connect > RDP.
  7. On the next page, click Download RDP File to download the file.
  8. Open the RDP file that you downloaded in the previous step.You will be prompted to specify a username and password. Use the username and password you created in step 4.
    ヒント: Any Remote Desktop application must be installed on your machine to open the file.

Set up Minikube in the Azure Windows Virtual Machine

Perform the following steps:

  1. Log in to the Virtual Machine that you created.
  2. Install the Chocolatey package manager.
  3. Restart the Virtual Machine and open a new Powershell as an administrator.
  4. Install Minikube:
    choco install minikube
  5. Install the Docker Desktop application:
    choco install docker-desktop
  6. Restart the Virtual Machine.
  7. Launch the Docker Desktop application, then go to Settings > Resources.
    注: By default, only limited CPUs and Memory are allotted to Docker. Increase the resources allocation becasue the agent setup will run inside docker.

    Example resource allocation:

    ResourcesValue
    CPUs8
    Memory25 GB
    Swap1 GB
    Disk image size64 GB
  8. Start the Minikube cluster:
    minikube start --driver=docker
    注: This command also sets up kubectl.

Kubernetes クラスタの作成

Minikube をマシンにインストールすると、Docker 環境が付属しています。マシン上に Docker イメージをビルドし、それらのイメージを Kubernetes 展開に使用すると、Docker レジストリまたはハブからイメージがプルされ、ポッドの起動中にエラーが発生します。これは、マシンの Docker デーモンと Minikube の Docker デーモンが異なるために発生します。そのため、Docker イメージのビルドには Minikube Docker デーモンを使用する必要があります。

Minikube Docker デーモンを使用するには、次のコマンドを実行します。

minikube -p minikube docker-env | Invoke-Expression

Simple Synth PSA のインストール用の zip ファイルを、Splunk AppDynamics ダウンロードセンターまたはベータアップロードツールからダウンロードして、ファイルを仮想マシンにコピーします。

Kubernetes クラスタを開始するには、次のコマンドを実行します。

minikube start --kubernetes-version=v1.x.x

Pull the Pre-built 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

Alternatively, 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.

Unzip the .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}
For example:
# 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.tar
Verify that all the images are loaded:
docker images | grep -E "(heimdall|api-monitoring|chrome-agent|ignite)"
When the images are loaded successfully, an output similar to the following is displayed:
```
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
```

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

この手順は任意です。使用可能な標準ライブラリセットに加えて、スクリプト測定で使用するカスタム Python ライブラリをエージェントに追加できます。ベースイメージとしてロードしたイメージに基づいて新しいイメージをビルドします。
  1. Dockerfile を作成し、Python pip を実行する 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
    注: 任意の数の ディレクティブを作成して、必要なライブラリをインストールできます。
  2. 新しいイメージをビルドするには、次のように入力します。
    docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile

    新しくビルドされたエージェントイメージには、必要なライブラリが含まれています。

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

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

sum-heimdall-image

minikube image load appdynamics/heimdall-psa:<heimdall-tag> 

sum-chrome-image

minikube image load appdynamics/chrome-agent-psa:<chrome-tag> 

sum-api-monitoring-image

minikube image load appdynamics/api-monitoring-agent-psa:<api-monitoring-tag>

Web モニタリング PSA の展開

イメージがレジストリに登録されると、アプリケーションはクラスタに展開されます。Helm チャートを使用して、必要な順序ですべての Kubernetes リソースを展開および作成します。
  1. Chocolatey パッケージマネージャを使用して Helm をインストールします。
    choco install kubernetes-helm
  2. Apache Ignite ポッドを実行するための新しい名前空間を作成します。
    警告:
    • 最初に Apache Ignite のコマンドを実行してから、Heimdall のコマンドを実行してください。
    • PSA 23.12 以降、Ignite と Heimdall を measurement という名前の単一の名前空間に展開する必要があります。

    新しい measurement 名前空間を作成するには、次のように入力します。

    kubectl create namespace measurement
    Apache Ignite を展開する前に、いくつかの設定オプションを設定する必要があります。設定オプションを表示するには、すでにダウンロードした ignite-psa.tgz ファイルに移動し、次のように入力します。
    helm show values ignite-psa.tgz > values-ignite.yaml
    注: 永続性を有効にする場合は、[永続性(persistence)] を [有効(enabled)] に設定します。この設定は、オプションです。
  3. 上記の設定を使用して Helm チャートを展開するには、すでにダウンロードした ファイルに移動し、次のように入力します。
    helm install synth ignite-psa.tgz --values values-ignite.yaml --namespace measurement
    すべての Kubernetes リソースがクラスタに作成され、Apache Ignite を使用できます。数秒後、Apache Ignite が初期化され、コントローラに表示されます。
  4. ポッドが実行されているかどうかを確認するには、次のように入力します。
    kubectl get pods --namespace measurement
    Apache Ignite ポッドが正常に実行された後にのみ、次の手順に進みます。
  5. 1 つのコマンドを使用して、展開の詳細を含む Helm チャートを展開できます。エージェントを展開するには、以前にダウンロードした zip ファイルの Helm チャート を使用します。Private Synthetic Agent を展開する前に、いくつかの設定オプションを設定する必要があります。設定オプションを表示するには、すでにダウンロードした sum-psa-heimdall.tgz ファイルに移動し、次のように入力します。
    helm show values sum-psa-heimdall.tgz > values.yaml
    以下は、values.yaml ファイルで編集する必要がある設定キーと値のペアです。

    設定キー

    agent > repositorysum-chrome-agent:
    agent > tag<agent-tag>
    heimdall > pullPolicyなし
    heimdall > repositorysum-heimdall
    heimdall > tag<heimdall-tag>
    shepherd > credentialsログイン情報
    shepherd > locationagent location
    shepherd > urlシェパード URL
    残りの値はデフォルトのままにすることも、要件に基づいて設定することもできます。
  6. 上記の設定を使用して Helm チャートを展開するには、すでにダウンロードした ファイルに移動し、次のように入力します。
    helm install heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
    すべての Kubernetes リソースがクラスタに作成され、Heimdall を使用できます。数秒後、Heimdall が初期化され、コントローラに表示されます。
  7. ポッドが実行されているかどうかを確認するには、次のように入力します。
    kubectl get pods --namespace measurement
    初期導入後に values.yaml に変更を加えるには、すでにダウンロードした sum-psa-heimdall.tgz ファイルに移動して、次のように入力します。
    helm upgrade heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
    注意: 展開を削除するには、次のコマンドを実行します。
    helm uninstall heimdall-onprem --namespace measurement
    これは、必要でない限り推奨されません。