8.ip固定

– 使用如下配置给pod固定ip

annotations:
cni.projectcalico.org/ipAddrs: “[\”10.224.0.20\”]”

– 模版文件


apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
    app: myapp
  annotations:
    cni.projectcalico.org/ipAddrs: "[\"10.224.0.20\"]"
spec:
  containers:
  - name: myapp-container
    image: busybox
    command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600']
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