Kubernetes kube-dns NodePort SVC

不管怎么测试,UDP/TCP不能配置在一个SVC中,反正总有一个不通

  1. 配置文件 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
  2. 配置文件 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 
上一篇:IIS部署WCF详细教程


下一篇:K8S不同命名空间访问(待修改)