0
votes

I have just started with Kubernetes and I am confused about the difference between NodePort on version release-1.0 and release-1.1.

I have cluster with 3 node on 3 server (10.0.5.55, 5.66. 5.57), I run pods with replication controller and scale 2 replica like this

replcation controller:

apiVersion: v1
kind: ReplicationController
metadata:
  name: backend
  labels:
    name: backend
spec:
  replicas: 2
  selector:
    name: backend
    spec:
      containers:
      - name: backend
        image: myproject/backend
        ports:
        - containerPort: 8080

services (use NodePort):

apiVersion: v1
kind: Service
metadata:
  name: backend
  labels:
    name: backend
spec:
  selector:
    name: backend
  type: NodePort
  ports:
    - name: http
      protocol: TCP
      port: 10560
      targetPort: 8080
      nodePort: 30560
status:
  loadBalancer: {}

2 pods locate on 5.55 and 5.56

In version release-1.0 I can access services in 5.57, but in release-1.1 is not.

Pls explain my doubts.

Thanks.

1

1 Answers

0
votes

Services that use NodePort should be visible at <NodeIP>:spec.ports[*].nodePort and spec.clusterIp:spec.ports[*].port, in both release 1.0 and 1.1.