[英]How to create application load balancer to expose kubernetes cluster
As i went through few resources on the internet i managed to create classic load balancer by setting the flags in my kube.apiserver, kubelet.service, kubecontroller manager and created a cluster and deployed a sample nginx file and it has exposed the application but i see that it has created classic load balancer and what i wanted is an application load balancer to be created am i supposed to do anymore changes?当我浏览互联网上的少量资源时,我设法通过在我的 kube.apiserver、kubelet.service、kubecontroller 管理器中设置标志来创建经典负载均衡器,并创建了一个集群并部署了一个示例 nginx 文件,它已经暴露了应用程序,但我看到它创建了经典的负载均衡器,我想要的是创建一个应用程序负载均衡器我应该做更多的改变吗? and also when i deploy a kibana helm chart i do get an load balancer
external ip
but when i access it i don't see any page.而且当我部署 kibana helm chart 时,我确实得到了一个
external ip
但是当我访问它时,我看不到任何页面。
NAME READY STATUS RESTARTS AGE
pod/elasticsearch-client-5df74c974d-dp6xw 1/1 Running 0 5h52m
pod/elasticsearch-data-0 1/1 Running 0 5h52m
pod/elasticsearch-master-0 1/1 Running 0 5h52m
pod/fluent-bit-h9kgm 1/1 Running 0 5h52m
pod/kibana-b9d8dc6d5-cbj8j 1/1 Running 0 7s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/elasticsearch-client ClusterIP 10.100.13.46 <none> 9200/TCP 5h52m
service/elasticsearch-discovery ClusterIP None <none> 9300/TCP 5h52m
service/kibana LoadBalancer 10.100.14.245 adaec083b81644ecbb87d4d2ba0dc070-693460825.us-east-1.elb.amazonaws.com 443:32734/TCP 7s
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/fluent-bit 1 1 1 1 1 <none> 5h52m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/elasticsearch-client 1/1 1 1 5h52m
deployment.apps/kibana 1/1 1 1 7s
NAME DESIRED CURRENT READY AGE
replicaset.apps/elasticsearch-client-5df74c974d 1 1 1 5h52m
replicaset.apps/kibana-b9d8dc6d5 1 1 1 7s
NAME READY AGE
statefulset.apps/elasticsearch-data 1/1 5h52m
statefulset.apps/elasticsearch-master 1/1 5h52m
As you can see above i'm able to get a LoadBalancer
<externalIP>
but i don't see anything when i open that link.正如您在上面看到的,我可以获得一个
LoadBalancer
<externalIP>
但是当我打开该链接时我什么也看不到。
And also my requirement was to deploy an Application Load Balancer and after i would deploy an Ingress helm chart and in the ingress resources i would specify the paths and ports.而且我的要求是部署一个应用程序负载均衡器,在我部署一个 Ingress helm 图表之后,我将在入口资源中指定路径和端口。
From the docs as of now only ELB and NLB is supported loadbalancer type for AWS.从目前的文档来看,AWS 仅支持 ELB 和 NLB 类型的负载均衡器。
Edit:编辑:
Using LoadBalancer
type service you can have single NLB/ELB for the nginx ingress controller and use it for as many ingress resource as you want to route traffic to backend cluster IP type service.使用
LoadBalancer
类型的服务,您可以为 nginx 入口 controller 使用单个 NLB/ELB,并将其用于您想要将流量路由到后端集群 ZA12A3079E14CED46E69BA52B8A 的尽可能多的入口资源。
But if you wan to use ALB you have to manually create it (following AWS docs) and configure it to forward traffic to your Kubernetes nodes NodePort
where nginx ingress controller is running.但是,如果您想使用 ALB,则必须手动创建它(按照 AWS 文档)并将其配置为将流量转发到 Kubernetes 节点
NodePort
,其中 nginx 入口 Z594C103F2C6E034C3D8AB059C0 正在运行。 Creating a LoadBalancer
type service will not work in this case.在这种情况下,创建
LoadBalancer
类型的服务将不起作用。 You will have to create a NodePort
service for the nginx ingress controller.您必须为 nginx 入口 controller 创建
NodePort
服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.