Kubernetes how to create a sidecar which runs initialization and terminate

3/15/2019

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.

-- Kok How Teh
execution
initialization
kubernetes
sleep

1 Answer

4/22/2019

I use Job to accomplish the task.

apiVersion: batch/v1
kind: Job
-- Kok How Teh
Source: StackOverflow