Set up PSA in Red Hat OpenShift

To deploy the Web Monitoring PSA and API Monitoring PSA in OpenShift, you must create OpenShift clusters in Amazon EKS or Azure AKS. You can set up the PSA in one of the following ways:

Deploy ManuallyDeploy Using the Automation Script
  1. Pull the Docker image.
  2. Tag and push images to the Registry.
  3. Deploy PSA in OpenShift Manually
  4. Monitor the Kubernetes cluster.
  1. Deploy PSA in OpenShift Using the Automation Script
  2. Monitor the Kubernetes cluster.
Warning: This document contains links to AWS CLI documentation. Splunk AppDynamics makes no representation as to the accuracy of AWS CLI documentation because AWS CLI controls its own documentation.
Warning: If you use the automated script, you must manually set up the OpenShift cluster and nodes and log in to container registries before deploying PSA.

(Optional) Configure Proxy Server

When you configure a proxy server, it gets configured at the agent level and applies to all Synthetic jobs for that agent. Configure a proxy server by specifying the proxy server address on the values.yaml file. See Key-Value Pairs Configuration. Private Synthetic Agent supports basic authentication.

To bypass any domains from the proxy server, perform the following steps:

Note: Configuring the bypass list is supported only on Web Monitoring PSA.
  1. Open the values.yaml file.
  2. Add the domain URLs in the bypassList field under browserMonitoringAgent:
    browserMonitoringAgent:
      enabled: true
      server: "<proxy server address>"
      bypassList: "<specify the domain URLs that you want to bypass separated by semicolon>"

Configure Proxy Server at a Job Level

You can configure a proxy server and a bypass list for a particular job. Any proxy server URL and bypass list configured at the agent level gets overridden by the proxy server URL and bypass list configured at the job level. Perform the following steps to configure a proxy server at the job level:
  1. Create or edit a Synthetic job.
  2. Select the Run a script option.
  3. Add the following details in the beginning the script:
    '''yml
    jobLevelProxyConfig:
      proxyServer: "<proxy-server-address>"
      bypassProxyList: "<list of URLs that you want to bypass, separated by semi-colon>"
    '''
    Example:
    '''yml
    jobLevelProxyConfig:
      proxyServer: "http://tinyproxy: tinyproxy.svc.cluster.local:8888"
      bypassProxyList: "*abc.com;*xyz1.com;*xyz2.com"
    '''
    
    pageUrl = "https://help.splunk.com/en"
    driver.get(pageUrl)
    assert "Splunk" in driver.title, "Title should contain Splunk"

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

または、Splunk AppDynamics Download Center から .tar ファイルをダウンロードすることもできます。このファイルには、sum-chrome-agent、sum-api-monitoring-agent、sum-heimdall、ignite、および依存ライブラリの事前ビルド済み Docker イメージが含まれています。したがって、インターネットや DockerHub にアクセスできない場合にこれらのイメージを使用できます。

.tar ファイルを解凍し、次のコマンドを使用してイメージをロードします。
  • 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.tar
