Kubernetes

Kubernetes kube-dns NodePort SVC

本文主要是介绍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 
这篇关于Kubernetes kube-dns NodePort SVC的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!