繁体   English   中英

kubernetes没有为ingress-nginx控制器创建ELB

[英]kubernetes not creating the ELB for ingress-nginx controller

我正在尝试使用指南配置类型为LoadBalancer的 ingress-nginx-controller。
我正在观察的几个问题 -
问题#1)它不会在AWS上创建和部署ELB。
问题#2) 外部IP状态显示为待定状态。

$ kubectl get services -n ingress-nginx  
NAME            TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE   
ingress-nginx   LoadBalancer   10.108.245.210   <pending>     80:30742/TCP,443:31028/TCP   41m  

我跟着那里提到的每一步

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml  
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/aws/service-l4.yaml  
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/aws/patch-configmap-l4.yaml  

这是来自豆荚的日志 -

~$ kubectl get pods -n ingress-nginx
NAME                                        READY   STATUS    RESTARTS   AGE
default-http-backend-7b8bdbc579-5tgd5       1/1     Running   0          5h57m
nginx-ingress-controller-766c77b7d4-w6wkk   1/1     Running   1          6h16m

$ kubectl logs -n ingress-nginx nginx-ingress-controller-766c77b7d4-w6wkk | more  
-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:    0.21.0
  Build:      git-b65b85cd9
  Repository: https://github.com/aledbf/ingress-nginx
-------------------------------------------------------------------------------

nginx version: nginx/1.15.6
W1228 06:50:15.592738       7 client_config.go:548] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I1228 06:50:15.593115       7 main.go:196] Creating API client for https://10.96.0.1:443
I1228 06:50:15.699540       7 main.go:240] Running in Kubernetes cluster version v1.13 (v1.13.1) - git (clean) commit eec55b9ba98609a46fee712359c7b5b365bdd920 - platfo$
m linux/amd64
I1228 06:50:16.060958       7 nginx.go:258] Starting NGINX Ingress controller
I1228 06:50:16.098387       7 event.go:221] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"nginx-configuration", UID:"60a8d471-0a6c-11e9-9$
55-024a9b465fb2", APIVersion:"v1", ResourceVersion:"1425", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/nginx-configuration
I1228 06:50:16.098548       7 event.go:221] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"tcp-services", UID:"60acc5c1-0a6c-11e9-9a55-024$
9b465fb2", APIVersion:"v1", ResourceVersion:"1426", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/tcp-services
I1228 06:50:16.103229       7 event.go:221] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"udp-services", UID:"60ae5849-0a6c-11e9-9a55-024$
9b465fb2", APIVersion:"v1", ResourceVersion:"1428", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/udp-services
I1228 06:50:17.262403       7 nginx.go:279] Starting NGINX process
I1228 06:50:17.263106       7 leaderelection.go:187] attempting to acquire leader lease  ingress-nginx/ingress-controller-leader-nginx...
I1228 06:50:17.267252       7 controller.go:172] Configuration changes detected, backend reload required.
I1228 06:50:17.280698       7 leaderelection.go:196] successfully acquired lease ingress-nginx/ingress-controller-leader-nginx
I1228 06:50:17.281401       7 status.go:148] new leader elected: nginx-ingress-controller-766c77b7d4-w6wkk
I1228 06:50:18.113969       7 controller.go:190] Backend successfully reloaded.
I1228 06:50:18.114768       7 controller.go:202] Initial sync, sleeping for 1 second.
[28/Dec/2018:06:50:19 +0000]TCP200000.000
I1228 06:51:07.572896       7 event.go:221] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"nginx-configuration", UID:"60a8d471-
0a6c-11e9-9a55-024a9b465fb2", APIVersion:"v1", ResourceVersion:"1783", FieldPath:""}): type: 'Normal' reason: 'UPDATE' ConfigMap ingress-nginx/nginx-configu
ration
I1228 06:51:07.995982       7 controller.go:172] Configuration changes detected, backend reload required.
I1228 06:51:12.846822       7 controller.go:190] Backend successfully reloaded.
[28/Dec/2018:06:51:13 +0000]TCP200000.000
W1228 10:14:17.301340       7 queue.go:130] requeuing &ObjectMeta{Name:sync status,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,Cre
ationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string
{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,}, err services "ingress-nginx" not found
W1228 10:14:17.313074       7 queue.go:130] requeuing &ObjectMeta{Name:sync status,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,Cre
ationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string
{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,}, err services "ingress-nginx" not found
W1228 10:14:17.320110       7 queue.go:130] requeuing &ObjectMeta{Name:sync status,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,Cre
ationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string
{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,}, err services "ingress-nginx" not found
<truncated>

上述错误表明服务未正常运行。 在描述服务输出中也没有出现任何事件 -

~$ kubectl get service -n ingress-nginx
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
default-http-backend   ClusterIP      10.100.2.163    <none>        80/TCP                       5h49m
ingress-nginx          LoadBalancer   10.108.221.18   <pending>     80:32010/TCP,443:31271/TCP   170m

$kubectl describe service ingress-nginx -n ingress-nginx
Name:                     ingress-nginx
Namespace:                ingress-nginx
Labels:                   app.kubernetes.io/name=ingress-nginx
                          app.kubernetes.io/part-of=ingress-nginx
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"service.beta.kubernetes.io/aws-load-balancer-type":"nlb"},"label
s":{"app.k...
                          service.beta.kubernetes.io/aws-load-balancer-type: nlb
Selector:                 app.kubernetes.io/name=ingress-nginx,app.kubernetes.io/part-of=ingress-nginx
Type:                     LoadBalancer
IP:                       10.108.221.18
Port:                     http  80/TCP
TargetPort:               http/TCP
NodePort:                 http  32010/TCP
Endpoints:                10.244.0.4:80
Port:                     https  443/TCP
TargetPort:               https/TCP
NodePort:                 https  31271/TCP
Endpoints:                10.244.0.4:443
Session Affinity:         None
External Traffic Policy:  Local
HealthCheck NodePort:     30401
Events:                   <none>  

我知道有一个服务规范标签externalIPs,但这里的期望是,一旦创建了ELB实例,它将自动填充 -

spec:
  type: LoadBalancer
  externalIPs:
  - {{ ingress_lb_address or vip or masterIP }}

如果我在这里缺少任何东西,请告诉我。

找到了根源。 群集中的所有资源都缺少云提供程序标记。

~$ kubectl cluster-info dump | grep LoadBalancer  
 E1228 14:35:47.072444 1 core.go:76] Failed to start service controller: WARNING: no cloud provider provided, services of type LoadBalancer will fail

aws ALB,CLB,ELB都需要花费一些时间来配置最长5-10分钟的时间。

即使你看看链接: https//aws.amazon.com/blogs/opensource/kubernetes-ingress-aws-alb-ingress-controller/

这是ALB的入口控制器

暂无
暂无

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

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