For the complete documentation index, see llms.txt. This page is also available as Markdown.

Adding Init Containers

Attach init containers to Connectware and Connectware agent components for setup tasks, dependency checking, and configuration preparation.

Init containers run to completion before the main application container starts, enabling pre-flight tasks and dependency validation.

Advanced configuration, use with caution

When to Use Init Containers

Init containers execute sequentially before the main container launches. Use init containers when you need to perform one-time setup tasks that must complete before the application starts.

Common use cases:

  • Pre-populate volumes: Download files, generate certificates, or prepare data that the main container requires at startup.

  • Wait for dependencies: Block startup until external services (databases, APIs, network resources) become available.

  • Process configuration: Transform, validate, or template configuration files before the main application consumes them.

  • Adjust permissions: Modify file ownership or access rights on mounted volumes before the application process attempts to use them.

  • Initialize networking: Configure routing rules, iptables entries, or service mesh sidecars (such as Istio) before application traffic begins.

Configuration Values

The following Helm values attach init containers and storage to Connectware components:

Value
Description

extraInitContainers

List of init containers to run within the pod before the main Connectware container starts.

extraVolumes

List of volumes attached at the pod level. Can be mounted by both the main Connectware container and init containers.

extraVolumeMounts

Volume mounts for the main Connectware container of the pod.

Volume mounts require a matching volume

Adding Init Containers

To add an initialization container to a component, use the extraInitContainers Helm value. This Helm value accepts a standard Kubernetes list of container definitions that will be executed before the component's main container.

Execution order of init containers

Some Connectware components (such as authServer) include built-in init containers. Containers defined in extraInitContainers always execute before built-in init containers, but before the main Connectware container starts.

Example: Adding a Basic Init Container

The following tabs show how to configure init containers for the connectware Helm chart and the connectware-agent Helm chart.

Using Shared Volumes and Existing Storage

Init containers can share data with the main container through volumes, or mount existing Kubernetes resources (ConfigMaps, Secrets, PersistentVolumeClaims).

Define pod-level volumes using extraVolumes and mount them with extraVolumeMounts. Volume configuration works identically to sidecars. See Adding Sidecars and Volumes for detailed examples.

Verification

After applying your changes, verify that init containers execute successfully:

Replace ${NAMESPACE} with your Connectware namespace, ${POD_NAME} with the pod name, and ${INIT_CONTAINER_NAME} with the name you defined in extraInitContainers.

Result

Init containers show a Completed status in the pod description. The main container starts only after all init containers complete successfully. If an init container fails, the pod enters a CrashLoopBackOff or Init:Error state.

Last updated

Was this helpful?