1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/serverless-admin-init-containers.adoc
2022-06-22 17:10:39 +00:00

48 lines
1.6 KiB
Plaintext

// Module included in the following assemblies:
//
// * /serverless/admin_guide/serverless-configuration.adoc
:_content-type: PROCEDURE
[id="serverless-admin-init-containers_{context}"]
= Enabling init containers
link:https://kubernetes.io/docs/concepts/workloads/pods/init-containers/[Init containers] are specialized containers that are run before application containers in a pod. They are generally used to implement initialization logic for an application, which may include running setup scripts or downloading required configurations. You can enable the use of init containers for Knative services by modifying the `KnativeServing` custom resource (CR).
:FeatureName: Init containers for Knative services
include::snippets/technology-preview.adoc[leveloffset=+1]
[NOTE]
====
Init containers may cause longer application start-up times and should be used with caution for serverless applications, which are expected to scale up and down frequently.
====
.Prerequisites
* You have installed {ServerlessOperatorName} and Knative Serving on your cluster.
ifdef::openshift-enterprise[]
* You have cluster administrator permissions.
endif::[]
ifdef::openshift-dedicated,openshift-rosa[]
* You have cluster or dedicated administrator permissions.
endif::[]
.Procedure
* Enable the use of init containers by adding the `kubernetes.podspec-init-containers` flag to the `KnativeServing` CR:
+
.Example KnativeServing CR
[source,yaml]
----
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
name: knative-serving
spec:
config:
features:
kubernetes.podspec-init-containers: enabled
...
----