首页 > 解决方案 > 如何确定 AKS 是否使用新的 Azure Monitor 代理?

问题描述

我已将 AKS 群集载入 Azure Monitor。即分配一个 Log Analytics 工作区。

这个入职过程在我的集群中创建了名为 omsagent-xxxx 的 pod。吊舱使用图像:mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod08052021

从 Log Analytics 工作区中,我可以查询从集群中生成的日志和指标。我假设日志和指标是由新创建的 omsagent pod 发送到那里的。

根据https://azure.microsoft.com/en-us/updates/were-retiring-the-log-analytics-agent-in-azure-monitor-on-31-august-2024/,“日志分析代理”将被新的“Azure Monitor Agent”取代。

根据https://docs.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-manage-agent#how-to-upgrade-the-container-insights-agent,代理将自动升级:

“发布新版本的代理时,代理会在托管在 Azure Kubernetes 服务 (AKS) 上的托管 Kubernetes 集群上自动升级......”

如何确定我的集群使用的是 Log Analytics 代理还是新的 Azure Monitor 代理?

标签: azurekubernetesanalyticsmonitoragent

解决方案


  1. 在AKS 发行说明中查看 omsagent ciprod10132021 的最新可用版本。

  2. 使用以下命令获取当前运行的 oms 版本:

     → kubectl get deployments -n kube-system -o wide
      → kubectl get ds omsagent --namespace=kube-system -o wide
       → kubectl get pods -n kube-system --selector=component=oms-agent -o jsonpath="{.items[*].spec.containers[*].image}" |tr -s '[[:space:]]' '\n' |sort |uniq –c
       → kubectl get pods -n kube-system --selector=component=oms-agent-win -o jsonpath="{.items[*].spec.containers[*].image}" |tr -s '[[:space:]]' '\n' |sort |uniq -c
    

推荐阅读