RuoYi-Cloud/deployment/mysql/mysql-svc.yaml

12 lines
433 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

apiVersion: v1
kind: Service
metadata:
name: ruoyi-mysql
namespace: kube-ruoyi
spec:
ports:
- port: 3306
nodePort: 30060
selector:
app: ruoyi-mysql-local # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上targetPort容器接收流量的端口port可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
type: NodePort