Update Untime secret configuration

gitea_admin 2026-04-02 13:13:51 +00:00
parent 6d0e89fd7f
commit b20e7bbb7a

@ -1,18 +1,18 @@
Runtime configuration Runtime configuration
When you develop an integration with Camel K there are many ways you can provide a configuration resource to the runtime Integration. Since we are dealing with Kubernetes we use Configmap or Secret. The kamel run command is provided with a --config flag that help you setting any configuration resource your Integration need. When you develop an integration with Camel K there are many ways you can provide a configuration resource to the runtime Integration. Since we are dealing with Kubernetes we use Configmap or Secret. The kamel run command is provided with a `--config `flag that help you setting any configuration resource your Integration need.
The runtime configuration are expected to be encoded in UTF-8 as they are processed by runtime Camel Context and parsed as property files. These resources are materialized as files in a well known path in the Integration Pod. The mount trait will be declared on the Integration. They are also made available on the classpath in order to ease their usage directly from the Route. If you need to provide a non UTF-8 (ie, a binary resource) you may look for --resource flag instead. The runtime configuration are expected to be encoded in UTF-8 as they are processed by runtime Camel Context and parsed as property files. These resources are materialized as files in a well known path in the Integration Pod. The mount trait will be declared on the Integration. They are also made available on the classpath in order to ease their usage directly from the Route. If you need to provide a non UTF-8 (ie, a binary resource) you may look for --resource flag instead.
the scope of --config global option had different meaning prior Camel K version 1.5. The old global --config has been replaced with --kube-config since Camel K version 1.5. the scope of -`-config `global option had different meaning prior Camel K version 1.5. The old global `--config `has been replaced with `--kube-config `since Camel K version 1.5.
Runtime configmap configuration Runtime configmap configuration
In a Kubernetes world were dealing with Configmap containing configuration previously stored in the platform. When you need to materialize a Configmap into a file configuration available at your Integration, you can use the --config configmap syntax. In a Kubernetes world were dealing with Configmap containing configuration previously stored in the platform. When you need to materialize a Configmap into a file configuration available at your Integration, you can use the --config configmap syntax.
As an example, lets create a Configmap named my-cm containing certain information. You can alternatively use any Configmap youve already stored in your cluster: As an example, lets create a Configmap named my-cm containing certain information. You can alternatively use any Configmap youve already stored in your cluster:
kubectl create configmap my-cm --from-literal=my-configmap-key="configmap content" `kubectl create configmap my-cm --from-literal=my-configmap-key="configmap content"`
We want to use the materialized file in an integration: We want to use the materialized file in an integration:
config-configmap-route.yaml ```config-configmap-route.yaml
- from: - from:
uri: "timer:configmap" uri: "timer:configmap"
steps: steps:
@ -20,7 +20,7 @@ config-configmap-route.yaml
simple: "resource:classpath:my-configmap-key" simple: "resource:classpath:my-configmap-key"
- setBody: - setBody:
simple: "configmap content is: ${body}" simple: "configmap content is: ${body}"
- to: "log:info" - to: "log:info"```
You can see that were expecting to use a my-configmap-key file stored somewhere in the classpath. In order to materialize the Configmap will be as easy as running the --config configmap syntax: You can see that were expecting to use a my-configmap-key file stored somewhere in the classpath. In order to materialize the Configmap will be as easy as running the --config configmap syntax:
kamel run --config configmap:my-cm config-configmap-route.yaml kamel run --config configmap:my-cm config-configmap-route.yaml
@ -35,7 +35,7 @@ As an example, lets create a Secret named my-sec containing certain informati
kubectl create secret generic my-sec --from-literal=my-secret-key="very top secret" kubectl create secret generic my-sec --from-literal=my-secret-key="very top secret"
We want to use the materialized secret file in an integration: We want to use the materialized secret file in an integration:
config-secret-route.yaml ```config-secret-route.yaml
- from: - from:
uri: "timer:secret" uri: "timer:secret"
steps: steps:
@ -43,5 +43,5 @@ config-secret-route.yaml
simple: "resource:classpath:my-secret-key" simple: "resource:classpath:my-secret-key"
- setBody: - setBody:
simple: "secret content is: ${body}" simple: "secret content is: ${body}"
- to: "log:info" - to: "log:info"```
You can see that were expecting to use a my-secret-key file stored somewhere in the classpath. In order to materialize the Secret will be as easy as running the --config secret syntax: You can see that were expecting to use a my-secret-key file stored somewhere in the classpath. In order to materialize the Secret will be as easy as running the --config secret syntax: