实现方法:
利用calico组件的两个kubernetes注解:
1>cni.projectcalico.org/ipAddrs
2>cni.projectcalico.org/ipv4pools
场景1: 单个pod固定ip,利用cni.projectcalico.org/ipAddrs实现
apiVersion: apps/v1 kind: Deployment metadata: labels: app: tools name: tools spec: replicas: 1 selector: matchLabels: app: tools strategy: {} template: metadata: creationTimestamp: null labels: app: tools annotations: "cni.projectcalico.org/ipAddrs": "["10.42.66.66"]" spec: containers: - image: docker-registry.i.brainpp.cn/library/duanshuaixing/databases-backup:v002 name: databases-backup
场景2: 多pod固定IP池
利用cni.projectcalico.org/ipv4pools指定创建的ippool
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)