すべてのイメージがロードされていることを確認します。
docker 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
```

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

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

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

  1. Dockerfile を作成し、Python pip を実行する ディレクティブを作成します。たとえば、 ライブラリをインストールするには、次のように 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
    新しくビルドされたエージェントイメージには、必要なライブラリが含まれています。

イメージにタグを付け、レジストリにプッシュします。

クラスタがアクセスできるように、イメージにタグを付けてレジストリにプッシュする必要があります。Amazon EKS クラスタは、AWS が提供するマネージドレジストリである Elastic Container Registry(ECR)からイメージをプルします。

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

Web モニタリング 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 モニタリング 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>

をアカウント ID とリージョンの値に置き換える必要があります。

リポジトリを作成するには、次のように入力します。

Web モニタリング PSA:

aws ecr create-repository --repository-name sum/sum-heimdall aws ecr create-repository --repository-name sum/sum-chrome-agent

API モニタリング PSA:

aws ecr create-repository --repository-name sum/sum-heimdall aws ecr create-repository --repository-name sum/sum-api-monitoring-agent

イメージをプッシュするには、次のように入力します。

Web モニタリング 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 モニタリング 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>

OpenShift での PSA の手動展開

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

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

  1. 次の手順に従って、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
  3. (オプション) Apache Ignite の Amazon Elastic File System(Amazon EFS)を有効にします。 values-ignite.yaml ファイルを開き、永続設定で次の詳細を更新します。
    persistence:
    # To turn on persistence, kindly set enabled to true. Do not modify onPremMode value
    enabled: true
    onPremMode: true
    enableEfs: false  # Set to true if you are using efs
    persistenceVolume:
    size: 8Gi
    provisioner: efs.csi.aws.com # Replace with your provisioner value
    provisionerParameters:
    type: efs # Specify that it's for Amazon EFS
    fileSystemId: fs-01285427ea904c120  # Replace with your EFS file system ID
    provisioningMode: efs-ap # Replace with your provisioner mode
    walVolume:
    size: 8Gi
    provisioner: efs.csi.aws.com # Replace with your provisioner value
    provisionerParameters:
    type: efs  # Specify that it's for Amazon EFS
    fileSystemId: fs-01285427ea904c120  # Replace with your EFS file system ID
    provisioningMode: efs-ap # Replace with your provisioner mode
    enableHostPath: false  # Set to true if you are using hostpath
    hostPath:
    persistenceMount: /mnt/ignite/persistence
    walMount: /mnt/ignite/wal
    注: Helm チャートを展開後、次のコマンドを実行して、Persistent Volume(PV)と Persistent Volume Claim(PVC)が実行されているかどうかを確認できます。
    kubectl get pv -n measurement
    kubectl get pvc -n measurement
    PV および PVC のステータスが Bound に変わったら、Amazon EFS 設定が完了したことを示します。
    注: Amazon EFS for Heimdall を有効にするには、values.yaml ファイルの設定を更新します。
  4. 上記の設定を使用して Helm チャートを展開するには、すでにダウンロードした ファイルに移動し、次のように入力します。
    helm install synth ignite-psa.tgz --values values-ignite.yaml --namespace measurement
    すべての Kubernetes リソースがクラスタに作成され、Apache Ignite を使用できます。数秒後、Apache Ignite が初期化され、コントローラに表示されます。
  5. ポッドが実行されているかどうかを確認するには、次のように入力します。
    kubectl get pods --namespace measurement
    Apache Ignite ポッドが正常に実行された後にのみ、次の手順に進みます。
  6. 1 つのコマンドを使用して、展開の詳細を含む Helm チャートを展開できます。エージェントを展開するには、以前にダウンロードした zip ファイルの Helm チャート を使用します。Private Synthetic Agent を展開する前に、いくつかの設定オプションを設定する必要があります。設定オプションを表示するには、すでにダウンロードした sum-psa-heimdall.tgz ファイルに移動し、次のように入力します。
    helm show values sum-psa-heimdall.tgz > values.yaml

    以下は、values.yaml ファイルで編集する必要がある設定キーと値のペアです。

    Web モニタリング PSA:
    設定キー
    heimdall > repository<aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-heimdall
    heimdall > tag<heimdall-tag>
    heimdall > pullPolicyAlways
    chromeAgent > repository<aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-chrome-agent
    chromeAgent > tag<agent-tag>
    shepherd > urlシェパード URL
    shepherd > credentialsログイン情報
    shepherd > locationagent location
    永続化

    (オプション)Amazon EFS for Heimdall を有効にする場合は、次の詳細を指定します。

    # To turn on persistence, kindly set enabled to true
    persistence:
    enabled: false
    storageClass:
    provisioner: efs.csi.aws.com # Specify that it's for Amazon EFS
    parameters:
    type: efs  # Specify that it's for Amazon EFS
    fileSystemId: fs-01285427ea904c120   # Replace with your EFS file system ID
    provisioningMode: efs-ap  # Replace with your provisioner mode
    注: Helm チャートを展開後、次のコマンドを実行して PV と PVC が実行されているかどうかを確認できます。
    kubectl get pv -n measurement
    kubectl get pvc -n measurement
    PV および PVC のステータスが Bound に変わったら、Amazon EFS 設定が完了したことを示します。
    measurementPodMetadata(オプション)enableCustomTolerationsenableCustomAffinity、および enableCustomLabels の値を true に変更し、許容、アフィニティ、およびラベルを有効にします。
    measurementPodMetadata:
      enableCustomTolerations: false  # Enable use of custom tolerations from this config
      enableCustomAffinity: false     # Enable use of custom affinity rules from this config
      enableCustomLabels: false      # Enable use of custom labels from this config
      automountServiceAccountToken: false # Automatically mount service account token in pods
      labels: # Custom labels to apply to the Pod metadata
        team: "qa"             # Example: assign pod to QA team
        priority: "high"       # Example: set custom priority level
        app.kubernetes.io/managed-by: "scheduler-service"  # Standard label
      tolerations:
        - key: "dedicated"                      # Tolerate nodes tainted with key=dedicated
          operator: "Equal"                     # Match taint value exactly
          value: "measurement"                  # Accept taint with value=measurement
          effect: "NoSchedule"                  # Allow scheduling on such tainted nodes
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: "kubernetes.io/hostname"  # Node must have this hostname
                    operator: "In"                 # Match exact value
                    values:
                      - "node-1"                   # Only allow node named node-1
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 80                           # Strong preference weight
              preference:
                matchExpressions:
                  - key: "topology.kubernetes.io/zone"  # Prefer node in this zone
                    operator: "In"
                    values:
                      - "us-central1-a"
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: "app"                     # Co-locate with pod having app=frontend
                    operator: "In"
                    values:
                      - "frontend"
              topologyKey: "kubernetes.io/hostname"  # Must be on the same node
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 50                            # Medium preference
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: "app"                   # Prefer proximity to app=logger pods
                      operator: "In"
                      values:
                        - "logger"
                topologyKey: "topology.kubernetes.io/zone"  # Prefer same zone
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: "app"                     # Do NOT schedule with app=backend pods
                    operator: "In"
                    values:
                      - "backend"
              topologyKey: "kubernetes.io/hostname"  # Must not be on same node
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 30                            # Low preference to avoid
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: "env"                   # Prefer to avoid pods in env=production
                      operator: "In"
                      values:
                        - "production"
                topologyKey: "topology.kubernetes.io/region"  # Prefer different region
    createChromePodServiceAccountWeb モニタリングポッドのサービスアカウントを作成するには、true を指定します。
    API モニタリング PSA:
    設定キー
    heimdall > repository<aws_account_id>.dkr.ecr.<region>.amazonaws.com/sum/sum-heimdall
    heimdall > tag<heimdall-tag>
    heimdall > pullPolicyAlways
    apiMonitoringAgent > repository <aws_account_id>.dkr.ecr.<region>.
    apiMonitoringAgent > tag<agent-tag>
    ingressBandwidth1024k 以上(要件に応じて)。
    egressBandwidth1024k 以上(要件に応じて)。
    shepherd > urlシェパード URL
    shepherd > credentialsログイン情報
    shepherd > locationagent location
    永続化

    (オプション)Amazon EFS for Heimdall を有効にする場合は、次の詳細を指定します。

    # To turn on persistence, kindly set enabled to true
    persistence:
    enabled: false
    storageClass:
    provisioner: efs.csi.aws.com # Specify that it's for Amazon EFS
    parameters:
    type: efs  # Specify that it's for Amazon EFS
    fileSystemId: fs-01285427ea904c120   # Replace with your EFS file system ID
    provisioningMode: efs-ap  # Replace with your provisioner mode
    注: Helm チャートを展開後、次のコマンドを実行して PV と PVC が実行されているかどうかを確認できます。
    kubectl get pv -n measurement
    kubectl get pvc -n measurement
    PV および PVC のステータスが Bound に変わったら、Amazon EFS 設定が完了したことを示します。
    measurementPodMetadata(オプション)enableCustomTolerationsenableCustomAffinity、および enableCustomLabels の値を true に変更し、許容、アフィニティ、およびラベルを有効にします。
    measurementPodMetadata:
      enableCustomTolerations: false  # Enable use of custom tolerations from this config
      enableCustomAffinity: false     # Enable use of custom affinity rules from this config
      enableCustomLabels: false      # Enable use of custom labels from this config
      automountServiceAccountToken: false # Automatically mount service account token in pods
      labels: # Custom labels to apply to the Pod metadata
        team: "qa"             # Example: assign pod to QA team
        priority: "high"       # Example: set custom priority level
        app.kubernetes.io/managed-by: "scheduler-service"  # Standard label
      tolerations:
        - key: "dedicated"                      # Tolerate nodes tainted with key=dedicated
          operator: "Equal"                     # Match taint value exactly
          value: "measurement"                  # Accept taint with value=measurement
          effect: "NoSchedule"                  # Allow scheduling on such tainted nodes
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: "kubernetes.io/hostname"  # Node must have this hostname
                    operator: "In"                 # Match exact value
                    values:
                      - "node-1"                   # Only allow node named node-1
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 80                           # Strong preference weight
              preference:
                matchExpressions:
                  - key: "topology.kubernetes.io/zone"  # Prefer node in this zone
                    operator: "In"
                    values:
                      - "us-central1-a"
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: "app"                     # Co-locate with pod having app=frontend
                    operator: "In"
                    values:
                      - "frontend"
              topologyKey: "kubernetes.io/hostname"  # Must be on the same node
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 50                            # Medium preference
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: "app"                   # Prefer proximity to app=logger pods
                      operator: "In"
                      values:
                        - "logger"
                topologyKey: "topology.kubernetes.io/zone"  # Prefer same zone
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: "app"                     # Do NOT schedule with app=backend pods
                    operator: "In"
                    values:
                      - "backend"
              topologyKey: "kubernetes.io/hostname"  # Must not be on same node
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 30                            # Low preference to avoid
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: "env"                   # Prefer to avoid pods in env=production
                      operator: "In"
                      values:
                        - "production"
                topologyKey: "topology.kubernetes.io/region"  # Prefer different region
    createApiPodServiceAccountAPI モニタリングポッドのサービスアカウントを作成するには、true を指定します。
    残りの値はデフォルトのままにすることも、要件に基づいて設定することもできます。シェパード URL、ログイン情報、場所、およびオプションのキーと値のペアの詳細については、「Web モニタリング PSA および API モニタリング PSA の設定」を参照してください。
    注: Kubernetes クラスタがロックダウンされていて、クラスタ全体の設定を行うことができない場合は、ポッドレベルの変更を行うことができます。

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

    agentDNSConfig:
    enabled: true
    dnsPolicy: "None"
    dnsConfig:
    nameservers: ["4.4.4.4"]
    searches: ["svc.cluster.local", "cluster.local"]
    複数のネームサーバーを追加する必要がある場合は、次の手順を実行します。
    1. values.yaml ファイルで dnsPolicy をNone」に設定します。
      agentDNSConfig:
      enabled: true
      dnsPolicy: "None"
      dnsConfig:
      nameservers: ["1.1.1.1", "2.2.2.2", "3.3.3.3"]
      searches: ["measurement.svc.cluster.local", "svc.cluster.local", "cluster.local"]
      nameservers で指定された最初のネームサーバーが cluster-default ネームサーバーであることを確認します。
    2. [Upstream coredns policy] を [sequential] に設定します。詳細については、Event Analytics を参照してください。
  7. 上記の設定を使用して Helm チャートを展開するには、すでにダウンロードした ファイルに移動し、次のように入力します。
    helm install heimdall-onprem sum-psa-heimdall.tgz --values values.yaml --namespace measurement
    すべての Kubernetes リソースがクラスタに作成され、Heimdall を使用できます。数秒後、Heimdall が初期化され、コントローラに表示されます。
  8. ポッドが実行されているかどうかを確認するには、次のように入力します。
    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

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

自動化スクリプトを使用した OpenShift での PSA の展開

前提条件

PSA インストールスクリプトを実行する前に、次の手順を実行します。

  • OpenShift クラスタを作成し、Kubeconfig でクラスタ を設定します。
  • イメージレジストリにログインします。
  • パッケージ v6.01 をダウンロードします。

以下の手順を実行して、PSA をインストールします。

  1. PSA インストール zip ファイルを解凍します。
  2. 以下のコマンドを実行して、PSA をインストールします。
    ./install_psa -e openshift -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> -w <heimdall_proxy_server>~<api_monitoring_proxy_server>~<web_monitoring_proxy_server> -C true -A <serviceaccount-name> -U <userID> -G <groupID> -N <run_as_a_non-root_user> -F <file_system_groupID> -O <override_the_security_context>
    サンプルのインストールコマンドを次に示します。
    ./install_psa -e openshift -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 2048k -w 127.0.0.1:8887~127.0.0.1:8888~127.0.0.1:8889 -C true -A serviceaccount-name -U 9001 -G 9001 -N true -F 9001 -O true
    次の表では、コマンドでのフラグの使用について説明します。説明のアスタリスク(*)は、必須パラメータを示しています。
    フラグ説明
    -e

    *環境

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

    -lMinkube 環境にイメージをロードします。
    -vデバッグモード
    -u

    *シェパード URL

    -a

    *EUM アカウント

    -k

    *EUM キー

    -c

    *ロケーションコード

    たとえば、デリーの場合は DEL、ニューヨークの場合は NY

    -d

    *ロケーションの説明

    たとえば、「Delhi, 100001

    -t

    *ロケーションの都市

    たとえば、Delhi

    -s

    *ロケーションの州

    たとえば、カリフォルニアの場合は CA

    -o

    *ロケーションの国

    たとえば、India、United States

    -i

    ロケーションの緯度

    たとえば、デリーの場合は 28.70

    -g

    ロケーションの経度

    たとえば、デリーの場合は 77.10

    -p

    *PSA リリースタグ

    たとえば、23.12

    -r*Heimdall レプリカ数
    -z

    *エージェントタイプ

    たとえば、web、api、または all

    -m

    *sum-chrome-agent の最小/最大メモリ(Mi/Gi 単位)
    -n*sum-api-monitoring-agent の最小/最大メモリ(Mi/Gi 単位)
    -x*sum-chrome-agent の最小/最大 CPU
    -y*sum-api-monitoring-agent の最小/最大 CPU
    -b*sum-heimdall の最小/最大メモリ(Mi/Gi 単位)
    -f*sum-heimdall の最小/最大 CPU
    -qtrue または false を指定して、Ignite Persistence を有効または無効にします。
    -j

    API モニタリングエージェントの入力および出力帯域幅に単一の値を指定します。OpenShift のデフォルト値は 1024k です。Splunk AppDynamics では、OpenShift 展開での値以上の値を維持することをお勧めします。

    -w

    Heimdall、API、および Web モニタリング用のプロキシ サーバーをチルダ(~)で区切って指定します。

    プロキシサーバーを設定する必要がない場合は、空白のままにすることができます。

    -CChrome ブラウザでのパフォーマンスログを有効にするには true を指定します。デフォルト値は false です。
    -A sum-chrome-agent および sum-api-monitoring-agent ポッドのサービスアカウントを指定します。
    -Usum-chrome-agent または sum-api-monitoring-agent コンテナを実行するユーザー ID を指定します。
    -Gsum-chrome-agent または sum-api-monitoring-agent コンテナを実行するグループ ID を指定します。
    -Nsum-chrome-agent または sum-api-monitoring-agent コンテナを非ルートユーザーとして実行するかどうかを指定します。デフォルト値は true です。
    -Fsum-chrome-agent または sum-api-monitoring-agent コンテナのファイルシステムグループ ID を指定します。
    -OWeb および API モニタリングのセキュリティコンテキストをオーバーライドするには、true を指定します。デフォルト値は false です。
  3. プロンプトが表示されたら、Docker レジストリ URL を指定します。

トラブルシューティング

ポッド構成に誤りがある場合、特定の問題が発生する可能性があります。以下の表に、問題と、それらを解決するための手順を示します。

問題解像度

SeccompProfile 構成による PodSecurity 違反。

警告メッセージ

warnings.go:70] would violate PodSecurity "restricted:v1.24": seccompProfile (pod or container "heimdall" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")

以下の手順を実行します。

  1. sum-psa-heimdall/templates/heimdall-deployment.yaml ファイルを開きます。
  2. heimdall コンテナの securityContext セクションを見つけます。
  3. seccompProfile.typeRuntimeDefault: に設定します。
    securityContext: seccompProfile: type: RuntimeDefault
  4. 変更を保存して、PSA を再展開します

runAsUser の値が許可された範囲から外れています。

警告メッセージ

runAsUser (1000) does not fall within the allowed range for any of the available Security Context Constraints (SCC) 

runAsUser の値を適切な範囲に変更します。

  1. sum-psa-heimdall/templates/heimdall-deployment.yaml ファイルを開きます。
  2. runAsUser フィールドを見つけます。
  3. runAsUser の値を <value> に変更します。
    securityContext:runAsUser: <value>
  4. 変更を保存し、更新済みの構成を適用します。
  5. 以下のコマンドを実行します:
    oc adm policy add-scc-to-user anyuid -z heimdall-serviceaccount -n measurement
    これにより、コンテナはルートを含む任意の UID を使用できます。詳細については、「セキュリティコンテキスト上の制約の管理」および「セキュリティコンテキスト上の制約について」を参照してください。

Kubernetes クラスタのモニタリング

ダウンロードした zip 内の Helm チャート sum-psa-monitoring.tgz により、モニタリングスタックがインストールされます。この Helm チャートは、Private Simple Synthetic Agent をモニタするためのカスタム Grafana ダッシュボードとともに kube-prometheus-stack をインストールします。

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

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

  1. 別のモニタリング名前空間を作成するには、以下のように入力します。
    kubectl create namespace monitoring
    設定オプションを確認するには、次のように入力します。
    helm show values sum-psa-monitoring.tgz > values-monitoring.yaml
    これにより、すべての設定オプションを含む values-monitoring ファイルが生成されます。Helm チャートのインストール中に生成された values-monitoring ファイルを変更して渡すには、次のように入力します。
    oc adm policy add-scc-to-group anyuid system:authenticated
    helm install psa-monitoring sum-psa-monitoring.tgz --values values-monitoring.yaml --namespace monitoring
  2. モニタリングスタックをインストールした後、(クラスタ内で実行される)Grafana を起動してダッシュボードを表示できます。クラスタ外から Grafana にアクセスするには、ポートフォワーディングを設定するか、Ingress を設定します。ローカルにアクセスするようにポートフォワーディングを設定するには、次のように入力します。
    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 をアンインストールするには、次のコマンドを実行します。

./uninstall_psa -e openshift -p

Red Hat OpenShift での 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.

  1. Create a Dockerfile and then create RUN directives to run pythonpip. For example, to install the library algorithms you 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
    Note: You can create any number of RUN directives to install the required libraries.
  2. To build the new image, run the following commands: Web Monitoring PSA:
    docker build -t sum-chrome-agent:<agent-tag> - < Dockerfile
    API Monitoring PSA:
    docker build -f Dockerfile-PSA-Openshift -t sum-api-monitoring-agent:<agent-tag> .
    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 buildx build -f Dockerfile-PSA-Openshift --platform=linux/amd64 -t sum-api-monitoring-agent:<api-tag> .
    The newly built agent image contains the required libraries.
Tag and Push Images to the Registry
Note: Managed Kubernetes services, such as EKS or AKS, provide container registries where you can push your image. No other configuration is needed. Kubernetes cluster within EKS or AKS will have access to these images.

You must tag and push the images to a registry for the cluster to access them. The Amazon EKS clusters pull the images from the Elastic Container Registry (ECR), which is the managed registry provided by AWS.

Since the Vanilla K8S runs on AWS infrastructure, Kubernetes Operations (kops) creates and assigns appropriate roles to the cluster nodes, and they can directly access the ECR. You do not need any other configuration. Hence, the process is the same for both EKS and Vanilla K8S using EC2.

To tag the images, enter:

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>

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

To push the images, enter:

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>

Update the Helm Chart

Follow these steps and update the configuration key-value pairs in the values.yaml file:

Upgrade the PSA

Note: From PSA 23.12 onwards, you must deploy Ignite and Heimdall in a single namespace named measurement.
  1. Navigate to the new Linux distribution folder and run the following command:
    helm install synth ignite-psa.tgz --values values-ignite.yaml --namespace measurement
  2. 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
  3. After the status of the new Heimdall and Ignite pods changes to running, uninstall the old Ignite namespace:
    helm uninstall synth -n ignite