如何从 mongodb compass gui 访问 azure kubernetes pod mongodb 实例
How to access azure kubernete pod mongodb instance from mongodb compass gui
MongoDB 实例在 Azure Kubernetes pod 中。我想从外面安全地访问这个无头 mongodb。我已经在虚拟机中安装了指南针,并将连接字符串粘贴到 mongodb 指南针中,VM 和 kubernete 都在同一网络中,但它显示 getaddrinfo ENOTFOUND 错误。在连接字符串中有副本集名称 rs0 和 ssl=false
什么是无头服务?
With a Headless Service, clients can connect to it’s pods by
connecting to the service’s DNS name. But using headless services, DNS
returns the pod’s IPs and client can connect directly to the pods
instead via the service proxy. read more : https://blog.knoldus.com/what-is-headless-service-setup-a-service-in-kubernetes/
从 另一个 VM 您无法连接到您的 AKS 中的 headless 服务 运行。
您可以使用 Loadbalancer 的 NodePort 公开您的服务,并从另一个 VM 进一步访问。
NodePort: Exposes the Service on each Node's IP at a static port (the
NodePort). A ClusterIP Service, to which the NodePort Service routes,
is automatically created. You'll be able to contact the NodePort
Service, from outside the cluster, by requesting :.
LoadBalancer: Exposes the Service externally using a cloud provider's
load balancer. NodePort and ClusterIP Services, to which the external
load balancer routes, are automatically created.
参考:https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
否则您可以使用入口控制器将服务公开到集群之外并对其进行管理。
关于安全开放服务,如果使用入口控制器,您可以将 IP 列入白名单。
否则直接在 Service 中将 IP 范围列入白名单
loadBalancerSourceRanges:
- "143.231.0.0/16"
参考:https://aws.amazon.com/premiumsupport/knowledge-center/eks-cidr-ip-address-loadbalancer/
MongoDB 实例在 Azure Kubernetes pod 中。我想从外面安全地访问这个无头 mongodb。我已经在虚拟机中安装了指南针,并将连接字符串粘贴到 mongodb 指南针中,VM 和 kubernete 都在同一网络中,但它显示 getaddrinfo ENOTFOUND 错误。在连接字符串中有副本集名称 rs0 和 ssl=false
什么是无头服务?
With a Headless Service, clients can connect to it’s pods by connecting to the service’s DNS name. But using headless services, DNS returns the pod’s IPs and client can connect directly to the pods instead via the service proxy. read more : https://blog.knoldus.com/what-is-headless-service-setup-a-service-in-kubernetes/
从 另一个 VM 您无法连接到您的 AKS 中的 headless 服务 运行。
您可以使用 Loadbalancer 的 NodePort 公开您的服务,并从另一个 VM 进一步访问。
NodePort: Exposes the Service on each Node's IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created. You'll be able to contact the NodePort Service, from outside the cluster, by requesting :.
LoadBalancer: Exposes the Service externally using a cloud provider's load balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.
参考:https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
否则您可以使用入口控制器将服务公开到集群之外并对其进行管理。
关于安全开放服务,如果使用入口控制器,您可以将 IP 列入白名单。
否则直接在 Service 中将 IP 范围列入白名单
loadBalancerSourceRanges:
- "143.231.0.0/16"
参考:https://aws.amazon.com/premiumsupport/knowledge-center/eks-cidr-ip-address-loadbalancer/