Kubernetes CLI を使用したインフラストラクチャの可視性のインストール

このページでは、クラスタ エージェント オペレータがインストールされている Kubernetes クラスタにマシンエージェントとネットワークエージェントをインストールする方法について説明します。

クラスタ エージェント オペレータは、InfraViz というカスタムリソース定義を提供します。InfraViz を使用すると、マシンエージェントとネットワークエージェントを daemonset として Kubernetes クラスタに簡単に展開できます。さらに、クラスタ エージェント オペレータを必要としない daemonset YAML を作成することで、これらのエージェントを展開できます。詳細については、これらの例を参照してください。

分析エージェントを Kubernetes クラスタ内の daemonset として展開するには、「 Kubernetes でのエージェント側コンポーネントのインストール」を参照してください。

注: この展開では、Windows コンテナはサポートされていません。

要件

開始する前に、次のことを確認します。

  • kubectl 1.16 以上がインストールされていること
  • クラスタエージェント 21.3.1 以上
  • クラスターエージェントの要件およびサポート対象環境」に記載されている要件が満たされていること
  • サーバの可視性が必要な場合は、クラスタ内のワーカーノードの数に基づいて十分なサーバの可視性ライセンスがあること
  • Splunk AppDynamics コントローラでサーバーを表示する権限

