0

I am using below manifest file to create sidecar container for existing prometheus pod (kube prometheus stack)

`kind: Pod
apiVersion: v1
metadata:
  name: sidecar-prometheus
spec:
  volumes:
  - name: logs
    emptyDir: {}
  containers:
  - name: sidecar-prom
    image: http://xyz/abc/prometheus/prometheus:v2.36.1
    command: ["/bin/sh"]
    args: ["-c", "while true; do date >> /etc/prometheus/configmaps/token/date.txt; sleep 10; done"]
    volumeMounts:
    - name: logs
      mountPath: /data`

I was expecting the file /etc/prometheus/configmaps/token/date.txt in the main prometheus pod which should be created from the sidecar container.

But after creating this pod, I am unable to see the file /etc/prometheus/configmaps/token/date.txt

Please help me, as I am a beginner to kubernetes.

rock'n rolla
  • 1,883
  • 1
  • 13
  • 19

0 Answers0