我在Google云端Kubernetes群集中展示除端口80以外的端口时遇到问题。 下面是Kubernetes服务yaml文件,但由于某种原因,只有端口80被暴露。 我已经SSH进入豆荚,并可以确认,他们在内部服务的其他端口下面列出,但他们似乎并没有被暴露。
任何洞察问题或我应该检查debugging吗?
apiVersion: v1 kind: Service metadata: name: my-frontend namespace: ocr-cluster labels: component: ocr spec: type: LoadBalancer selector: component: ocr ports: # Working: - name: http port: 80 protocol: TCP # Not working - name: rabbit port: 15672 protocol: TCP - name: flower port: 5555 protocol: TCP
我只能通过在yaml文件中手动指定LoadBalancer的静态IP来解决此问题。 这似乎是非常错误的,我敢打赌,要么我做了一些不正确的事情,或者有一些错误的地方。
我的yaml文件看起来像这样:
apiVersion: v1 kind: Service metadata: name: ocr-frontend namespace: ocr-da-cluster labels: component: ocr spec: type: LoadBalancer # Unfortunately, we need to specify the IP address here. loadBalancerIP: 104.154.151.248 ...