Knative Serving 自动伸缩与流量分配实践

Service 清单(含自动伸缩与流量)


apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: api
  namespace: app
spec:
  template:
    metadata:
      annotations:
        autoscaling.knative.dev/minScale: "1"
        autoscaling.knative.dev/target: "100"
    spec:
      containers:
        - image: gcr.io/example/api:v2
  traffic:
    - latestRevision: true
      percent: 80
    - revisionName: api-00001
      percent: 20

总结

通过注解设定最小副本与目标并发,配合 traffic 字段实现多版本流量权重分配与灰度能力。

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿
网站二维码

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部
/* 跳过导航链接 (无障碍) */ position: absolute; top: -100px; left: 15px; z-index: 99999; padding: 8px 16px; background: #007bff; color: #fff; font-size: 14px; border-radius: 0 0 4px 4px; text-decoration: none; transition: top 0.2s; } top: 0; outline: 3px solid #0056b3; }