kubernetes / kubernetes

Production-Grade Container Scheduling and Management
https://kubernetes.io
Apache License 2.0
111.39k stars 39.74k forks source link

NodePort dont response on guest node. #84577

Closed 2qif49lt closed 5 years ago

2qif49lt commented 5 years ago

What happened: i have 5nodes clutser, and the service with type NodePort and externalTrafficPolicy: Local that to acquire source IP. the deplotment selected by this service is assigned with nodeSelector to a fixed node.

request is ok through the fixed work node, but dont work from any other guest nodes. is a feature?

What you expected to happen:

guest nodes should be ok also.

How to reproduce it (as minimally and precisely as possible):

apiVersion: v1
kind: Service
metadata:
  name: rnmaster
  namespace: roadnetrt
  labels:
    run: master
spec:
  type: NodePort
  ports:
  - port: 8181
    targetPort: 8181
    protocol: TCP
    name: http
  selector:
    run: master
  externalTrafficPolicy: Local
apiVersion: apps/v1 
kind: Deployment
metadata:
  name: rnmaster
  namespace: roadnetrt
  labels:
    run: master
spec:
  selector:
    matchLabels:
      run: master
  replicas: 1
  template:
    metadata:
      labels:
        run: master
    spec:
      containers:
      - name: rnmaster
        image: images.abcde.local:5000/rnmaster:0.1.4
        args: ["-maps=:8081/xodr/", "-worker=images.abcde.local:5000/roadnetrt:0.1.0", "-nodes=cloud/ivt:4u"]
        ports:
          - containerPort: 8181
        env:
          - name: MY_POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
      nodeSelector:
        cloud/ivt: 4u
      imagePullSecrets:
      - name: roadnetrt-image

Anything else we need to know?:

Environment:

k8s-ci-robot commented 5 years ago

@2qif49lt: There are no sig labels on this issue. Please add a sig label by either:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix> e.g., @kubernetes/sig-contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <group-name> e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. See the group list. The <group-suffix> in method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.