简体   繁体   English

如何将一个节点 Kubernetes 入口服务的外部 IP 暴露到互联网中

[英]How to expose external IP of one Node Kubernetes Ingress Service into the internet

I installed a one node Kubernetes with kubeadm .我用 kubeadm 安装了一个节点kubeadm This is on a vServer "bare metal" with dedicated external static IP.这是在具有专用外部 static IP 的vServer “裸机”上。

With these components/settings:使用这些组件/设置:

  • calico (default settings)印花布(默认设置)
  • MetalLB (Layer 2 config with address range 192.168.1.240-192.168.1.250 ) MetalLB(第 2 层配置,地址范围为192.168.1.240-192.168.1.250
  • Traefik (default settings) Traefik(默认设置)

Now a traefik service is exposed as an "external IP" but the IP is 192.168.1.240 .现在 traefik 服务作为“外部 IP”公开,但 IP 是192.168.1.240 This is external from k8s point of view but how do I expose the ingress service to the internet?从 k8s 的角度来看,这是外部的,但我如何将入口服务公开到互联网?

I do not want to set up an additional external load balancer.我不想设置额外的外部负载平衡器。 How can I achieve this?我怎样才能做到这一点?

metalLB is not needed at all.根本不需要metalLB。 When you install traefik add this value file (as traefik.yaml in this case):当你安装 traefik 添加这个值文件(在这种情况下为traefik.yaml ):

service:
  externalIPs:
    - <your_external_static_ip_here_without_the_brackets>

and then install it like this: helm install --values=./traefik.yaml traefik traefik/traefik -n traefik --create-namespace然后像这样安装它: helm install --values=./traefik.yaml traefik traefik/traefik -n traefik --create-namespace

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM