简体   繁体   English

使用自定义域配置Kubernetes / Traefik,而无需使用外部负载均衡器

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

I wanting to have my own Kubernetes playground within AWS which currently involves 2 EC2 instances and an Elastic Load Balancer. 我想在AWS中拥有自己的Kubernetes游乐场,该游乐场目前涉及2个EC2实例和一个Elastic Load Balancer。

I use Traefik as my ingress controller which has easily allowed me to set up automatic subdomains and TLS to some of the deployments (deployment.k8s.mydomain.com). 我将Traefik用作入口控制器,这使我可以轻松地为某些部署(deployment.k8s.mydomain.com)设置自动子域和TLS。

I love this but as a student, the load balancer is just too much. 我喜欢这个,但是作为一个学生,负载均衡器实在太多了。 I'm having to kill the cluster when not using it but ideally, I want this up full time. 不使用群集时,我必须杀死群集,但理想情况下,我想全时使用。

Is there a way to keep my setup (the cool domain/tls stuff) but drop the need for a ELB? 有没有办法保持我的设置(很酷的domain / tls东西),但又不需要ELB?

If you want to drop the use of a LoadBalancer, you have still another option, this is to expose Ingress Controller via Service of externalIPs type or NodePort . 如果您要放弃使用LoadBalancer,则还有另一个选择,这是通过externalIPs类型或NodePort的 Service公开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

You can then create a CNAME (deployment.k8s.mydomain.com) to point to the external IP of your cluster node. 然后,您可以创建一个CNAME(deployment.k8s.mydomain.com)以指向您的群集节点的外部IP。 Additionally, you should ensure that the local firewall rules on your node are allowing access to the open port. 此外,您应确保节点上的本地防火墙规则允许访问开放端口。

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

相关问题 AWS负载平衡器不适用于自定义域 - AWS load balancer not working with custom domain 具有现有 AWS HTTPS 负载均衡器的 K3S Kubernetes 集群中 Traefik Ingress Controller 的 AWS 证书解析器 - AWS certificate resolver for Traefik Ingress Controller in K3S Kubernetes Cluster with existing AWS HTTPS Load Balancer Traefik入口在AWS负载均衡器后面不起作用 - Traefik ingress is not working behind aws load balancer 有没有办法在没有负载均衡器的情况下为 ECS 服务配置健康检查? - Is there a way to configure health checks to an ECS service without a load balancer? 外部负载均衡器未收到请求 - External load balancer not receiving request 如何将 AWS 网络负载均衡器与自定义 python 服务器一起使用 - How to use AWS Network Load Balancer with custom python server 如何在没有 ngnix 的情况下使用 Elasticbeanstalk(仅使用应用程序负载均衡器) - How to use Elasticbeanstalk without ngnix (just with application load balancer) 是否可以在没有负载均衡器的情况下将 Amazon Elastic Beanstalk 与 SSL (HTTPS) 结合使用? - Is possible to use Amazon Elastic Beanstalk with SSL (HTTPS) without a Load Balancer? 如何在kubernetes的aws上创建应用程序负载均衡器 - How to create application load balancer on aws for kubernetes 为Kubernetes HA集群选择AWS负载均衡器 - Choosing of AWS Load Balancer for Kubernetes HA cluster
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM