• pod状态为Back-off


    查看pod状态为CrashLoopBackOff

    [root@master yaml]# kubectl get pods
    NAME                     READY     STATUS             RESTARTS   AGE
    mysql-77b495b4fd-pjw2w   0/1       CrashLoopBackOff   5          5m
    

    查看pod的详细信息,看到最后一行
    Back-off restarting failed container

    [root@master yaml]# kubectl describe pod/mysql-77b495b4fd-pjw2w
    Name:           mysql-77b495b4fd-pjw2w
    Namespace:      default
    Node:           node2/192.168.1.100
    Start Time:     Tue, 24 Jul 2018 09:56:37 +0800
    Labels:         app=mysql
                    pod-template-hash=3360516098
    Annotations:    <none>
    Status:         Running
    IP:             10.244.2.90
    Controlled By:  ReplicaSet/mysql-77b495b4fd
    Containers:
      mysql:
        Container ID:   docker://00a667790c3ec1d07071e15f49887c0df1d06964612952775d3e2f7f40e4cffe
        Image:          mysql:5.6
        Image ID:       docker-pullable://mysql@sha256:29e32fba52c3e6708fdc8a7678287debe3554febced25ade8686a63d4409ceda
        Port:           3306/TCP
        Host Port:      0/TCP
        State:          Terminated
          Reason:       Error
          Exit Code:    1
          Started:      Tue, 24 Jul 2018 10:02:21 +0800
          Finished:     Tue, 24 Jul 2018 10:02:21 +0800
        Last State:     Terminated
          Reason:       Error
          Exit Code:    1
          Started:      Tue, 24 Jul 2018 09:59:30 +0800
          Finished:     Tue, 24 Jul 2018 09:59:30 +0800
        Ready:          False
        Restart Count:  6
        Environment:
          MYSQL_ROOT_PASSWORD:  
        Mounts:
          /var/lib/mysql from mysql-persistent-storage (rw)
          /var/run/secrets/kubernetes.io/serviceaccount from default-token-zjcdx (ro)
    Conditions:
      Type           Status
      Initialized    True 
      Ready          False 
      PodScheduled   True 
    Volumes:
      mysql-persistent-storage:
        Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
        ClaimName:  mysql-pvc
        ReadOnly:   false
      default-token-zjcdx:
        Type:        Secret (a volume populated by a Secret)
        SecretName:  default-token-zjcdx
        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   SuccessfulMountVolume  5m                 kubelet, node2     MountVolume.SetUp succeeded for volume "default-token-z
      Normal   SuccessfulMountVolume  5m                 kubelet, node2     MountVolume.SetUp succeeded for volume "mysql-pv"
      Normal   Pulling                5m                 kubelet, node2     pulling image "mysql:5.6"
      Normal   Scheduled              5m                 default-scheduler  Successfully assigned mysql-77b495b4fd-pjw2w to node2
      Normal   Pulled                 5m                 kubelet, node2     Successfully pulled image "mysql:5.6"
      Normal   Created                4m (x5 over 5m)    kubelet, node2     Created container
      Normal   Started                4m (x5 over 5m)    kubelet, node2     Started container
      Normal   Pulled                 4m (x4 over 5m)    kubelet, node2     Container image "mysql:5.6" already present on machine
      Warning  BackOff                45s (x24 over 5m)  kubelet, node2     Back-off restarting failed container 
    
    

    查看pod的日志信息,得知mysql必须要指定其中一个变量

    [root@master yaml]# kubectl log mysql-77b495b4fd-pjw2w
    log is DEPRECATED and will be removed in a future version. Use logs instead.
    error: database is uninitialized and password option is not specified 
      You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD
    
    
  • 相关阅读:
    DELPHI中Showmodal与Show的区别
    怎样把一个文件夹里面所有文件的文件名提取出来,放到Excel表格里呢
    Python基础之函数
    Python_Openpyxl
    设计模式
    【转】深入理解递归函数的调用过程
    Java集合的Stack、Queue、Map的遍历
    数据结构-String、char
    leetcode-位运算
    Java web入门
  • 原文地址:https://www.cnblogs.com/aubin/p/9388774.html
Copyright © 2020-2023  润新知