Serverless容器集群支持用户通过annotation
的形式,支持为Pod绑定安全组、定义Pod规格等能力。
备注:
支持用户创建工作负载时,指定KCI容器实例的规格
Annotation Key | 是否必填 | Annotation Value示例 | 描述 |
---|---|---|---|
k8s.ksyun.com/kci-instance-cpu | 否 | 1 | 指定容器实例CPU核数,单位:核。如填写需要和k8s.ksyun.com/kci-instance-memory 注解同时填写 |
k8s.ksyun.com/kci-instance-memory | 否 | 2 | 指定容器实例内存,单位:GiB。如填写需要和k8s.ksyun.com/kci-instance-cpu 注解同时填写 |
如下创建一个实例规格1C2GiB的工作负载,实例的规格必须满足KCI容器实例支持的实例规格
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
annotations:
"k8s.ksyun.com/kci-instance-cpu" : "1"
"k8s.ksyun.com/kci-instance-memory" : "2"
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
nodeName: virtual-node
支持用户指定KCI实例所属的安全组
Annotation Key | 是否必填 | Annotation Value示例 | 描述 |
---|---|---|---|
k8s.ksyun.com/kci-security-group-id | 否 | xxxxxxxx | 支持填写多个,创建Serverless集群,会选择集群默认的安全组。在创建KCI容器实例时,若不指定安全组,则KCI实例默认使用使用创建集群时选择的安全组。如果用户希望使用同VPC下其他安全组创建KCI实例,需要通过注解方式显示指定安全组 |
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
annotations:
"k8s.ksyun.com/kci-security-group-id" : "${your_security_group_id}"
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
nodeName: virtual-node
文档内容是否对您有帮助?
评价建议不能为空
非常感谢您的反馈,我们会继续努力做到更好!