zoukankan      html  css  js  c++  java
  • 0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }

    root@ubuntu:~# kubectl apply -f kata-nginx.yaml 
    Error from server (Forbidden): error when creating "kata-nginx.yaml": pods "kata-nginx" is forbidden: pod rejected: RuntimeClass "kata" not found
    root@ubuntu:~# 
    root@ubuntu:~# kubectl get nodes
    NAME     STATUS   ROLES    AGE   VERSION
    ubuntu   Ready    master   24m   v1.18.1
    root@ubuntu:~# kubectl get pods
    No resources found in default namespace.
    root@ubuntu:~#  kubectl get pods --all-namespaces
    NAMESPACE     NAME                             READY   STATUS              RESTARTS   AGE
    kube-system   coredns-66bff467f8-8rpxj         0/1     ContainerCreating   0          24m
    kube-system   coredns-66bff467f8-cmrzz         0/1     ContainerCreating   0          24m
    kube-system   etcd-ubuntu                      0/1     ContainerCreating   0          24m
    kube-system   kube-apiserver-ubuntu            0/1     ContainerCreating   0          24m
    kube-system   kube-controller-manager-ubuntu   0/1     ContainerCreating   0          24m
    kube-system   kube-flannel-ds-arm64-wlmzn      0/1     PodInitializing     0          24m
    kube-system   kube-proxy-l8s8z                 0/1     ContainerCreating   0          24m
    kube-system   kube-scheduler-ubuntu            0/1     ContainerCreating   0          24m
    root@ubuntu:~# 
    root@ubuntu:~# kubectl apply -f kata-nginx.yaml 
    pod/kata-nginx created
    root@ubuntu:~# kubectl describe pod kata-nginx
    Name:         kata-nginx
    Namespace:    default
    Priority:     0
    Node:         <none>
    Labels:       <none>
    Annotations:  Status:  Pending
    IP:           
    IPs:          <none>
    Containers:
      nginx:
        Image:        nginx
        Port:         80/TCP
        Host Port:    0/TCP
        Environment:  <none>
        Mounts:
          /var/run/secrets/kubernetes.io/serviceaccount from default-token-7bph4 (ro)
    Conditions:
      Type           Status
      PodScheduled   False 
    Volumes:
      default-token-7bph4:
        Type:        Secret (a volume populated by a Secret)
        SecretName:  default-token-7bph4
        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
      ----     ------            ----               ----               -------
      Warning  FailedScheduling  10s (x2 over 10s)  default-scheduler  0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.
    root@ubuntu:~# 
     kubectl taint nodes --all node-role.kubernetes.io/master-
    root@ubuntu:~# kubectl describe pod kata-nginx
    Name:         kata-nginx
    Namespace:    default
    Priority:     0
    Node:         ubuntu/10.10.16.82
    Start Time:   Wed, 14 Oct 2020 14:24:23 +0800
    Labels:       <none>
    Annotations:  Status:  Pending
    IP:           
    IPs:          <none>
    Containers:
      nginx:
        Container ID:   
        Image:          nginx
        Image ID:       
        Port:           80/TCP
        Host Port:      0/TCP
        State:          Waiting
          Reason:       ContainerCreating
        Ready:          False
        Restart Count:  0
        Environment:    <none>
        Mounts:
          /var/run/secrets/kubernetes.io/serviceaccount from default-token-7bph4 (ro)
    Conditions:
      Type              Status
      Initialized       True 
      Ready             False 
      ContainersReady   False 
      PodScheduled      True 
    Volumes:
      default-token-7bph4:
        Type:        Secret (a volume populated by a Secret)
        SecretName:  default-token-7bph4
        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
      ----     ------            ----               ----               -------
      Warning  FailedScheduling  75s (x2 over 75s)  default-scheduler  0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.
      Normal   Scheduled         8s                 default-scheduler  Successfully assigned default/kata-nginx to ubuntu
    root@ubuntu:~#

    kubectl delete pod kata-nginx

    root@ubuntu:~# kubectl apply -f kata-nginx.yaml 
    pod/kata-nginx created
    root@ubuntu:~# kubectl describe pod kata-nginx
    Name:         kata-nginx
    Namespace:    default
    Priority:     0
    Node:         ubuntu/10.10.16.82
    Start Time:   Wed, 14 Oct 2020 14:26:40 +0800
    Labels:       <none>
    Annotations:  Status:  Pending
    IP:           
    IPs:          <none>
    Containers:
      nginx:
        Container ID:   
        Image:          nginx
        Image ID:       
        Port:           80/TCP
        Host Port:      0/TCP
        State:          Waiting
          Reason:       ContainerCreating
        Ready:          False
        Restart Count:  0
        Environment:    <none>
        Mounts:
          /var/run/secrets/kubernetes.io/serviceaccount from default-token-7bph4 (ro)
    Conditions:
      Type              Status
      Initialized       True 
      Ready             False 
      ContainersReady   False 
      PodScheduled      True 
    Volumes:
      default-token-7bph4:
        Type:        Secret (a volume populated by a Secret)
        SecretName:  default-token-7bph4
        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  9s    default-scheduler  Successfully assigned default/kata-nginx to ubuntu
  • 相关阅读:
    面试总结
    CentOS 6.4 yum安装LAMP环境
    windows下XAMPP安装php_memcache扩展
    linux学习笔记
    本地虚拟机LNMP环境安装
    Linux下php安装memcache扩展
    linux下memcached安装以及启动
    阿里云服务器---centos编译安装ffmpeg
    [Yii2.0] 以Yii 2.0风格加载自定义类或命名空间 [配置使用Yii2 autoloader]
    Linux常用命令
  • 原文地址:https://www.cnblogs.com/dream397/p/13814751.html
Copyright © 2011-2022 走看看