Mount Trait
The Mount trait can be used to configure volumes mounted on the Integration Pods.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
The mount trait is a platform trait and cannot be disabled by the user. |
Configuration
Trait properties can be specified when running any integration with the CLI:
$ kamel run --trait mount.[key]=[value] --trait mount.[key2]=[value2] integration.yaml
The following configuration options are available:
Property | Type | Description |
---|---|---|
|
| Deprecated: no longer in use. |
|
| A list of configuration pointing to configmap/secret. The configuration are expected to be UTF-8 resources as they are processed by runtime Camel Context and tried to be parsed as property files. They are also made available on the classpath in order to ease their usage directly from the Route. Syntax: [configmap|secret]:name[/key], where name represents the resource name and key optionally represents the resource key to be filtered |
|
| A list of resources (text or binary content) pointing to configmap/secret. The resources are expected to be any resource type (text or binary content). The destination path can be either a default location or any path specified by the user. Syntax: [configmap|secret]:name[/key][@path], where name represents the resource name, key optionally represents the resource key to be filtered and path represents the destination path |
|
| A list of Persistent Volume Claims to be mounted. Syntax: [pvcname:/container/path]. If the PVC is not found, the Integration fails. You can use the syntax [pvcname:/container/path:size:accessMode<:storageClass>] to create a dynamic PVC based on the Storage Class provided or the default cluster Storage Class. However, if the PVC exists, the operator would mount it. |
|
| A list of EmptyDir volumes to be mounted. An optional size limit may be configured (default 500Mi). Syntax: name:/container/path[:sizeLimit] |
|
| Enable "hot reload" when a secret/configmap mounted is edited (default |
|
| Deprecated: no longer available since version 2.5. |
Dynamic creation of PersistentVolumeClaims
If your cluster has some StorageClass defined, you can configure mount.volume
to create one PersistentVolume on your behalf. This is going to be mounted to the application Pod, according to the configuration given. See Kubernetes documentation about StorageClass to learn more.
$ kamel run test.yaml -t mount.volumes=my-pvc:/tmp/my-pvc:10Mi:ReadOnlyMany
The above command would create a new volume on the fly if it does not exists using "default" StorageClass. You can specify any StorageClass as configuration.
if the volume exists, then it would reuse it. |