= Mount Trait

// Start of autogenerated code - DO NOT EDIT! (badges)
// End of autogenerated code - DO NOT EDIT! (badges)
// Start of autogenerated code - DO NOT EDIT! (description)
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**.

NOTE: The mount trait is a *platform trait* and cannot be disabled by the user.

// End of autogenerated code - DO NOT EDIT! (description)
// Start of autogenerated code - DO NOT EDIT! (configuration)
== Configuration

Trait properties can be specified when running any integration with the CLI:
[source,console]
----
$ kamel run --trait mount.[key]=[value] --trait mount.[key2]=[value2] integration.yaml
----
The following configuration options are available:

[cols="2m,1m,5a"]
|===
|Property | Type | Description

| mount.enabled
| bool
| Deprecated: no longer in use.

| mount.configs
| []string
| 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

| mount.resources
| []string
| 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

| mount.volumes
| []string
| 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.

| mount.empty-dirs
| []string
| A list of EmptyDir volumes to be mounted. An optional size limit may be configured (default 500Mi).
Syntax: name:/container/path[:sizeLimit]

| mount.hot-reload
| bool
| Enable "hot reload" when a secret/configmap mounted is edited (default `false`). The configmap/secret must be
marked with `camel.apache.org/integration` label to be taken in account. The resource will be watched for any kind change, also for
changes in metadata.

| mount.scan-kamelets-implicit-label-secrets
| bool
| Deprecated: no longer available since version 2.5.

|===

// End of autogenerated code - DO NOT EDIT! (configuration)

== 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.

[source,console]
$ 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.

NOTE: if the volume exists, then it would reuse it.
