- 已编辑
prometheus-k8s-0 启动失败,一直 pending 状态。
在 event 中看到了 Warning : didn’t find available persistent volumes to bind。没有挂载卷,请问该怎么操作,去挂载卷?还没搞懂「卷」是什么,不知道该怎么操作。
kubectl describe pod prometheus-k8s-0 -n kubesphere-monitoring-system
.
.
.
Warning FailedScheduling 25m default-scheduler 0/1 nodes are available: 1 node(s) didn't find available persistent volumes to bind.
kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 26h
kubectl get pvc -A
NAMESPACE NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
kubesphere-monitoring-system prometheus-k8s-db-prometheus-k8s-0 Pending local-storage 26h
kubectl describe pvc prometheus-k8s-db-prometheus-k8s-0 -n kubesphere-monitoring-system
.
.
.
Normal WaitForPodScheduled 52s (x142 over 35m) persistentvolume-controller waiting for pod prometheus-k8s-0 to be scheduled
下面是pod
的describe
信息:
Name: prometheus-k8s-0
Namespace: kubesphere-monitoring-system
Priority: 0
Node: <none>
Labels: app=prometheus
controller-revision-hash=prometheus-k8s-85b55f7b4b
prometheus=k8s
statefulset.kubernetes.io/pod-name=prometheus-k8s-0
Annotations: <none>
Status: Pending
IP:
IPs: <none>
Controlled By: StatefulSet/prometheus-k8s
Containers:
prometheus:
Image: prom/prometheus:v2.26.0
Port: 9090/TCP
Host Port: 0/TCP
Args:
--web.console.templates=/etc/prometheus/consoles
--web.console.libraries=/etc/prometheus/console_libraries
--config.file=/etc/prometheus/config_out/prometheus.env.yaml
--storage.tsdb.path=/prometheus
--storage.tsdb.retention.time=7d
--web.enable-lifecycle
--storage.tsdb.no-lockfile
--query.max-concurrency=1000
--web.route-prefix=/
Limits:
cpu: 4
memory: 16Gi
Requests:
cpu: 200m
memory: 400Mi
Liveness: http-get http://:web/-/healthy delay=0s timeout=3s period=5s #success=1 #failure=6
Readiness: http-get http://:web/-/ready delay=0s timeout=3s period=5s #success=1 #failure=120
Environment: <none>
Mounts:
/etc/prometheus/certs from tls-assets (ro)
/etc/prometheus/config_out from config-out (ro)
/etc/prometheus/rules/prometheus-k8s-rulefiles-0 from prometheus-k8s-rulefiles-0 (rw)
/prometheus from prometheus-k8s-db (rw,path="prometheus-db")
/var/run/secrets/kubernetes.io/serviceaccount from prometheus-k8s-token-k2xnk (ro)
prometheus-config-reloader:
Image: kubesphere/prometheus-config-reloader:v0.42.1
Port: <none>
Host Port: <none>
Command:
/bin/prometheus-config-reloader
Args:
--log-format=logfmt
--reload-url=http://localhost:9090/-/reload
--config-file=/etc/prometheus/config/prometheus.yaml.gz
--config-envsubst-file=/etc/prometheus/config_out/prometheus.env.yaml
Limits:
memory: 25Mi
Requests:
memory: 25Mi
Environment:
POD_NAME: prometheus-k8s-0 (v1:metadata.name)
Mounts:
/etc/prometheus/config from config (rw)
/etc/prometheus/config_out from config-out (rw)
/var/run/secrets/kubernetes.io/serviceaccount from prometheus-k8s-token-k2xnk (ro)
rules-configmap-reloader:
Image: jimmidyson/configmap-reload:v0.3.0
Port: <none>
Host Port: <none>
Args:
--webhook-url=http://localhost:9090/-/reload
--volume-dir=/etc/prometheus/rules/prometheus-k8s-rulefiles-0
Limits:
memory: 25Mi
Requests:
memory: 25Mi
Environment: <none>
Mounts:
/etc/prometheus/rules/prometheus-k8s-rulefiles-0 from prometheus-k8s-rulefiles-0 (rw)
/var/run/secrets/kubernetes.io/serviceaccount from prometheus-k8s-token-k2xnk (ro)
Conditions:
Type Status
PodScheduled False
Volumes:
prometheus-k8s-db:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: prometheus-k8s-db-prometheus-k8s-0
ReadOnly: false
config:
Type: Secret (a volume populated by a Secret)
SecretName: prometheus-k8s
Optional: false
tls-assets:
Type: Secret (a volume populated by a Secret)
SecretName: prometheus-k8s-tls-assets
Optional: false
config-out:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
prometheus-k8s-rulefiles-0:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: prometheus-k8s-rulefiles-0
Optional: false
prometheus-k8s-token-k2xnk:
Type: Secret (a volume populated by a Secret)
SecretName: prometheus-k8s-token-k2xnk
Optional: false
QoS Class: Burstable
Node-Selectors: kubernetes.io/os=linux
Tolerations: dedicated=monitoring:NoSchedule
node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 26h default-scheduler 0/1 nodes are available: 1 node(s) didn't find available persistent volumes to bind.
Warning FailedScheduling 51m default-scheduler 0/1 nodes are available: 1 node(s) didn't find available persistent volumes to bind.
Warning FailedScheduling 25m default-scheduler 0/1 nodes are available: 1 node(s) didn't find available persistent volumes to bind.