Estou executando o cluster do KOPs na AWS.
E tentar montar um volume persistente em um pod, mas o acesso negou o erro nos logs.
Eu criei o volume EBS de 10G em aws e, em seguida, criei PV
e PVC
Minha configuração é assim ...
ubuntu@kops:/new_setup/kubernetes-prometheus$ cat prometheus-volume.yaml
apiVersion: "v1"
kind: "PersistentVolume"
metadata:
name: "pv0001"
namespace: monitoring
spec:
capacity:
storage: "10Gi"
accessModes:
- "ReadWriteOnce"
persistentVolumeReclaimPolicy: Retain
awsElasticBlockStore:
fsType: "ext4"
volumeID: "vol-0f24664921a2f44f2"
ubuntu@kops:/new_setup/kubernetes-prometheus$
ubuntu@kops:/new_setup/kubernetes-prometheus$
ubuntu@kops:/new_setup/kubernetes-prometheus$
ubuntu@kops:/new_setup/kubernetes-prometheus$
ubuntu@kops:/new_setup/kubernetes-prometheus$ cat prometheus-volume-claim.yaml
apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata:
name: "demo"
namespace: monitoring
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 5Gi
e o pod é assim
spec:
containers:
- name: prometheus
image: prom/prometheus:v2.1.0
args:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus/"
ports:
- containerPort: 9090
volumeMounts:
- name: prometheus-config-volume
mountPath: /etc/prometheus/
- name: prometheus-storage-volume
mountPath: /prometheus/
volumes:
- name: prometheus-config-volume
configMap:
defaultMode: 420
name: prometheus-server-conf
- name: prometheus-storage-volume
persistentVolumeClaim:
claimName: demo
Registros de erros:
ubuntu@kops:/new_setup/kubernetes-prometheus$ kubectl logs -f prometheus-deployment-577f466dbd-pwrhq -n monitoring
level=info ts=2018-05-17T05:07:19.468705108Z caller=main.go:225 msg="Starting Prometheus" version="(version=2.1.0, branch=HEAD, revision=85f23d82a045d103ea7f3c89a91fba4a93e6367a)"
level=info ts=2018-05-17T05:07:19.468760626Z caller=main.go:226 build_context="(go=go1.9.2, user=root@6e784304d3ff, date=20180119-12:01:23)"
level=info ts=2018-05-17T05:07:19.468778943Z caller=main.go:227 host_details="(Linux 4.4.115-k8s #1 SMP Thu Feb 8 15:37:40 UTC 2018 x86_64 prometheus-deployment-577f466dbd-pwrhq (none))"
level=info ts=2018-05-17T05:07:19.468792959Z caller=main.go:228 fd_limits="(soft=1048576, hard=1048576)"
level=info ts=2018-05-17T05:07:19.471135017Z caller=web.go:383 component=web msg="Start listening for connections" address=0.0.0.0:9090
level=info ts=2018-05-17T05:07:19.471124083Z caller=main.go:499 msg="Starting TSDB ..."
level=info ts=2018-05-17T05:07:19.471311156Z caller=main.go:386 msg="Stopping scrape discovery manager..."
level=info ts=2018-05-17T05:07:19.471329448Z caller=main.go:400 msg="Stopping notify discovery manager..."
level=info ts=2018-05-17T05:07:19.471338058Z caller=main.go:424 msg="Stopping scrape manager..."
level=info ts=2018-05-17T05:07:19.4713514Z caller=manager.go:460 component="rule manager" msg="Stopping rule manager..."
level=info ts=2018-05-17T05:07:19.471365082Z caller=manager.go:466 component="rule manager" msg="Rule manager stopped"
level=info ts=2018-05-17T05:07:19.4713732Z caller=notifier.go:493 component=notifier msg="Stopping notification manager..."
level=info ts=2018-05-17T05:07:19.471394877Z caller=main.go:382 msg="Scrape discovery manager stopped"
level=info ts=2018-05-17T05:07:19.471413375Z caller=main.go:396 msg="Notify discovery manager stopped"
level=info ts=2018-05-17T05:07:19.4714288Z caller=manager.go:59 component="scrape manager" msg="Starting scrape manager..."
level=info ts=2018-05-17T05:07:19.471445672Z caller=main.go:418 msg="Scrape manager stopped"
level=info ts=2018-05-17T05:07:19.471462046Z caller=main.go:570 msg="Notifier manager stopped"
level=error ts=2018-05-17T05:07:19.473602183Z caller=main.go:579 err="Opening storage failed open DB in /prometheus/: open /prometheus/385001787: permission denied"
level=info ts=2018-05-17T05:07:19.473642793Z caller=main.go:581 msg="See you next time!"
Tags aws kubernetes aws-elb