所以我使用Kubernetes在Google Cloud 上设置我的应用程序 . 我有一个Pod,我希望从需要TCP请求的群集中公开 .
我开始知道这可以通过ingress-nginx进行研究并进行研究 . 如docs here中所述,可以通过设置如下的configMap来完成:
apiVersion: v1
kind: ConfigMap
metadata:
name: tcp-configmap-example
data:
9000: "default/my-service-name:7051
,但它的完整用法没有明确描述,也没有在文档中找到一个完整的例子 .
我已经安装了_1110508中提到的ingress-nginx,但我不确定接下来的步骤是什么暴露我的Pod .
Extra Info
-
我想要从群集中公开的Pod中的端口是
7051
-
我有一个NodePort服务,它针对我的Pod端口,可以与Ingress一起使用来暴露 .
1 回答
在Google Cloud Platform中,您可以使用
type: LoadBalancer
在集群外部公开您的服务 . 你可以在这里看到例子Exposing Applications using Services .这是一个简单的例子:
您也可以按照Kubernetes文档中的说明进行操作Exposing an External IP Address to Access an Application in a Cluster