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
These configurations require deep Kubernetes and Connectware expertise. Misconfiguration can compromise system stability, security, and functionality. Always thoroughly test before applying to production environments.
Cybus does not officially support modified installations. We recommend informing Customer Success of your planned changes to identify compatibility concerns.
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:
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
If you define extraVolumeMounts, you must also define the corresponding volume in extraVolumes. Defining a volume mount without its underlying volume definition causes the deployment to fail.
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.
The connectware-agent Helm chart can be deployed standalone or as a subchart within the connectware Helm chart. Both deployment modes use the same values structure, but when used as a subchart you need to configure it in the connectwareAgent Helm value section.
Configure init containers globally with protocolMapperAgentDefaults or per-agent with protocolMapperAgents[]. Per-agent values completely replace the defaults.
Applying to all agents (default)
Applying to a specific agent
Deploying agents as part of the connectware Helm chart with default init containers
Replace ${LICENSE_KEY} with your Connectware license key.
Per-agent containers replace global defaults
When you set extraInitContainers on a specific agent in protocolMapperAgents[], it completely replaces the value from protocolMapperAgentDefaults. This allows you to apply init containers to all agents by default, then override individual agents. Set extraInitContainers: [] on a specific agent to exclude it from default init containers.
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?

