在不使用外部负载平衡器的情况下使用自定义域配置 Kubernetes/Traefik

Configure Kubernetes/Traefik with custom domain without the use of an external load balancer

我想在 AWS 中拥有自己的 Kubernetes 游乐场,目前涉及 2 个 EC2 实例和一个 Elastic Load Balancer。

我使用 Traefik 作为我的入口控制器,它很容易让我为一些部署设置自动子域和 TLS(部署。k8s.mydomain.com)。

我喜欢这个,但作为一名学生,负载均衡器实在是太多了。我不得不在不使用它时终止集群,但理想情况下,我希望它全职运行。

有没有办法保留我的设置(很酷的 domain/tls 东西)但不再需要 ELB?

route53 dns 负载均衡?我确定一定有办法。 https://www.virtualtothecore.com/load-balancing-services-with-aws-route53-dns-health-checks/

如果您想放弃使用 LoadBalancer,您还有另一种选择,即通过 externalIPs type or NodePort.

的服务公开 Ingress Controller
kind: Service
apiVersion: v1
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app: ingress-nginx
spec:
  selector:
    app: ingress-nginx
  ports:
  - name: http
    port: 80
    targetPort: http
  - name: https
    port: 443
    targetPort: http
  externalIPs:
  - 80.11.12.10

然后您可以创建 CNAME (deployment.k8s.mydomain.com) 以指向集群节点的外部 IP。此外,您应该确保节点上的本地防火墙规则允许访问开放端口。