k8s中的Pod的状态CrashLoopBackOff

现象如下:

[[email protected] ~]# kubectl get pod
NAME                             READY   STATUS             RESTARTS   AGE
eureka-server-65695bbdc8-49b6v   0/1     CrashLoopBackOff   5          4m32s
[root@k8s1 ~]# kubectl get pod
NAME                             READY   STATUS             RESTARTS   AGE
eureka-server-65695bbdc8-49b6v   0/1     CrashLoopBackOff   5          5m16s

查找原因及解决如下:

[[email protected] ~]# kubectl describe pod eureka-server-65695bbdc8-49b6v
Name:           eureka-server-65695bbdc8-49b6v
Namespace:      default
Priority:       0
Node:           k8s3/192.168.180.144
Start Time:     Mon, 03 Feb 2020 21:03:24 +0800
Labels:         app=eureka-server
                pod-template-hash=65695bbdc8
Annotations:    <none>
Status:         Running
IP:             10.244.2.2
IPs:            <none>
Controlled By:  ReplicaSet/eureka-server-65695bbdc8
Containers:
  eureka-server:
    Container ID:   docker://0a8de1c10a8bc42aea722d4994f8b53c06820030de30a2c014f6600d7a98d09d
    Image:          112.124.104.171:1180/topcheer/eureka-server:1.0.1
    Image ID:       docker-pullable://112.124.104.171:1180/topcheer/[email protected]sha256:b18dbacbc640c62b64d92f7240af0adcec2c4d9e870c60194d7ce9fa9d1e557c
    Port:           9010/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Mon, 03 Feb 2020 21:07:15 +0800
      Finished:     Mon, 03 Feb 2020 21:07:22 +0800
    Ready:          False
    Restart Count:  5
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-tdbtd (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  default-token-tdbtd:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-tdbtd
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  4m30s                  default-scheduler  Successfully assigned default/eureka-server-65695bbdc8-49b6v to k8s3
  Normal   Pulled     2m21s (x5 over 4m29s)  kubelet, k8s3      Container image "112.124.104.171:1180/topcheer/eureka-server:1.0.1" already present on machine
  Normal   Created    2m21s (x5 over 4m28s)  kubelet, k8s3      Created container eureka-server
  Normal   Started    2m21s (x5 over 4m28s)  kubelet, k8s3      Started container eureka-server
  Warning  BackOff    105s (x10 over 4m6s)   kubelet, k8s3      Back-off restarting failed container
[[email protected] ~]# kubectl logs eureka-server-65695bbdc8-49b6v
2020-02-03 13:07:18.750  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration‘ of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$2920e78d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

  .   ____          _            __ _ _
 /\\ / ___‘_ __ _ _(_)_ __  __ _ \ \ \ ( ( )\___ | ‘_ | ‘_| | ‘_ \/ _` | \ \ \  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  ‘  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.4.RELEASE)

2020-02-03 13:07:19.062  INFO 1 --- [           main] c.t.eureka.EurekaServerApplication       : No active profile set, falling back to default profiles: default
2020-02-03 13:07:20.402  WARN 1 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID ‘service-registry‘ contains invalid characters, please migrate to a valid format.
2020-02-03 13:07:20.719  INFO 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=aab566da-2958-3e79-aa70-5d794b4e315b
2020-02-03 13:07:21.203  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration‘ of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$2920e78d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-03 13:07:21.621  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 9010 (http)
2020-02-03 13:07:21.638  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-02-03 13:07:21.639  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.30]
2020-02-03 13:07:21.727  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-02-03 13:07:21.728  INFO 1 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2630 ms
2020-02-03 13:07:21.988  WARN 1 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2020-02-03 13:07:21.989  INFO 1 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-02-03 13:07:22.018  INFO 1 --- [           main] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: [email protected]3c73951
2020-02-03 13:07:22.358 ERROR 1 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name ‘traceFilterRegistration‘ defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘traceFilterRegistration‘ parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘javax.servlet.Filter‘ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=httpTraceFilter)}
2020-02-03 13:07:22.405  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-02-03 13:07:22.413  WARN 1 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2020-02-03 13:07:22.442  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug‘ enabled.
2020-02-03 13:07:22.778 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156) ~[spring-boot-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.2.3.RELEASE.jar!/:5.2.3.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.4.RELEASE.jar!/:2.2.4.RELEASE]
        at com.topcheer.eureka.EurekaServerApplication.main(EurekaServerApplication.java:13) [classes!/:0.0.1-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]

才发现是boot的版本太高了,和boot有冲突。。。

创建的时候默认最新的版本是2.2.4,需要改一下

原文地址:https://www.cnblogs.com/dalianpai/p/12258165.html

时间: 2024-11-05 16:04:21

k8s中的Pod的状态CrashLoopBackOff的相关文章

k8s中的pod控制器之Deployment、DaemonSet、StatefulSet

pod控制器分类:1.ReplicationController2.ReplicaSet3.Deployment4.StatefulSet5.DaemonSet6.Job,Cronjob7.HPApod控制器:一般包括3部分1.标签选择器2.期望的副本数(DaemonSet控制器不需要)3.pod模板deploy控制器构建于rs控制器之上,新特性包括:1.事件和状态查看2.回滚3.版本记录4.暂停和启动5.支持两种自动更新方案Recreate删除重建RollingUpdate回滚升级(默认方式)

完美解决K8s中的Pod无法解析外网域名问题

系统:Ubuntu 18.04.02K8s版本:1.13.4 故障现象:安装KubeDNS后,Pod内无法ping通外网域名,访问外网IP.K8s内部域名或者IP均正常.??原因分析,查看Pod中的resolv.conf: kubectl exec busybox -- cat /etc/resolv.conf nameserver 10.96.0.10 search default.svc.cluster.local svc.cluster.local cluster.local option

k8s中删除pod后仍然存在问题

分析: 是因为删除了pod,但是没有删除对应的deployment,删除对应的deployment即可 实例如下: 删除pod [root@test2 ~]# kubectl get pod -n jenkins NAME READY STATUS RESTARTS AGE jenkins2-8698b5449c-grbdm 1/1 Running 0 8s [root@test2 ~]# kubectl delete pod jenkins2-8698b5449c-grbdm -n jenki

如何一键把k8s中的pod信息导出到excel以便查找故障原因?

安装xsv yay -S xsv 脚本如下: #!/usr/bin/env bash [[ -n $DEBUG ]] && set -x set -eou pipefail useage(){ cat <<"EOF" USAGE: pod2csv.sh [KUBECTL_OPTIONS] 读取pod信息,生成以tab分隔的csv文件,以便过滤筛选. 脚本最后的xdg-open请根据环境替换,类似excel表格软件最好 可以对出错的pod进行分析,找到出错po

K8s中的多容器Pod和Pod内容器间通信

容器(Container)常被用来解决比如微服务的单个问题,但在实际场景中,问题的解决往往需要多容器方案.本文会讨论将多个容器整合进单个Kubernetes Pod 中,以及Pod中的容器之间是如何通信的. Kubernetes Pod 是什么? 首先我们来探讨下什么是Pod.Pod是Kubernetes中最小的可部署和管理单元.换句话讲,如果需要在Kubernetes中运行单个容器,那么你就得为这个容器创建一个Pod.同时,一个Pod可以包含多个容器,这些容器往往是紧耦合的.怎么样个紧耦合法呢

k8s如何管理Pod(rc、rs、deployment)

是豆荚,可以把容器想像成豆荚里的豆子,把一个或多个关系紧密的豆子包在一起就是豆荚(一个Pod).在k8s中我们不会直接操作容器,而是把容器包装成Pod再进行管理(关于Pod,大家可以参考第十期的分享"谈谈Pod在微服务中的运用").Pod是运行服务的基础,那我们如何来管理Pod呢,下面我们就来聊一聊.分为这三个部分: 使用Replication Controller 来部署.升级Pod Replica Set – 下一代Replication Controller Deployment

kubernetes中的Pod简述与实践

Pod的概念详细的Pod解释可参考k8s官网,关于Pod的概念主要有以下几点:(1)Pod是kubernetes中你可以创建和部署的最小也是最简的单位.一个Pod代表着集群中运行的一个进程:(2)在Kubrenetes集群中Pod的使用方式:(3)Pod中如何管理多个容器 理解Pod上面已经说了"Pod是kubernetes中你可以创建和部署的最小也是最简的单位.一个Pod代表着集群中运行的一个进程."Pod中封装着应用的容器(有的情况下是好几个容器),存储.独立的网络IP,管理容器如

k8s学习 - 概念 - Pod

k8s学习 - 概念 - Pod 这篇继续看概念,主要是 Pod 这个概念,这个概念非常重要,是 k8s 集群的最小单位. 怎么才算是理解好 pod 了呢,基本上把 pod 的所有 describe 和配置文件的配置项都能看懂就算是对 pod 比较了解了. Pod 我们通过调用一个kubectl describe pod xxx 可以查看某个 pod 的具体信息. describe 的信息我们用注释的形式来解读. Name: task-pv-pod Namespace: default // 没

pod的状态及操作

查看pod的标签 [[email protected] pod]# kubectl get pods --show-labels NAME READY STATUS RESTARTS AGE LABELS cv-podh 1/2 CrashLoopBackOff 15 55m app=myapp,tier=frontend mysql-gh9ds 1/1 Running 4 28h app=mysql,cx=z pod 1/2 CrashLoopBackOff 70 27h app=myapp,