You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Kubernetes Dashboard中使用标签筛选或选择Pod?

在Kubernetes Dashboard中用标签筛选Pod(对应kubectl标签选择器)

Awesome question! I’ve done this countless times, so let me break down exactly how to replicate that kubectl get pods -l environment=production,tier=frontend behavior in the Kubernetes Dashboard.

步骤1:进入Pod列表页面

First up, log into your Kubernetes Dashboard. On the left-hand navigation menu, find and click Pods (it’s usually nested under the Workloads section) to pull up the full list of your cluster’s Pods.

步骤2:执行标签筛选(两种方式可选)

At the top of the Pod list page, you’ll see a search/filter bar with a magnifying glass icon. Here are two ways to get the exact filter you want:

方式一:直接用kubectl风格的标签语法

Just type the same label selector you use in kubectl directly into the filter bar:

environment=production,tier=frontend

Hit enter, and the page will instantly filter to show only Pods that have both the environment=production and tier=frontend labels—exactly matching your kubectl command’s output.

方式二:可视化筛选器(更适合新手)

If you prefer clicking over typing, use the Dashboard’s built-in visual filter tool:

  • Click the Add filter button (looks like a plus sign) next to the search bar
  • From the dropdown, select Label as the filter type
  • In the first input field, enter environment; in the second, enter production, then click "Add"
  • Repeat the process: add another label filter for tier equals frontend
  • The list will automatically update to show only Pods that meet both label criteria

Bonus: Advanced label filtering

You can also use more complex kubectl-compatible selector syntax in the filter bar if you need it:

  • Filter Pods with environment set to either production or staging: environment in (production,staging)
  • Show all Pods that have a tier label (any value): tier
  • Exclude Pods with an environment label: !environment

内容的提问来源于stack exchange,提问作者wesnica

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:33:22