Auto-sync Quartz output: 2026-04-29 00:05
This commit is contained in:
72
wiki/concepts/Kubernetes-Tagging.md
Normal file
72
wiki/concepts/Kubernetes-Tagging.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: "Kubernetes Tagging"
|
||||
type: concept
|
||||
tags:
|
||||
- Kubernetes
|
||||
- Tagging-Standard
|
||||
- Cloud-Governance
|
||||
- OpenText
|
||||
sources:
|
||||
- public-cloud-learning-sessions-opentext-tagging-standard-v2-20250429-170111-meeting-rec
|
||||
last_updated: 2026-04-29
|
||||
---
|
||||
|
||||
# Kubernetes Tagging
|
||||
|
||||
Kubernetes 标签标准是 OpenText 云标签标准 V2 版本的新增组成部分,定义了 Kubernetes 对象(Namespace、Pod、Deployment、Service、ConfigMap 等)上必须使用的标准标签键值对。与云资源标签类似,K8s 标签为 FinOps 成本分摊、安全策略和资源组织提供了统一的基础。
|
||||
|
||||
## Definition
|
||||
|
||||
Kubernetes 标签(Labels)是附加在 K8s 对象上的键值对元数据,用于组织、选择和管理 Kubernetes 集群中的资源。OpenText V2 标准通过 `app.opentext.com` 前缀区分其专属标签,与标准 K8s 标签系统(前缀 `kubernetes.io/`)和自定义标签(前缀 `k8s.io/`)形成语义隔离。
|
||||
|
||||
## OpenText V2 标准标签
|
||||
|
||||
### 核心标签键
|
||||
|
||||
| 标签键 | 说明 | 示例值 |
|
||||
|--------|------|--------|
|
||||
| `app.opentext.com/product` | 产品名称 | `idm`, `operations` |
|
||||
| `app.opentext.com/customer` | 客户名称 | `customer-a` |
|
||||
| `app.opentext.com/environment` | 环境 | `prod`, `dev`, `uat` |
|
||||
| `app.opentext.com/part-of` | K8s 对象归属(原生 K8s) | `deployment-name` |
|
||||
| `app.opentext.com/name` | 对象名称 | `my-service` |
|
||||
| `app.opentext.com/version` | 版本 | `v1.2.3` |
|
||||
|
||||
### 与云标签的对应关系
|
||||
|
||||
K8s 标签与云资源标签在语义上保持一致:
|
||||
|
||||
| K8s 标签 | 对应云标签 | 说明 |
|
||||
|----------|-----------|------|
|
||||
| `app.opentext.com/environment` | `OT_environment` | 环境维度统一 |
|
||||
| `app.opentext.com/customer` | `OT_customer` | 客户维度统一 |
|
||||
| `app.opentext.com/product` | `OT_business_unit` | 产品/业务单元 |
|
||||
|
||||
## 命名规范
|
||||
|
||||
- **前缀**:`app.opentext.com`
|
||||
- **键格式**:小写字母、数字、连字符(遵循 K8s DNS 子域名规则)
|
||||
- **值格式**:无限制,可包含多级(如 `v1.2.3`)
|
||||
|
||||
## 与云标签的关系
|
||||
|
||||
K8s 标签标准是 OpenText 云标签标准 V2 的扩展:
|
||||
|
||||
- **云资源标签**:`OT_` 前缀(如 `OT_business_unit`)
|
||||
- **K8s 对象标签**:`app.opentext.com/` 前缀
|
||||
- **容器镜像标签**:`com.opentext.image/` 前缀
|
||||
|
||||
三者共同构成 OpenText 跨层级的统一标签体系。
|
||||
|
||||
## 最佳实践
|
||||
|
||||
- 使用 Terraform 或 Kustomize 在部署时自动注入标签
|
||||
- 通过 Kyverno 或 OPA Gatekeeper 策略强制 K8s 标签合规
|
||||
- 对于 K8s 自动创建的资源(如 Service 创建的 LoadBalancer),使用 Annotations 记录间接标签信息
|
||||
- 避免在标签中存储敏感数据
|
||||
|
||||
## Connections
|
||||
- [[Resource-Tagging]] — K8s 标签是资源标签体系的一部分
|
||||
- [[AWS-Tagging-Standards]] — 云标签标准的 K8s 扩展
|
||||
- [[Terraform]] — IaC 自动打标工具
|
||||
- [[public-cloud-learning-sessions-opentext-tagging-standard-v2-20250429-170111-meeting-rec]]
|
||||
Reference in New Issue
Block a user