How to use Prometheus in Kubernetes with AWS EBS?

Viewed 2390

I created an EBS volume with 30 GiB size. Made two manifest files:

  • pv-ebs.yml
  • pvc-ebs.yml

In 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

in 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"

Use helm installed it: helm install --name prometheus stable/prometheus.

But on the k8s dashboard, got message:

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)

Is there anything wrong about my method?

Pods

enter image description here

Persistent Volumes

enter image description here

2 Answers
Related