apiVersion: v1
kind: Service
metadata:
name: deploy-service
labels:
app: deploy-service
spec:
ports:
- port: 80
targetPort: 80
name: deploy-service-pod
selector:
app: deploy-pod
type: NodePort
主机端口分配方式
两个 name
port 和 targetPort
type 类型