为ECI Pod配置公网连接 本文介绍如何为ECI Pod配置公网连接。 默认情况下,系统只为ECI Pod(即ECI实例)分配一个私网IP,如果您的ECI Pod有连接公网的需求,例如需要拉取公网镜像等,您可以为其绑定EIP,以实现ECI Pod与公网互通。 为ECI实例绑定EIP 创建ECI Pod时,您可以在Pod metadata中添加Annotation来绑定已有EIP,或者自动创建并绑定一个EIP。 配置说明 EIP只支持为所绑定的ECI实例提供公网服务,一个EIP只能绑定一个ECI实例。如果您有多个ECI实例需要连接公网,您需要分别为其绑定EIP,或者在所属VPC中创建公网NAT网关。 使用已有公网IP,配置参考如下: shell apiVersion: apps/v1 kind: Deployment metadata: name: nginxdeployment labels: app: nginx spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: annotations: k8s.ctyun.cn/ecieipinstanceid: eipxxxxxxxxxx 指定已有eip labels: app: nginx spec: containers: name: nginx image: registryhuadong1.crsinternal.ctyun.cn/opensource/nginx:1.25alpine ports: containerPort: 80 nodeName: vndu53cymkxxxxcnhuadong1jsnj1apublicctcloud 自动创建公网IP,配置参考如下: shell apiVersion: apps/v1 kind: Deployment metadata: name: nginxdeployment labels: app: nginx spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: annotations: k8s.ctyun.cn/eciwitheip: true 指定需要使用eip k8s.ctyun.cn/eipbandwidth: 5