設置手順

  1. クラスターエージェントをインストールします。Scratch Linux の例は、次のようになります。
    1. クラスタ エージェント バンドルをダウンロードします。
    2. クラスタ エージェント バンドルを解凍します。
    3. 適切な Kubernetes および OpenShift バージョンを指定する CLI を使用してクラスター エージェント オペレータを展開します(該当する場合)。
      CODE
      unzip appdynamics-cluster-agent-scratch-linux-<version>.zip
      kubectl create namespace appdynamics
      Kubernetes 1.16 以上
      CODE
      kubectl create -f cluster-agent-operator.yaml
      OpenShift と Kubernetes 1.16 以上
      CODE
      kubectl create -f cluster-agent-operator-openshift.yaml
      OpenShift と Kubernetes 1.15 以下
      CODE
      kubectl create -f cluster-agent-operator-openshift-1.15-or-less.yaml
      注: OpenShift クラスタの OpenShift OperatorHub からクラスタ エージェント オペレータをインストールすることもできます。
  2. コントローラに接続するマシン エージェント アクセス キーを使用して、クラスタ エージェント シークレットを作成します。cluster-agent-secret が存在しない場合は、作成する必要があります。「Kubernetes CLI を使用したクラスターエージェントのインストール」を参照してください。
    CODE
    kubectl -n appdynamics create secret generic cluster-agent-secret --from-literal=controller-key=<access-key>
  3. (オプション)キーストアのログイン情報を使用して、インフラストラクチャの可視性のシークレットを作成します。
    1. 次のコマンドを実行して、custom-ssl.pem ファイルから CA 証明書をインポートします。
      PYTHON
      keytool -import -alias rootCA -file custom-ssl.pem -keystore cacerts.jks -storepass <your-password>
    2. キーストア ファイル シークレットを作成します。
      CODE
      kubectl -n appdynamics create secret generic <cacertinfraviz> --from-file=cacerts.jks
    3. キーストア パスワード シークレットの作成
      CODE
      kubectl -n appdynamics create secret generic <kspassinfraviz> --from-literal=keystore-password="<your-password>"
      ここで、cacertinfraviz はキーストアのファイル名、kspassinfraviz はインフラストラクチャの可視性のキーストアパスワードです。
      注: ここで指定するキーストアファイルとパスワードは、カスタム SSL 構成を適用するために infraviz.yaml ファイルに含める必要があります。次に例を示します。
      CODE
      keyStoreFileSecret: cacertinfraviz
      keystorePasswordSecret: kspassinfraviz
  4. infraviz.yaml ファイルを更新して、コントローラの [ライセンス(License)] ページの情報に基づいて controllerUrlおよび account の値を設定します。サーバーの可視性を有効にするには、 enableServerViztrue に設定します( infraviz.yaml の設定例に示します)。マシンサーバーの可視性が有効になっていないエージェントで、 enableServerVizfalseに設定します。

    サーバーの可視性が有効になっている infraviz.yaml 構成ファイル

    CODE
    apiVersion: v1
    kind: ServiceAccount
    metadata:
    name: appdynamics-infraviz
    namespace: appdynamics
    ---
    apiVersion: cluster.appdynamics.com/v1alpha1
    kind: InfraViz
    metadata:
    name: appdynamics-infraviz
    namespace: appdynamics
    spec:
    controllerUrl: "https://mycontroller.saas.appdynamics.com"
    image: "docker.io/appdynamics/machine-agent:latest"
    account: "<your-account-name>"
    globalAccount: "<your-global-account-name>"
    enableContainerHostId: true
    enableServerViz: true
    resources:
    limits:
    cpu: 500m
    memory: "1G"
    requests:
    cpu: 200m
    memory: "800M"

    infraviz.yaml 構成ファイルの例では、クラスター内のノードごとに単一のポッドを実行する daemonset を展開します。各ポッドは、マシンエージェント、またはサーバの可視性エージェントが実行される単一のコンテナを実行します。

  5. ネットワークの可視性エージェントを同じポッド内の 2 番目のコンテナで実行できるようにするには、次の構成ファイルの例に示すように、netVizImagenetVizPort のキーと値を追加します。

    単一ポッド内の 2 番目のコンテナが含まれた infraviz.yaml 構成ファイル

    CODE
    apiVersion: v1
    kind: ServiceAccount
    metadata:
    name: appdynamics-infraviz
    namespace: appdynamics
    ---
    apiVersion: cluster.appdynamics.com/v1alpha1
    kind: InfraViz
    metadata:
    name: appdynamics-infraviz
    namespace: appdynamics
    spec:
    controllerUrl: "https://mycontroller.saas.appdynamics.com"
    image: "docker.io/appdynamics/machine-agent:latest"
    account: "<your-account-name>"
    enableContainerHostId: true
    enableServerViz: true
    netVizImage: appdynamics/machine-agent-netviz:latest
    netVizPort: 3892
    resources:
    limits:
    cpu: 500m
    memory: "1G"
    requests:
    cpu: 200m
    memory: "800M"
  6. kubectl を使用して infraviz.yaml を展開します。
    注:
    • Kubernetes が 1.25 以降の環境では、PodSecurityPolicy は Kubernetes 1.25 以降から削除されます(https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes)。ポッドのセキュリティ制限は、ポッドセキュリティ標準レベルを使用して名前空間レベル(https://kubernetes.io/docs/concepts/security/pod-security-admission/)で適用されるようになりました。そのため、インフラストラクチャの可視性ポッドが実行されている名前空間については、レベルを [Privileged] として設定する必要があります。
    • Kubernetes のバージョンが 1.25 よりも前で、PodSecurityPolicies が特権ポッドなど、特定のポッド セキュリティ コンテキスト設定をブロックする環境では、infraviz.yaml ファイルを編集する前に infraviz-pod-security-policy.yaml を展開する必要があります。PodSecurityPolicy を appdynamics-infraviz サービスアカウントに明示的にアタッチする必要があります。
    • OpenShift SecurityContextConstraints が特権ポッドなど、特定のポッド セキュリティ コンテキスト設定をブロックする環境では、infraviz.yaml ファイルを編集する前に infraviz-security-context-constraint-openshift.yaml を展開する必要があります。
    Kubernetes
    CODE
    kubectl create -f infraviz.yaml
    ポッドセキュリティポリシーを使用した Kubernetes(1.25 より前のバージョン)
    CODE
    kubectl create -f infraviz-pod-security-policy.yaml
    kubectl create -f infraviz.yaml
    ポッド セキュリティ アドミッションを使用した Kubernetes(1.25 以降のバージョン)
    1. インフラストラクチャの可視性がインストールされている名前空間に次の Kubernetes ラベルを指定します。

      • pod-security.kubernetes.io/<MODE>: <LEVEL>(必須)

      • pod-security.kubernetes.io/<MODE>-version: <VERSION>(オプション)詳細については、https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-namespace-labels/ を参照してください。

        sample-namespace.yaml
        CODE
        apiVersion: v1
        kind: Namespace
        metadata:
        name: appdynamics
        labels:
        pod-security.kubernetes.io/enforce: privileged
        pod-security.kubernetes.io/enforce-version: v1.27
        pod-security.kubernetes.io/audit: privileged
        pod-security.kubernetes.io/audit-version: v1.27
        pod-security.kubernetes.io/warn: privileged
        pod-security.kubernetes.io/warn-version: v1.27
    2. 以下のコマンドを実行します:

      CODE
      kubectl create -f infraviz.yaml
    OpenShift
    CODE
    kubectl create -f infraviz-security-context-constraint-openshift.yaml
    kubectl create -f infraviz.yaml
  7. appdynamics-infraviz ポッドが実行中で、マシンエージェント、サーバーの可視性エージェント、およびネットワークエージェントのコンテナの準備が完了していることを確認します。
    CODE
    kubectl -n appdynamics get pods
    NAME                                    READY   STATUS    RESTARTS   AGE
    appdynamics-infraviz-shkhj                     2/2     Running   0          18s
  8. エージェントがコントローラに登録されていることを確認するには、ログを確認し、エージェントがコントローラ管理 UI の Agents Dashboard に表示されることを確認します。コントローラでサーバーの可視性が有効になっている場合、ノードは Controller > Servers の下に表示されます。
    CODE
    kubectl -n appdynamics logs appdynamics-infraviz-shkhj -c appd-infra-agent
    ...
    Started Machine Agent Successfully

InfraVizConfiguration Settings

To configure Infrastructure Visibility, you can modify these parameters in the infraviz.yaml file included with the download package. After changing the file, delete and re-create the InfraViz deployment to ensure the changes are applied.

Parameter Description Required/Optional Default
account

Splunk AppDynamics account name

Required N/A
appName Name of the cluster displayed on the Controller UI as your cluster name. This configuration groups the nodes of the cluster based on the master , worker , infra , worker-infra roles and displays them on the Metric Browser. Optional N/A
args List of command arguments Optional N/A
controllerUrl

URL of the Splunk AppDynamics Controller

Required N/A
enableContainerd

Enable containerd visibility on Machine Agent. Specify either true false

Optional false
enableContainerHostId Flag that determines how container names are derived; specify either true or false . Required true
enableMasters By default, only Worker nodes are monitored. When set to true , Server Visibility is provided for Master nodes. For managed Kubernetes providers, the flag has no effect because the Master plane is not accessible. Optional false
enableServerViz Enable Server Visibility Required false
enableDockerViz Enable Docker Visibility Required false
env List environment variables Optional N/A
eventServiceUrl Event Service Endpoint Optional N/A
globalAccount Global account name Optional N/A
image Retrieves the most recent version of the Machine Agent image. Optional appdynamics/machine-agent:latest
imagePullPolicy The image pull policy for the InfraViz pod. Optional

imagePullPolicy: Always

imagePullSecret Name of the pull secret image Optional N/A
logLevel Level of logging verbosity. Valid options are: info or debug . Optional info
metricsLimit Maximum number of metrics that the Machine Agent sends to the Controller. Optional N/A
netVizImage Retrieves the most recent version of Network Agent image. Optional appdynamics/machine-agent-netviz:latest
netVizPort When > 0, the Network Agent is deployed in a sidecar with the Machine Agent. By default, the Network Visibility Agent works with port 3892 . Optional 3892
netVizSecurityContext

You can include the following parameters under securityContext:

runAsGroup: If you configured the application container as a non-root user, provide the groupId of the corresponding group.

This sets the appropriate file permission on the agent artifacts.

This value is applied to all the instrumented resources.

Add this parameter, if you require to override the default value of runAsGroupthat is configured for default instrumentation, or if you require a specific value for the resources that satisfy this rule.

Optional N/A

runAsUser: If you configured the application container as a non-root user, it provides the userId of the corresponding user.

This sets the appropriate file permission on the agent artifacts.

This value is applied to all the instrumented resources.

Add this parameter, if you require to override the default value of runAsUserthat is configured for default instrumentation, or if you require a specific value for the resources that satisfy this rule.

Optional N/A

allowPrivilegeEscalation: To control if a process can get more privileges than its parent process. The value is true when the container runs as:

  • Privileged container
  • CAP_SYS_ADMIN

If you do not set this parameter, the helm uses the default value as true.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A

capabilities: To add or remove POSIX capabilities from the running containers. This uses the default set of capabilities during container runtime.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional

["NET_ADMIN","NET_RAW"]

注: The default values are not overridden by the specified values. When you specify a value for capabilities, the value is considered along with the default values.

privileged: To run container in privileged mode, which is equivalent to root on the host.

If you do not set this parameter, the helm uses the default value as true.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A

procMount: The type of proc mount to use for the containers.

注: This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A

readOnlyRootFilesystem: To specify if this container has a read-only root filesystem.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A

runAsNonRoot: To specify if the container must run as a non-root user.

If the value is true, the Kubelet validates the image at runtime to ensure that the container fails to start when run as root. If this parameter is not specified or if the value is false, there is no validation.

注: This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A

seLinuxOptions: To apply the SELinux context to the container. If this parameter is not specified, the container runtime allocates a random SELinux context for each container.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A

seccompProfile: To specify the seccomp options used by the container. If seccomp options are specified at both the pod and container level, the container options override the pod options.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A

windowsOptions: To specify Windows-specific options for every container.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional N/A
nodeSelector OS specific label that identifies nodes for scheduling of the daemonset pods. Optional linux

overrideVolumeMounts

The list of volumeMounts. Optional

overrideVolumeMounts:

- proc - sys - etc

priorityClassName

Name of the priority class that determines priority when a pod needs to be evicted. Optional N/A
propertyBag String with any other Machine Agent parameters Optional N/A
proxyUrl URL of the proxy server (protocol://domain:port) Optional N/A
proxyUser Proxy user credentials (user@password) Optional N/A
resources Definitions of resources and limits for the Machine Agent

Optional

N/A
resourcesNetViz Set resources for the Network Visibility (NetViz) container Optional

Request

  • CPU: 100m
  • Memory: 150Mi

Limit

  • CPU: 200m
  • Memory: 300Mi
runAsUser

The UID (User ID) to run the entry point of the container process. If you do not specify the UID, this defaults to the user id specified in the image.

docker.io/appdynamics/machine-agent

docker.io/appdynamics/machine-agent-analytics:latest

If you require to run on any other UID, change the UID for runAsUser without changing the group ID.

注: This parameter is deprecated. We recommend that you use the runAsUser child parameter under the securityContext parameter.
Optional

UID: 1001

Username: appdynamics

s

runAsGroup The GID (Group ID) to run the entry point of the container process. If you do not specify the ID, this uses the UID specified in the image,

docker.io/appdynamics/machine-agent

docker.io/appdynamics/machine-agent-analytics:latest

注: This parameter is deprecated. We recommend that you use the runAsGroup child parameter under the securityContext parameter.
Optional GID: 1001 Username: appdynamics

securityContext

注:
注:

For OpenShift version > 4.14, ensure that all the child parameters within securityContext are specified based on the permissible values outlined by the security context constraints (SCCs). See Managing Security Context Constraints in the Red Hat OpenShift documentation.

If you want to use RunAsUser property, then user ID (UID) should be in the permissible range. For example, if the SCCs permissible range for UID is 1010010000 to 1010019999, then the RunAsUser value must fall within this range. The same applies to other security context parameters. You can include the following parameters under securityContext:

runAsGroup: If you configured the application container as a non-root user, provide the groupId of the corresponding group.

This sets the appropriate file permission on the agent artifacts.

This value is applied to all the instrumented resources.

Add this parameter, if you require to override the default value of runAsGroupthat is configured for default instrumentation, or if you require a specific value for the resources that satisfy this rule.

You can include the following parameters under securityContext:

runAsGroup: If you configured the application container as a non-root user, provide the groupId of the corresponding group.

This sets the appropriate file permission on the agent artifacts.

This value is applied to all the instrumented resources.

Add this parameter, if you require to override the default value of runAsGroupthat is configured for default instrumentation, or if you require a specific value for the resources that satisfy this rule.

Optional NA

runAsUser: If you configured the application container as a non-root user, it provides the userId of the corresponding user.

This sets the appropriate file permission on the agent artifacts.

This value is applied to all the instrumented resources.

Add this parameter, if you require to override the default value of runAsUserthat is configured for default instrumentation, or if you require a specific value for the resources that satisfy this rule.

Optional NA

allowPrivilegeEscalation: To control if a process can get more privileges than its parent process. The value is true when the container runs as:

  • Privileged container
  • CAP_SYS_ADMIN

If you do not set this parameter, the helm uses the default value as true.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional true

capabilities: To add or remove POSIX capabilities from the running containers. This uses the default set of capabilities during container runtime.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional NA

privileged: To run container in privileged mode, which is equivalent to root on the host.

If you do not set this parameter, the helm uses the default value as true.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional true

procMount: The type of proc mount to use for the containers.

注: This parameter is currently available for Deployment and DeploymentConfig mode.
Optional NA

readOnlyRootFilesystem: To specify if this container has a read-only root filesystem.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional NA

runAsNonRoot: To specify if the container must run as a non-root user.

If the value is true, the Kubelet validates the image at runtime to ensure that the container fails to start when run as root. If this parameter is not specified or if the value is false, there is no validation.

注: This parameter is currently available for Deployment and DeploymentConfig mode.
Optional NA

seLinuxOptions: To apply the SELinux context to the container. If this parameter is not specified, the container runtime allocates a random SELinux context for each container.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional NA

seccompProfile: To specify the seccomp options used by the container. If seccomp options are specified at both the pod and container level, the container options override the pod options.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional NA

windowsOptions: To specify Windows-specific options for every container.

注:
  • This parameter is unavailable when spec.os.name is Windows.
  • This parameter is currently available for Deployment and DeploymentConfig mode.
Optional NA
stdoutLogging Determines if logs are saved to a file or redirected to the Console. Optional false
tolerations List of tolerations based on the taints that are associated with nodes. Optional N/A
uniqueHostId

Unique host ID in Splunk AppDynamics. Valid options are: spec.nodeName status.hostIP

Optional spec.nodeName
˚