k8s RabbitMQ 公网访问端口
資深大佬 : fangwenxue 3
kind: Service apiVersion: v1 metadata: name: new namespace: coayufei labels: app: myapp spec: ports: - name: tcp1 protocol: TCP port: 15672 targetPort: 15672 - name: tcp2 protocol: TCP port: 5672 targetPort: 5672 selector: app: api kind: Ingress apiVersion: networking.k8s.io/v1beta1 metadata: name: new namespace: coayufei labels: app: myapp spec: tls: - hosts: - *DOMAIN secretName: new-ingress rules: - host: *DOMAIN http: paths: - backend: serviceName: new servicePort: 15672
- 通过 DOMAIN 可以访问到 RabbitMQ WEB 界面 API 也可以访问
PYTHON url = os.environ.get('CLOUDAMQP_URL', 'amqp://guest:[email protected]/guest') params = pika.URLParameters(url) connection = pika.BlockingConnection(params)
- 通过 DOMAIN:5672 却连不上 MQ
怎么把 5672 开放到公网上
大佬有話說 (0)