我创建了一个大小为 30 GiB 的 EBS 卷。制作了两个 list 文件:
- pv-ebs.yml
- pvc-ebs.yml
在 pv-ebs.yml 中:
apiVersion: v1
kind: PersistentVolume
metadata:
name: ebs
spec:
capacity:
storage: 30Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
awsElasticBlockStore:
fsType: ext4
# The EBS volume ID
volumeID: vol-111222333aaabbbccc
在 pvc-ebs.yml 中
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: prometheus-prometheus-alertmanager
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
selector:
matchLabels:
release: "stable"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: prometheus-prometheus-server
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
selector:
matchLabels:
release: "stable"
使用helm
安装它:helm install --name prometheus stable/prometheus
。
但是在 k8s 仪表板上,收到消息:
prometheus-prometheus-alertmanager-3740839786-np7kb
No nodes are available that match all of the following predicates:: NoVolumeZoneConflict (2).
prometheus-prometheus-server-3176041168-m3w2g
PersistentVolumeClaim is not bound: "prometheus-prometheus-server" (repeated 2 times)
我的方法有问题吗?
Pod
持久卷
最佳答案
创建EBS时,它被配置在特定的可用区中,并且不能跨区域挂载。如果同一区域中没有可用的节点来调度 pod,则 pod 不会启动。
另一件事是,通过正确配置的 kube 集群,您根本不需要自己创建 PV,只需创建 PVC 并让 dynamic provisioning做这件事。
关于kubernetes - 如何在 Kubernetes 中使用 Prometheus 和 AWS EBS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47527314/