A k8s pod having two containers. One of the containers has finished its job, so its state is as below:
Container1
State: Terminated
Reason: Completed
Ready: False
Container 2
State: Running
Ready: True
And this is what I expect. Container 1should come and exit once the job is done. Container 2 should keep running alone.
But pod having container 1 and container 2 has its state as Not Ready which I want to change to Ready state so that it can be reached by service
How can I bring this pod to Ready state
Kubernetes init containers will satisfy your requirement. Please take a look at here.