Service的多端口设置
apiVersion: v1
kind: Service
metadata:
name: webapp
spec:
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
#回话的保持时间
timeoutSeconds: 10800
ports:
- port: 8080
#目标端口
targetPort: 8080
#可以设置不同的协议
protocol: TCP
name: web
- port: 8005
#目标端口
targetPort: 8005
protocol: UDP
name: management
selector:
#选择对应的标签
app: webapp