@@ -32,13 +32,11 @@ apiVersion: v1
kind: Service
metadata:
name: nginx-service
- labels:
- app: nginx
spec:
selector:
app: nginx
ports:
- - protocol: TCP
- port: 80
- targetPort: 80
- type: NodePort
+ - port: 80 # 集群内部访问端口
+ targetPort: 80 # 容器端口
+ nodePort: 30637 # 必须在 30000~32767 之间
+ type: NodePort # 外网访问类型