My requirement is to do curl in my init container and mount the results obtain from curl command as file or env variable to pod.
Is it possible to do in init container ?
My requirement is to do curl in my init container and mount the results obtain from curl command as file or env variable to pod.
Is it possible to do in init container ?
Yes it is possible. As a file will be easier. The official docs have the exact same example: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/. See
volumes:
- name: workdir
emptyDir: {}
Another docs example: https://kubernetes.io/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume/