簡體   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