

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 儀表板設定
<a name="sagemaker-hyperpod-eks-operate-console-ui-governance-setup-dashboard"></a>

使用以下資訊來開始使用 Amazon SageMaker HyperPod Amazon CloudWatch 可觀測性 EKS 附加元件。這讓您開始使用詳細的視覺化儀表板，檢視 EKS 叢集硬體、團隊配置和任務的指標。

如果您在設定時遇到問題，請參閱 [疑難排解](sagemaker-hyperpod-eks-operate-console-ui-governance-troubleshoot.md) 以取得已知的故障診斷解決方案。

**Topics**
+ [HyperPod Amazon CloudWatch 可觀測性 EKS 附加元件先決條件](#hp-eks-dashboard-prerequisites)
+ [HyperPod Amazon CloudWatch 可觀測性 EKS 附加元件設定](#hp-eks-dashboard-setup)

## HyperPod Amazon CloudWatch 可觀測性 EKS 附加元件先決條件
<a name="hp-eks-dashboard-prerequisites"></a>

下節包含安裝 Amazon EKS 可觀測性附加元件之前所需的先決條件。
+ 確保您在 [叢集管理員的 IAM 使用者](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin) 中具有 HyperPod 叢集管理員的最低許可政策。
+ 將 `CloudWatchAgentServerPolicy` IAM 政策連接至您的工作節點。若要執行此作業，請輸入以下命令。將 `my-worker-node-role` 取代為 Kubernetes 工作節點使用的 IAM 角色。

  ```
  aws iam attach-role-policy \
  --role-name my-worker-node-role \
  --policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy
  ```

## HyperPod Amazon CloudWatch 可觀測性 EKS 附加元件設定
<a name="hp-eks-dashboard-setup"></a>

使用下列選項來設定 Amazon SageMaker HyperPod Amazon CloudWatch 可觀測性 EKS 附加元件。

------
#### [ Setup using the SageMaker AI console ]

設定和視覺化 HyperPod 任務治理儀表板需要下列許可。本節擴充了[叢集管理員的 IAM 使用者](sagemaker-hyperpod-prerequisites-iam.md#sagemaker-hyperpod-prerequisites-iam-cluster-admin)中列出的許可。

若要管理任務治理，請使用範例政策：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sagemaker:ListClusters",
                "sagemaker:DescribeCluster",
                "sagemaker:ListComputeQuotas",
                "sagemaker:CreateComputeQuota",
                "sagemaker:UpdateComputeQuota",
                "sagemaker:DescribeComputeQuota",
                "sagemaker:DeleteComputeQuota",
                "sagemaker:ListClusterSchedulerConfigs",
                "sagemaker:DescribeClusterSchedulerConfig",
                "sagemaker:CreateClusterSchedulerConfig",
                "sagemaker:UpdateClusterSchedulerConfig",
                "sagemaker:DeleteClusterSchedulerConfig",
                "eks:ListAddons",
                "eks:CreateAddon",
                "eks:DescribeAddon",
                "eks:DescribeCluster",
                "eks:DescribeAccessEntry",
                "eks:ListAssociatedAccessPolicies",
                "eks:AssociateAccessPolicy",
                "eks:DisassociateAccessPolicy"
            ],
            "Resource": "*"
        }
    ]
}
```

------

若要授予許可來管理 Amazon CloudWatch 可觀測性 Amazon EKS，並透過 SageMaker AI 主控台檢視 HyperPod 叢集儀表板，請使用下列範例政策：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "eks:ListAddons",
                "eks:CreateAddon",
                "eks:UpdateAddon",
                "eks:DescribeAddon",
                "eks:DescribeAddonVersions",
                "sagemaker:DescribeCluster",
                "sagemaker:DescribeClusterNode",
                "sagemaker:ListClusterNodes",
                "sagemaker:ListClusters",
                "sagemaker:ListComputeQuotas",
                "sagemaker:DescribeComputeQuota",
                "sagemaker:ListClusterSchedulerConfigs",
                "sagemaker:DescribeClusterSchedulerConfig",
                "eks:DescribeCluster",
                "cloudwatch:GetMetricData",
                "eks:AccessKubernetesApi"
            ],
            "Resource": "*"
        }
    ]
}
```

------

導覽至 SageMaker HyperPod 主控台中的**儀表板**索引標籤，以安裝 Amazon CloudWatch 可觀測性 EKS。若要確保任務治理相關指標包含在**儀表板**中，請啟用 Kueue 指標核取方塊。啟用 Kueue 指標可在達到免費層限制之後啟用 CloudWatch **指標**成本。如需詳細資訊，請參閱 [Amazon CloudWatch 定價](https://aws.amazon.com/cloudwatch/pricing/)中的**指標**。

------
#### [ Setup using the EKS AWS CLI ]

使用下列 EKS AWS CLI 命令來安裝附加元件：

```
aws eks create-addon --cluster-name cluster-name 
--addon-name amazon-cloudwatch-observability 
--configuration-values "configuration json"
```

以下是組態值的 JSON 範例：

```
{
    "agent": {
        "config": {
            "logs": {
                "metrics_collected": {
                    "kubernetes": {
                        "kueue_container_insights": true,
                        "enhanced_container_insights": true
                    },
                    "application_signals": { }
                }
            },
            "traces": {
                "traces_collected": {
                    "application_signals": { }
                }
            }
        },
    },
}
```

------
#### [ Setup using the EKS Console UI ]

1. 導覽至 [EKS 主控台](https://console.aws.amazon.com/eks/home#/clusters)。

1. 選擇您的叢集。

1. 選擇**附加元件**。

1. 尋找 **Amazon CloudWatch 可觀測性**附加元件並安裝。為附加元件安裝版本 >= 2.4.0。

1. 包括下列 JSON 組態值：

   ```
   {
       "agent": {
           "config": {
               "logs": {
                   "metrics_collected": {
                       "kubernetes": {
                           "kueue_container_insights": true,
                           "enhanced_container_insights": true
                       },
                       "application_signals": { }
                   },
               },
               "traces": {
                   "traces_collected": {
                       "application_signals": { }
                   }
               }
           },
       },
   }
   ```

------

一旦成功安裝了 EKS 可觀測性附加元件，您就可以在 HyperPod 主控台**儀表板**索引標籤下檢視 EKS 叢集指標。