OpenShift Init Container: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=External=


* https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
* https://docs.openshift.com/container-platform/latest/architecture/core_concepts/containers_and_images.html#init-containers
* https://docs.openshift.com/container-platform/latest/architecture/core_concepts/containers_and_images.html#init-containers


Line 7: Line 6:


* [[OpenShift_Pod_Concepts#Init_Container|OpenShift Pod Concepts]]
* [[OpenShift_Pod_Concepts#Init_Container|OpenShift Pod Concepts]]
* [[Kubernetes Init Containers]]


=Overview=
=Overview=


An ''init container'' is a specialized container that runs before the [[OpenShift_Pod_Concepts#Application_Container|application containers]], and can contain utilities or setup scripts not present in the application image. If a pod declares init containers, the application containers are only run after all init container complete successfully.
{{Internal|Kubernetes Init Containers|Kubernetes Init Containers}}
 
An init container always runs to completion, and if more than one init containers are declared, each one is executed sequentially and must complete successfully before the next one is started. This is the reason init containers do not support readiness probes: they must succeed. If an init container fails, Kubernetes will restart the Pod repeatedly until the init container succeeds, unless the pod has a "[[OpenShift_Pod_Definition#restartPolicy|restartPolicy]]" of "Never".
 
Init containers support all the fields and the features of the [[OpenShift_Pod_Concepts#Application_Container|application containers]] including resource limits, volumes and security settings. However, the resource requests and limits for an Init Container are handled slightly differently, as described in [[#Resources|Resources]] below.
 
=Declaration=
 
Declared within the context of a pod, under the "[[OpenShift_Pod_Definition#initContainers|initContainers]]" field.

Latest revision as of 02:04, 19 September 2019