不管怎么测试,UDP/TCP不能配置在一个SVC中,反正总有一个不通
- 配置文件 TCP
apiVersion: v1 kind: Service metadata: annotations: labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: KubeDNS name: kube-dns-tcp namespace: kube-system spec: ports: - name: dns-tcp port: 53 protocol: TCP targetPort: 53 selector: k8s-app: kube-dns sessionAffinity: None type: NodePort
- 配置文件 UDP
apiVersion: v1 kind: Service metadata: annotations: labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: KubeDNS name: kube-dns-udp namespace: kube-system spec: ports: - name: dns port: 53 protocol: UDP targetPort: 53 selector: k8s-app: kube-dns sessionAffinity: None type: NodePort