I need a sidecar in kubernetes cluster which runs initialization script and then terminates or sleep forever. I can't do this in postStart as postStart does not guarantee the CMD / ENTRYPOINT in main container has started. Any advice and insight is appreciated.
I use Job to accomplish the task.
apiVersion: batch/v1
kind: Job