AWS announces preview of AWS Interconnect - multicloud
AWS announces AWS Interconnect – multicloud (preview), providing simple, resilient, high-speed private connections to other cloud service providers. AWS Interconnect - multicloud is easy to configure and provides high-speed, resilient connectivity with dedicated bandwidth, enabling customers to interconnect AWS networking services such as AWS Transit Gateway, AWS Cloud WAN, and Amazon VPC to other cloud service providers with ease.
如何對 Amazon EKS 叢集的 Container Insights 問題進行疑難排解?
我在為 Amazon Elastic Kubernetes Service (Amazon EKS) 叢集設定 Amazon CloudWatch Container Insights 時遇到問題。
解決方法
**注意:**如果您在執行 AWS Command Line Interface (AWS CLI) 命令時收到錯誤訊息,請參閱對 AWS CLI 錯誤進行疑難排解。此外,請確定您使用的是最新的 AWS CLI 版本。
請檢查您的 Container Insights 安裝
若要檢查您是否在 Amazon EKS 叢集上正確安裝了 Container Insights,請執行下列命令:
kubectl get pods -n amazon-cloudwatch
然後,為您的 Pod 執行以下命令:
kubectl describe pod pod-name -n amazon-cloudwatch
**注意:**將 pod-name 替換為 pod 名稱。
檢查命令輸出的 Events (事件) 區段。
若要檢查您的 CloudWatch 日誌,請執行以下命令:
kubectl logs pod-name -n amazon-cloudwatch
將 CloudWatch Observability 安裝為 Amazon EKS 受管附加元件
使用 Amazon EKS 附加元件安裝具有增強 Amazon EKS 可觀測性的 Container Insights。
**注意:**您可以在只執行 Kubernetes 1.23 或更新版本的 Amazon EKS 叢集上,使用 CloudWatch Observability EKS 附加元件。
若要將 CloudWatch Observability 安裝為自我管理的附加元件,請完成下列步驟:
-
若要安裝 cert-manager,請執行以下命令:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml -
若要安裝自訂資源定義 (CRD),請執行下列命令:
curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/main/k8s-quickstart/cwagent-custom-resource-definitions.yaml | kubectl apply --server-side -f - -
若要安裝 CloudWatch 容器代理程式運算子,請執行下列命令:
ClusterName=my-cluster-name RegionName=my-cluster-region curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/main/k8s-quickstart/cwagent-operator-rendered.yaml | sed 's/{{cluster_name}}/'${ClusterName}'/g;s/{{region_name}}/'${RegionName}'/g' | kubectl apply -f -
對 AWS 管理主控台中未顯示指標的問題進行疑難排解
如果您在 AWS 管理主控台上看不到 Container Insights 指標,請確認您已完成 Container Insights 設定。
對 Container Insights 錯誤進行疑難排解
未經授權危急錯誤: 無法從 kubelet 擷取 cadvisor 資料
若要解決此問題,請確定在 kubelet 中啟用 Webhook 授權模式。
無效端點錯誤
錯誤訊息範例:
「日誌」: 「2020-04-02T08:36:16Z E!cloudwatchlogs:代碼: InvalidEndpointURL,訊息:無效端點 uri,原始錯誤:&url.Error{Op:\"parse\", 網址:\"https://logs.{{region_name}}.amazonaws.com/\", Err:\"{\point"}, &}}.amazonaws.com/\", Err:\"{\URm"}, & &serr."}, &serr." ", errs:[]error{(*url.Error)(0xc0008723c0)}}\n」,
若要解決此問題,請確定您已取代命令中的所有預留位置值。例如,請確認在執行 AWS CLI 時,您用於 cluster-name 和 region-name 的資訊對於部署來說是正確的。
叢集升級後,Amazon EKS 或 Kubernetes 上缺少 Pod 指標
錯誤訊息範例:
「W! 未收集到任何 Pod 指標」
如果升級叢集後缺少 Pod 指標,請檢查節點上的容器執行時期是否正常運作。
若要解決此問題,請更新部署資訊清單,以將 containerd 通訊端從主機掛載到容器中。
部署資訊清單範例:
apiVersion: apps/v1 kind: DaemonSet metadata: name: cloudwatch-agent namespace: amazon-cloudwatch spec: template: spec: containers: - name: cloudwatch-agent # ... # Don't change the mountPath volumeMounts: # ... - name: dockersock mountPath: /var/run/docker.sock readOnly: true - name: varlibdocker mountPath: /var/lib/docker readOnly: true - name: containerdsock # NEW mount mountPath: /run/containerd/containerd.sock readOnly: true # ... volumes: # ... - name: dockersock hostPath: path: /var/run/docker.sock - name: varlibdocker hostPath: path: /var/lib/docker - name: containerdsock # NEW volume hostPath: path: /run/containerd/containerd.sock
如需資訊清單的完整範例,請參閱 GitHub 網站上的 cwagent-daemonset.yaml。
使用 Bottlerocket for Amazon EKS 時,沒有 Pod 指標
錯誤訊息範例:
「W! 未收集到任何 Pod 指標」
Bottlerocket 在主機上使用不同的 containerd 路徑。如果您使用 Bottlerocket,則必須將所有磁碟區變更為 Bottlerocket 容器路徑位置。
命令範例:
volumes: # ... - name: containerdsock hostPath: # path: /run/containerd/containerd.sock # bottlerocket does not mount containerd sock at normal place # https://github.com/bottlerocket-os/bottlerocket/commit/91810c85b83ff4c3660b496e243ef8b55df0973b path: /run/dockershim.sock
收集 Prometheus 指標時,CloudWatch 代理程式的日誌量意外增加
若要解決此問題,請將 CloudWatch 代理程式更新至最新可用版本。若要尋找目前的版本,請參閱尋找有關 CloudWatch 代理程式版本的資訊。若要安裝最新版本,請參閱安裝 CloudWatch 代理程式。
CloudWatch 代理程式上的 CrashLoopBackoff 錯誤
若要解決此問題,請確定您正確設定了 AWS Identity and Access Management (IAM) 權限。
CloudWatch 代理程式或 Fluentd Pod 卡在擱置中狀態
您的 Pod 可能卡在擱置中狀態。或者,您從 CloudWatch 代理程式或 Fluentd Pod 收到 FailedScheduling 錯誤。若要解決此問題,請根據代理程式所需的程式碼數量和 RAM,確認您的節點具有足夠的運算資源。
若要描述 Pod,請執行以下命令:
kubectl describe pod cloudwatch-agent-85ppg -n amazon-cloudwatch
Fluent Bit 的 Configmap 未正確部署
若要解決此問題,請確認您在 amazon-cloudwatch 命名空間中正確部署了 fluent-bit-config 設定對應。
錯誤訊息範例:
[2024/10/02 11:16:42] [error] [config] inconsistent use of tab and space [2024/10/02 11:16:42] [error] [config] error in /fluent-bit/etc/..2024_10_02_11_16_29.3759745087//application-log.conf:62: invalid indentation level [2024/10/02 11:16:42] [error] configuration file contains errors, aborting.cwagent-daemonset.yaml
- 語言
- 中文 (繁體)

相關內容
- 已提問 1 年前
- 已提問 1 年前
- 已提問 2 年前
AWS 官方已更新 3 個月前