我有yaml文件。它创建了两个部署,内部的两个Pod都打开了主机网络。
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: busybox
spec:
replicas: 1
template:
metadata:
labels:
app: busybox
spec:
hostNetwork: true
hostname: busybox-1
subdomain: default-subdomain
containers:
- image: busybox
command:
- sleep
- "3600"
name: busybox
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: influxdb-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: influxdb-deployment
spec:
hostNetwork: true
containers:
- name: influxdb-deployment
image: influxdb
在这种情况下,吊舱将具有相同的clusterIP或DNS名称。我想通过DNS或IP连接POD,并使用SNMP监视其CPU指标;但是问题在于,IP或DNS不再能够区分两个POD,因为它总是传给主机。有什么解决方案吗?