2

我是 Kubernetes 新手,并且正在遵循本指南

在本地集群上部署 EFK 堆栈。创建 statefulset.yml 文件后,当我尝试时kubectl create -f statefulset.yml,pod 永远不会启动。

跑步时kubectl rollout status ...我得到Waiting for 3 pods to be ready...

我正在使用 docker-desktop 集群。

NAME                  READY   STATUS    RESTARTS   AGE
pod/elasticsearch-0   0/1     Pending   0          45m


NAME                    TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)             AGE
service/elasticsearch   ClusterIP   None         <none>        9200/TCP,9300/TCP   30h




NAME                             READY   AGE
statefulset.apps/elasticsearch   0/3     45m


Name:           elasticsearch-0
Namespace:      logging
Priority:       0
Node:           <none>
Labels:         app=elasticsearch
                controller-revision-hash=elasticsearch-6dd997c6d8
                statefulset.kubernetes.io/pod-name=elasticsearch-0
Annotations:    <none>
Status:         Pending
IP:
Controlled By:  StatefulSet/elasticsearch
Init Containers:
  fix-permissions:
    Image:      busybox
    Port:       <none>
    Host Port:  <none>
    Command:
      sh
      -c
      chown -R 1000:1000 /usr/share/elasticsearch/data
    Environment:  <none>
    Mounts:
      /usr/share/elasticsearch/data from data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-gvqz5 (ro)
  increase-vm-max-map:
    Image:      busybox
    Port:       <none>
    Host Port:  <none>
    Command:
      sysctl
      -w
      vm.max_map_count=262144
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-gvqz5 (ro)
  increase-fd-ulimit:
    Image:      busybox
    Port:       <none>
    Host Port:  <none>
    Command:
      sh
      -c
      ulimit -n 65536
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-gvqz5 (ro)
Containers:
  elasticsearch:
    Image:       docker.elastic.co/elasticsearch/elasticsearch:7.2.0
    Ports:       9200/TCP, 9300/TCP
    Host Ports:  0/TCP, 0/TCP
    Limits:
      cpu:  1
    Requests:
      cpu:  100m
    Environment:
      cluster.name:                  k8s-logs
      node.name:                     elasticsearch-0 (v1:metadata.name)
      discovery.seed_hosts:          elasticsearch-0.elasticsearch,elasticsearch-1.elasticsearch,elasticsearch-2.elasticsearch
      cluster.initial_master_nodes:  elasticsearch-0,elasticsearch-1,elasticsearch-2
      ES_JAVA_OPTS:                  -Xms512m -Xmx512m
    Mounts:
      /usr/share/elasticsearch/data from data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-gvqz5 (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  data-elasticsearch-0
    ReadOnly:   false
  default-token-gvqz5:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-gvqz5
    Optional:    false
QoS Class:       Burstable
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  3m39s (x44 over 64m)  default-scheduler  pod has unbound immediate PersistentVolumeClaims
4

0 回答 0