kubernets 多端口服务设置

kubernets1年前 (2022)发布 megou
61 0

Multi-Port Services

For some Services, you need to expose more than one port. Kubernetes lets you configure multiple port definitions on a Service object. When using multiple ports for a Service, you must give all of your ports names so that these are unambiguous. For example:

apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app.kubernetes.io/name: MyApp
ports:
name: http
protocol: TCP
port: 80
targetPort: 9376
name: https
protocol: TCP
port: 443
targetPort: 9377

© 版权声明

相关文章