可以在OVH托管Kubernetes群集中访问nodeport服务

发布于 2025-02-10 01:11:34 字数 431 浏览 2 评论 0 原文

在我的< node-ip>:< node-port> 无法到达的。

I followed this tutorial:

教程说,我可能必须“创建一个允许在您的节点端口上进行TCP流量的防火墙规则”,但我不知道该怎么做。

安全组似乎允许任何流量:

”在此处输入图像说明”

In my OVH Managed Kubernetes cluster I'm trying to expose a NodePort service, but it looks like the port is not reachable via <node-ip>:<node-port>.

I followed this tutorial: Creating a service for an application running in two pods. I can successfully access the service on localhost:<target-port> along with kubectl port-forward, but it doesn't work on <node-ip>:<node-port> (request timeout) (though it works from inside the cluster).

The tutorial says that I may have to "create a firewall rule that allows TCP traffic on your node port" but I can't figure out how to do that.

The security group seems to allow any traffic:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一身仙ぐ女味 2025-02-17 01:11:34

解决方案是在创建托管的Kubernetes群集时不启用“私人网络”(“RéseauPrivéstacté”)。

如果您已经付费了节点或配置的DNS或其他任何内容,则可以选择当前的Kubernetes群集,然后选择“重置您的群集”(“Réinitialiservotre cluster”),然后选择“保留和重新安装节点”(“ Conserver etréinstallerles noeuds noeuds noeuds noeuds ”)和在“私人网络附件”(“réseauprivéstacté”)选项中,选择“无(public ips)”(“ aucun(ips publiques)”),

我面临相同的用例和问题,以及经过一些研究,然后进行了一些研究和问题。实验,从这个对话框上的小评论中得到了提示:

默认情况下,您的工人节点具有公共IPv4。如果您选择一个专用网络,这些节点的公共IP将专门用于管理/链接到Kubernetes控制平面,您的节点将在您选择的专用网络的VLAN上分配一个IP

>

现在我得到了我的Traefikikik使用 hostnetwork 作为登录作为登录,即使在低端口上也可以直接到达(如您所见,默认安全组是打开的)

The solution is to NOT enable "Private network attached" ("réseau privé attaché") when you create the managed Kubernetes cluster.

If you already paid your nodes or configured DNS or anything, you can select your current Kubernetes cluster, and select "Reset your cluster" ("réinitialiser votre cluster"), and then "Keep and reinstall nodes" ("conserver et réinstaller les noeuds") and at the "Private network attached" ("Réseau privé attaché") option, choose "None (public IPs)" ("Aucun (IPs publiques)")

I faced the same use case and problem, and after some research and experimentation, got the hint from the small comment on this dialog box:

By default, your worker nodes have a public IPv4. If you choose a private network, the public IPs of these nodes will be used exclusively for administration/linking to the Kubernetes control plane, and your nodes will be assigned an IP on the vLAN of the private network you have chosen

Now i got my Traefik ingress as a DaemonSet using hostNetwork and every node is reachable directly even on low ports (as you saw yourself, the default security group is open)

绝對不後悔。 2025-02-17 01:11:34

好吧,我猜想进一步忍不住了,但是我会检查以下内容:

  1. 您是否正在使用公共节点IP地址?
  2. 您是否将服务配置为正确的负载量?
    https://kubernetes.io/kubernetes.io/docs.io/docs/concepts/services-networks/services-networks/services-networking/service-networking/service-networking/service-networking/service-networking/service/service/service/ /#LoadBalancer
  3. 您是否有一个负载板和正确设置?
  4. 您是否安装了任何入口控制器? (Ingress-nginx?)您可能需要为此入口控制器添加一个daemonset,以在群集中的每个节点上复制Ingress-controller Pod

,否则建议您进行入口(如果有效,您可以排除任何与防火墙相关的任何与防火墙相关的信息问题)。

此页面解释很好:
clusterip,nodeport和nodeport和nodeport and nodePort and nodePort and nodeport and nodeport and nodeport and nodeport and nodeport和kubernetes中的LoadBalancer服务类型?

Well i can't help any further i guess, but i would check the following:

  1. Are you using the public node ip address?
  2. Did you configure you service as Loadbalancer properly?
    https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
  3. Do you have a loadbalancer and set it up properly?
  4. Did you install any Ingress controller? (ingress-nginx?) You may need to add a Daemonset for this ingress-controller to duplicate the ingress-controller pod on each node in your cluster

Otherwise, i would suggest an Ingress, (if this works, you may exclude any firewall related issues).

This page explains very well:
What's the difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes?

独木成林 2025-02-17 01:11:34

在AWS中,您有一个称为安全组的东西...您可能在K8S提供商(甚至本地机器)中拥有相同的东西。请将这些端口添加到安全组或本地防火墙中。在AWS中,您可能还需要将这些安全组绑定到您的EC2实例(入口节点)。

In AWS, you have things called security groups... you may have the same kind of thing in you k8s provider (or even your local machine). Please add those ports to the security groups or local firewalls. In AWS you may need to bind those security groups to your EC2 instance (Ingress node) as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文