我在 Kubernetes(谷歌云)中创建了一个 pod,并通过 imagezmq 创建了它的流数据。
正在传输数据的 Python 代码(Kubernetes pod 内部)-
import imagezmq
sender = imagezmq.ImageSender(connect_to='tcp://127.0.0.1:5555',REQ_REP=False)
sender.send_image('rpi_name',data)
我想从 pod 外部访问数据,像这样从我的系统中访问。
image_hub = imagezmq.ImageHub('tcp://34.86.110.52:80',REQ_REP=False)
while True:
rpi_name,image = image_hub.recv_image()
yield (b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n' + image.tobytes() + b'\r\n')
我尝试创建外部负载平衡,但没有奏效。我不知道该怎么办
负载均衡 YAML-
apiVersion: v1
kind: Service
spec:
clusterIP: 10.72.131.76
externalTrafficPolicy: Cluster
ports:
- nodePort: 31145
port: 80
protocol: TCP
targetPort: 5555
selector:
app: camera-65
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer:
ingress:
- ip: 34.86.110.52
请帮帮我。