4
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,我该怎么办?什么是服务类型之间的区别:NodePort和负载平衡器
这个答案解释NodePort是什么,但确实它不是如何从负载平衡器不同的做法,我相信这是什么OP问。 – Blaszard