apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
name: nginx
spec:
ports:
# the port that this service should serve on
- port: 80
targetPort: 80
nodePort: 30000
selector:
name: nginx
type: NodePort
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
name: nginx
spec:
ports:
# the port that this service should serve on
- port: 80
targetPort: 80
nodePort: 30000
selector:
name: nginx
type: LoadBalancer
两种方法都支持负载均衡器。 端口范围在30000-32000之间,为什么? 如果我想使用端口3000,我该怎么做?