From 6d0e89fd7f5fc3b90fea38987682e21069a1a0c9 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Thu, 2 Apr 2026 13:12:41 +0000 Subject: [PATCH] Update Untime secret configuration --- Untime-secret-configuration.md | 48 ++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/Untime-secret-configuration.md b/Untime-secret-configuration.md index 31f1a50..85fa76a 100644 --- a/Untime-secret-configuration.md +++ b/Untime-secret-configuration.md @@ -1,3 +1,47 @@ -# New Page +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. -Start writing your content here... \ No newline at end of file +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. +Runtime configmap configuration +In a Kubernetes world we’re 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, let’s create a Configmap named my-cm containing certain information. You can alternatively use any Configmap you’ve already stored in your cluster: + +kubectl create configmap my-cm --from-literal=my-configmap-key="configmap content" +We want to use the materialized file in an integration: + +config-configmap-route.yaml +- from: + uri: "timer:configmap" + steps: + - setBody: + simple: "resource:classpath:my-configmap-key" + - setBody: + simple: "configmap content is: ${body}" + - to: "log:info" +You can see that we’re 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 +As soon as the Integration starts, the Camel K operator will take care to mount a volume with the Configmap 's content. + +you can provide a Configmap which is not yet available on the cluster. The Integration won’t start until the resource will be made available. +Runtime secret configuration +We can apply the very same concept seen in the previous section for the Kubernetes Secret 's. + +As an example, let’s create a Secret named my-sec containing certain information. You can alternatively use any Secret you’ve already stored in your cluster: + +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: + +config-secret-route.yaml +- from: + uri: "timer:secret" + steps: + - setBody: + simple: "resource:classpath:my-secret-key" + - setBody: + simple: "secret content is: ${body}" + - to: "log:info" +You can see that we’re 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: \ No newline at end of file