apiVersion: v1 kind: Service metadata: name: rabbitmq-service spec: type: NodePort # 在 Minikube 中使用 NodePort 方便外部访问 selector: app: rabbitmq ports: - name: amqp-ssl protocol: TCP port: 5671 targetPort: 5671 nodePort: 30671 - name: amqp protocol: TCP port: 5672 targetPort: 5672 nodePort: 30672 - name: management-ssl protocol: TCP port: 15671 targetPort: 15671 nodePort: 31671 - name: management protocol: TCP port: 15672 targetPort: 15672 nodePort: 31672