Loading...
Loading...
Compare original and translation side by side
MCP Tools:,get_k8s_resource,describe_k8s_resource,apply_k8s_manifest,patch_k8s_resourceget_cluster
MCP工具:、get_k8s_resource、describe_k8s_resource、apply_k8s_manifest、patch_k8s_resourceget_cluster
| Setting | Value | Impact |
|---|---|---|
| | Aggressive node |
| : : : scale-down reduces idle : | ||
| : : : compute : | ||
| | VPA recommendations |
| : : : prevent : | ||
| : : : over-provisioning : | ||
| Autopilot pricing | Pay per pod request | No charge for unused |
| : : : node capacity : | ||
| Node Auto Provisioning | enabled | Right-sized node pools |
| : : : created automatically : |
| 配置项 | 取值 | 影响 |
|---|---|---|
| | 主动缩容减少闲置计算资源 |
| | VPA建议避免过度配置资源 |
| Autopilot定价模式 | 按Pod请求量付费 | 闲置节点容量不收费 |
| Node Auto Provisioning | enabled | 自动创建规格适配的节点池 |
apiVersion: cloud.google.com/v1
kind: ComputeClass
metadata:
name: spot-with-fallback
spec:
activeMigration:
optimizeRulePriority: true
priorities:
- machineFamily: n4
spot: true
- machineFamily: n4
spot: false| Workload | Spot-Suitable? |
|---|---|
| Batch / data processing | Yes |
| Dev / test environments | Yes |
| Stateless web/API (replicas >= 2) | Yes (with PDBs) |
| Jobs with checkpointing | Yes |
| Stateful workloads (databases) | No |
| Single-replica critical services | No |
spec:
template:
spec:
terminationGracePeriodSeconds: 25 # Must be < 30s for Spot
containers:
- name: app
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "sleep 5"]apiVersion: cloud.google.com/v1
kind: ComputeClass
metadata:
name: spot-with-fallback
spec:
activeMigration:
optimizeRulePriority: true
priorities:
- machineFamily: n4
spot: true
- machineFamily: n4
spot: false| 工作负载类型 | 是否适合Spot VM |
|---|---|
| 批量/数据处理任务 | 是 |
| 开发/测试环境 | 是 |
| 无状态Web/API(副本数≥2) | 是(需配置PDB) |
| 带检查点的任务 | 是 |
| 有状态工作负载(数据库) | 否 |
| 单副本核心服务 | 否 |
spec:
template:
spec:
terminationGracePeriodSeconds: 25 # Spot VM场景下必须小于30秒
containers:
- name: app
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "sleep 5"]nodeSelector[!WARNING] Preemption Warning: Spot VMs are interruptible and can be preempted at any time with a 30-second notice. Workloads must be fault-tolerant and run with at least 2 replicas for high availability. Always explicitly warn users about this preemption risk when recommending Spot VMs.
apiVersion: apps/v1
kind: Deployment
metadata:
name: stateless-spot-app
spec:
replicas: 2
template:
spec:
nodeSelector:
cloud.google.com/gke-provisioning: Spot
terminationGracePeriodSeconds: 25 # Must be < 30s to allow graceful shutdown before preemption
containers:
- name: app
image: <IMAGE>nodeSelector[!WARNING] 抢占警告:Spot VM为可中断实例,随时可能收到30秒通知后被抢占。工作负载必须具备容错能力,且至少运行2个副本以保证高可用性。推荐Spot VM时务必明确告知用户该抢占风险。
apiVersion: apps/v1
kind: Deployment
metadata:
name: stateless-spot-app
spec:
replicas: 2
template:
spec:
nodeSelector:
cloud.google.com/gke-provisioning: Spot
terminationGracePeriodSeconds: 25 # 必须小于30秒,以便在抢占前完成优雅关闭
containers:
- name: app
image: <IMAGE>undefinedundefined
**Optimization rules:**
Condition | Action | Savings
----------------------------- | ---------------------------------- | -------
CPU request >5x P95 actual | Reduce to `P95 * 1.2` | High
Memory request >3x P95 actual | Reduce to `P95 * 1.2` | High
CPU request >2x P95 actual | Reduce to `P95 * 1.2` | Medium
No resource requests set | Add requests (enables bin-packing) | Medium
**优化规则:**
条件 | 操作 | 成本节省幅度
----------------------------- | ---------------------------------- | -------
CPU请求量 > 实际P95值的5倍 | 调整为`P95 * 1.2` | 高
内存请求量 > 实际P95值的3倍 | 调整为`P95 * 1.2` | 高
CPU请求量 > 实际P95值的2倍 | 调整为`P95 * 1.2` | 中
未设置资源请求 | 添加资源请求(启用装箱优化) | 中| Family | Use Case | Relative Cost |
|---|---|---|
| e2 | General purpose, burstable | Lowest |
| t2a / t2d | Scale-out (Arm/AMD), price-performance | Low |
| : : optimized : : | ||
| n4a | Axion Arm-based, general-purpose | Low |
| : : price-performance : : | ||
| n4 / n4d | General purpose (Intel/AMD), flexible shapes | Low-Medium |
| c4a | Compute-optimized (Arm), high efficiency | Medium-High |
| c3 / c4 | Compute-optimized (Intel) | Medium-High |
| c3d / c4d | Compute-optimized (AMD), high-performance | Medium-High |
| : : throughput : : | ||
| ek-standard | Autopilot enhanced (golden path) | Medium |
| m3 / x4 | Memory-optimized, SAP HANA, large databases | High |
| g2 (L4 GPU) | AI inference | High |
| a3 (H100 GPU) | AI training | Highest |
| a4 / a4x | Ultra-scale AI (Blackwell GPUs) | Highest |
In Autopilot, machine type is managed. Use ComputeClasses to influence selection.
| 系列 | 使用场景 | 相对成本 |
|---|---|---|
| e2 | 通用型、可突发性能 | 最低 |
| t2a / t2d | 横向扩展型(Arm/AMD)、性价比优化 | 低 |
| n4a | Axion Arm架构、通用型、性价比优化 | 低 |
| n4 / n4d | 通用型(Intel/AMD)、灵活规格 | 中低 |
| c4a | 计算优化型(Arm)、高能效 | 中高 |
| c3 / c4 | 计算优化型(Intel) | 中高 |
| c3d / c4d | 计算优化型(AMD)、高性能吞吐量 | 中高 |
| ek-standard | Autopilot增强型(黄金路径) | 中 |
| m3 / x4 | 内存优化型、SAP HANA、大型数据库 | 高 |
| g2 (L4 GPU) | AI推理场景 | 高 |
| a3 (H100 GPU) | AI训练场景 | 最高 |
| a4 / a4x | 超大规模AI场景(Blackwell GPU) | 最高 |
在Autopilot模式下,机器类型由系统管理。可通过ComputeClass影响类型选择。
gke-multitenancygke-multitenancyundefinedundefinedundefinedundefined| 配置项 | 生产环境(黄金路径) | 开发/测试环境 |
|---|---|---|
| 集群模式 | Autopilot | Autopilot(Pod数量更少时更经济) |
| 发布通道 | Regular | Rapid(更快获取修复更新) |
| 私有节点 | 必填 | 可选(简化访问) |
| 监控组件 | 完整套件 | 仅启用SYSTEM_COMPONENTS |
| Secret Manager轮换 | 120s | 禁用 |
| 维护窗口 | 已配置 | 无需配置 |