安装Fedora(单节点)后,Kubernetes Pods不可用

时间:2018-06-02 18:35:31

标签: docker kubernetes

我最近开始使用Kubernetes并获得了使用Minikube的一些经验,当然还有kubectl。现在我想设置我自己的集群,我已经按照这个官方说明: Fedora (Single Node) Installation

主服务器和节点可以连接,节点状态为“就绪”:

[root@fed-master ~]# kubectl get nodes
NAME       STATUS    ROLES     AGE       VERSION
fed-node   Ready     <none>    22h       v1.10.1

但是当我创建部署时:

[root@fed-master ~]# kubectl run hello-world --replicas=2 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0  --port=8080

POD未创建且无法使用:

[root@fed-master ~]# kubectl get deployments
NAME          DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
hello-world   2         0         0            0           21h

我注意到我错过了在Minikube环境中可用的kube系统POD,但在我的Fedora设置中没有:

[root@fed-master ~]# kubectl get pods --all-namespaces=true
No resources found.

输出“kubectl describe deploy hello-world”:

[root@fed-master ~]# kubectl describe deploy hello-world
Name:                   hello-world
Namespace:              default
CreationTimestamp:      Fri, 01 Jun 2018 22:50:54 +0200
Labels:                 run=load-balancer-example
Annotations:            deployment.kubernetes.io/revision=1
Selector:               run=load-balancer-example
Replicas:               2 desired | 0 updated | 0 total | 0 available | 2 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  1 max unavailable, 1 max surge
Pod Template:
  Labels:  run=load-balancer-example
  Containers:
   hello-world:
    Image:        gcr.io/google-samples/node-hello:1.0
    Port:         8080/TCP
    Host Port:    0/TCP
    Environment:  <none>
    Mounts:       <none>
  Volumes:        <none>
Conditions:
  Type             Status  Reason
  ----             ------  ------
  Available        False   MinimumReplicasUnavailable
  ReplicaFailure   True    FailedCreate
  Progressing      False   ProgressDeadlineExceeded
OldReplicaSets:    <none>
NewReplicaSet:     hello-world-5b446dd74b (0/2 replicas created)
Events:            <none>

“kubectl describe pods”的输出为空:

[root@fed-master ~]# kubectl describe pods
[root@fed-master ~]# 

“systemctl status kube-controller-manager”的输出:

[root@fed-master kubernetes-cifs-volumedriver]# systemctl status kube-controller-manager 
● kube-controller-manager.service - Kubernetes Controller Manager
   Loaded: loaded (/usr/lib/systemd/system/kube-controller-manager.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-06-04 08:24:47 PDT; 12min ago
     Docs: https://github.com/GoogleCloudPlatform/kubernetes
 Main PID: 577 (kube-controller)
    Tasks: 6 (limit: 19660)
   Memory: 81.4M
      CPU: 8.568s
   CGroup: /system.slice/kube-controller-manager.service
           └─577 /usr/bin/kube-controller-manager --logtostderr=true --v=0 --master=http://fed-master:8080

Jun 04 08:30:26 fed-master kube-controller-manager[577]: I0604 08:30:26.197657     577 event.go:218] Event(v1.ObjectReference{Kind:"DaemonSet", Namespace:"default", Name:"juliohm-cifs-volumedriver-installer", UID:"315149b1-65a4-11e8-8f80-000c29aa0c1d", APIVersion:"apps", ResourceVersion:"17106", FieldPath:""}): type: 'Warning' reason: 'FailedCreate' Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:30:32 fed-master kube-controller-manager[577]: E0604 08:30:32.195467     577 replica_set.go:450] Sync "default/hello-world-5b446dd74b" failed with No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:30:32 fed-master kube-controller-manager[577]: I0604 08:30:32.195988     577 event.go:218] Event(v1.ObjectReference{Kind:"ReplicaSet", Namespace:"default", Name:"hello-world-5b446dd74b", UID:"ce13574b-680b-11e8-826a-000c29aa0c1d", APIVersion:"extensions", ResourceVersion:"18575", FieldPath:""}): type: 'Warning' reason: 'FailedCreate' Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:32:03 fed-master kube-controller-manager[577]: E0604 08:32:03.143290     577 replica_set.go:450] Sync "default/hello-world-5b446dd74b" failed with No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:32:03 fed-master kube-controller-manager[577]: I0604 08:32:03.144832     577 event.go:218] Event(v1.ObjectReference{Kind:"ReplicaSet", Namespace:"default", Name:"hello-world-5b446dd74b", UID:"ce13574b-680b-11e8-826a-000c29aa0c1d", APIVersion:"extensions", ResourceVersion:"18575", FieldPath:""}): type: 'Warning' reason: 'FailedCreate' Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:33:19 fed-master kube-controller-manager[577]: E0604 08:33:19.074485     577 daemon_controller.go:968] No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:33:19 fed-master kube-controller-manager[577]: E0604 08:33:19.075327     577 daemon_controller.go:266] default/juliohm-cifs-volumedriver-installer failed with : No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:33:19 fed-master kube-controller-manager[577]: I0604 08:33:19.076307     577 event.go:218] Event(v1.ObjectReference{Kind:"DaemonSet", Namespace:"default", Name:"juliohm-cifs-volumedriver-installer", UID:"315149b1-65a4-11e8-8f80-000c29aa0c1d", APIVersion:"apps", ResourceVersion:"17106", FieldPath:""}): type: 'Warning' reason: 'FailedCreate' Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:34:56 fed-master kube-controller-manager[577]: E0604 08:34:56.014926     577 replica_set.go:450] Sync "default/hello-world-5b446dd74b" failed with No API token found for service account "default", retry after the token is automatically created and added to the service account
Jun 04 08:34:56 fed-master kube-controller-manager[577]: I0604 08:34:56.015693     577 event.go:218] Event(v1.ObjectReference{Kind:"ReplicaSet", Namespace:"default", Name:"hello-world-5b446dd74b", UID:"ce13574b-680b-11e8-826a-000c29aa0c1d", APIVersion:"extensions", ResourceVersion:"18575", FieldPath:""}): type: 'Warning' reason: 'FailedCreate' Error creating: No API token found for service account "default", retry after the token is automatically created and added to the service account

我会感激任何提示或帮助! 非常感谢你!

0 个答案:

没有答案