ingress-nginx

来源:6-6 部署ingress-nginx(下)

慕侠3072357

2020-01-21

1.下载的ingress-nginx的yaml文件只有一个image
[root@master01 ingress-nginx]# grep image mandatory.yaml
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:master
2.在work节点下载了image后运行 还是pending
[root@worker02 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
quay.io/kubernetes-ingress-controller/nginx-ingress-controller master 3da228df85e9 15 hours ago 368 MB
quay.io/calico/node v3.1.3 7eca10056c8e 20 months ago 248 MB
quay.io/calico/typha v0.7.4 c8f53c1b7957 20 months ago 56.9 MB
quay.io/calico/cni v3.1.3 9f355e076ea7 20 months ago 68.8 MB

3.还是pending状态
[root@master01 ingress-nginx]# kubectl get all -n ingress-nginx
NAME READY STATUS RESTARTS AGE
pod/nginx-ingress-controller-77bc55ffcc-tvgt2 0/1 Pending 0 23s

NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.apps/nginx-ingress-controller 1 1 1 0 23s

NAME DESIRED CURRENT READY AGE
replicaset.apps/nginx-ingress-controller-77bc55ffcc 1 1 0 23s

写回答

2回答

刘果国

2020-01-22

pending的先kubectl describe,再去看看系统日志。找到pending的原因

0
1
慕侠3072357
我更新了describe 信息,这个PodScheduled failed 有影响吗?
2020-01-22
共1条回复

慕侠3072357

提问者

2020-01-22

[root@master01 src]# kubectl describe pod nginx-ingress-controller-784ccc76bc-pwrlt -n ingress-nginx

Name:               nginx-ingress-controller-784ccc76bc-pwrlt

Namespace:          ingress-nginx

Priority:           0

PriorityClassName:  <none>

Node:               <none>

Labels:             app.kubernetes.io/name=ingress-nginx

                    app.kubernetes.io/part-of=ingress-nginx

                    pod-template-hash=3407773267

Annotations:        prometheus.io/port=10254

                    prometheus.io/scrape=true

Status:             Pending

IP:                 

Controlled By:      ReplicaSet/nginx-ingress-controller-784ccc76bc

Containers:

  nginx-ingress-controller:

    Image:       quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.19.0

    Ports:       80/TCP, 443/TCP

    Host Ports:  80/TCP, 443/TCP

    Args:

      /nginx-ingress-controller

      --default-backend-service=$(POD_NAMESPACE)/default-http-backend

      --configmap=$(POD_NAMESPACE)/nginx-configuration

      --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services

      --udp-services-configmap=$(POD_NAMESPACE)/udp-services

      --publish-service=$(POD_NAMESPACE)/ingress-nginx

      --annotations-prefix=nginx.ingress.kubernetes.io

    Liveness:   http-get http://:10254/healthz delay=10s timeout=1s period=10s #success=1 #failure=3

    Readiness:  http-get http://:10254/healthz delay=0s timeout=1s period=10s #success=1 #failure=3

    Environment:

      POD_NAME:       nginx-ingress-controller-784ccc76bc-pwrlt (v1:metadata.name)

      POD_NAMESPACE:  ingress-nginx (v1:metadata.namespace)

    Mounts:

      /var/run/secrets/kubernetes.io/serviceaccount from nginx-ingress-serviceaccount-token-fmmbv (ro)

Conditions:

  Type           Status

  PodScheduled   False 

Volumes:

  nginx-ingress-serviceaccount-token-fmmbv:

    Type:        Secret (a volume populated by a Secret)

    SecretName:  nginx-ingress-serviceaccount-token-fmmbv

    Optional:    false

QoS Class:       BestEffort

Node-Selectors:  app=ingress

Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s

                 node.kubernetes.io/unreachable:NoExecute for 300s

Events:

  Type     Reason            Age                 From               Message

  ----     ------            ----                ----               -------

  Warning  FailedScheduling  3m (x123 over 13m)  default-scheduler  0/2 nodes are available: 2 node(s) didn't match node selector.


//img1.sycdn.imooc.com/szimg/5e27baf5092d8ca210550538.jpg

//img1.sycdn.imooc.com/szimg/5e27bb5b09d1b2a513500125.jpg

Scheduled 的服务log 一直报这个问题:

//img1.sycdn.imooc.com/szimg/5e27bded09ec017b13620205.jpg

0
1
刘果国
FailedScheduling 3m (x123 over 13m) default-scheduler 0/2 nodes are available: 2 node(s) didn't match node selector. 这个就是重点,节点不满足调度要求,有nodeSelector(Node-Selectors: app=ingress),需要给节点打上这个标签才可以
2020-01-23
共1条回复

Kubernetes生产落地全程实践

一个互联网公司落地Kubernetes全过程点点滴滴

2293 学习 · 2216 问题

查看课程