本文介绍了0/3个节点可用:1个节点没有用于请求的Pod端口的空闲端口,2个节点与节点选择器不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在kubernetes(v1.15.2)kube系统名称空间中部署了treafik(v2.0),现在我定义了一个自定义名称空间并部署了微服务应用程序.由于treafik无法共享跨命名空间的pod,因此我在dabai-fat命名空间中部署了相同的treafik.现在treafik入口为我提供了以下提示:

I already deploy a treafik(v2.0) in the kubernetes(v1.15.2) kube-system namespace,now I define a custom namespace and deploy my microservice apps. Because the treafik could not share pods cross namespace,so I deploy a same treafik in dabai-fat namespace.Now the treafik ingress give me this tips:

0/3 nodes are available: 1 node(s) didn't have free ports for the requested pod ports, 2 node(s) didn't match node selector.

我认为相同的入口节点共享相同的80和443端口并产生冲突.处理此问题的最佳实践是什么?现在我想将微服务配置中心eureka映射到互联网.这是我的路由配置:

I think the same ingress node share a same 80 and 443 port and make conflict.What is the best practice to handle this problem? Now I want to mapping the microservice config center eureka to the internet.this is my route config:

  apiVersion: traefik.containo.us/v1alpha1
    kind: IngressRoute
    metadata:
      name: fat-eureka-route
    spec:
      entryPoints:
        - web
      routes:
        - match: Host(`k8s-fat-eureka.example.com`)
          kind: Rule
          services:
            - name: eureka
              port: 8761

推荐答案

您无需在集群中部署多个入口控制器.部署在名称空间中的Ingress控制器应能够跨集群在所有名称空间中的所有Pod上工作.入口控制器通常具有集群环,允许它访问入口服务.集群中所有名称空间的端点.

You don't need to deploy multiple ingress controllers in a cluster. Ingress controller deployed in a namespace should be able to work across the cluster for all pods across all namespace. Ingress controller generally have clusteroles which permits it to access ingress, services. endpoints across the cluster for all namespaces.

您只需要创建一个女演员资源在您拥有eureka的pod和服务的名称空间中.完成该操作后,traefik入口控制器将监视该入口已创建,并将配置traefik通过入口将流量路由到您的pod.

You just need to create an ingress resource in the namespace where you have the pod and service for eureka. Once you do that traefik ingress controller will watch that ingress is created and will configure traefik to route traffic to your pod via ingress.

现在traefik通过CRD支持kubernetes本地入口和入口路由.如果您使用的是Ingressroute,请确保已按照文档

Now traefik supports kubernetes native ingress and ingressroute via CRD. If you are using ingressroute make sure you have installed it with CRDs as specified in the docs

这篇关于0/3个节点可用:1个节点没有用于请求的Pod端口的空闲端口,2个节点与节点选择器不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 21:11