我有困难我Kubernetes集群上访问NodePort服务。Kubernetes集群在AWS上与芭斯 - NodePort服务不可用
目标
设置ALB入口控制器,这样我可以使用WebSockets和HTTP/2
设置NodePort服务所要求的是,控制器采取
步骤
以前,在AWS eu-west-1上创建了一个Kops(1.6.2版)集群。增加了用于nginx入口的kops插件以及Kube-lego。 ELB入口正常工作。
设置的ALB入口控制器使用由该项目指定IAM的个人资料了AWS的密钥。从负载平衡器
改变后的服务类型来使用NodePort替换kubectl --force
> kubectl describe svc my-nodeport-service
Name: my-node-port-service
Namespace: default
Labels: <none>
Selector: service=my-selector
Type: NodePort
IP: 100.71.211.249
Port: <unset> 80/TCP
NodePort: <unset> 30176/TCP
Endpoints: 100.96.2.11:3000
Session Affinity: None
Events: <none>
> kubectl describe pods my-nodeport-pod
Name: my-nodeport-pod
Node: <ip>.eu-west-1.compute.internal/<ip>
Labels: service=my-selector
Status: Running
IP: 100.96.2.11
Containers:
update-center:
Port: 3000/TCP
Ready: True
Restart Count: 0
(ssh into node)
$ sudo netstat -nap | grep 30176
tcp6 0 0 :::30176 :::* LISTEN 2093/kube-proxy
结果
从ALB卷曲从<public ip address of all nodes>:<node port for service>
挂起
卷曲挂起
预期
卷曲来自ALB并直接向节点:节点端口应该返回200“OK”(该服务的HTTP响应于根)
更新:在github在一些进一步的细节以上引用创建 问题有些情况是:
- https://github.com/kubernetes/kubernetes/issues/50261
- https://github.com/coreos/alb-ingress-controller/issues/169
- https://github.com/kubernetes/kops/issues/3146