apiVersion: v1
kind: Service
metadata:
  name: mysql-service
spec:
  type: LoadBalancer  # 如果需要集群外部访问,这里改为NodePort  type:ClusterIP  ,LoadBalancer
  selector:
    app: mysql
  ports:
    - protocol: TCP
      port: 3306
      nodePort: 30002