Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcruzdev committed Apr 11, 2024
1 parent 4337450 commit 3d415a3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
34 changes: 34 additions & 0 deletions docs/src/main/asciidoc/deploying-to-kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,23 @@ This would generate the following in the `env` section of your container:
optional: false
----

It's also possible to add a prefix when you are generating env from Secret, the following configuration creates environment variable from Secret with key `foo` adding a prefix `BAR`:

[source,properties]
----
quarkus.kubernetes.env.secrets=foo[BAR]
----

This would generate the following in the `env` section of your container:
[source,yaml]
----
- env:
envFrom:
- secretRef:
name: foo
prefix: BAR
----

===== Environment variables from ConfigMap

To add all key/value pairs from `ConfigMap` as environment variables just apply the following configuration, separating each
Expand Down Expand Up @@ -512,6 +529,23 @@ This would generate the following in the `env` section of your container:
optional: false
----

It's also possible to add a prefix when you are generating env from ConfigMap, the following configuration creates environment variable from ConfigMap with key `foo` adding a prefix `BAR`:

[source,properties]
----
quarkus.kubernetes.env.configmaps=foo[BAR]
----

This would generate the following in the `env` section of your container:
[source,yaml]
----
- env:
envFrom:
- configMapRef:
name: foo
prefix: BAR
----

===== Environment variables from fields

It's also possible to use the value from another field to add a new environment variable by specifying the path of the field to be used as a source, as follows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public static KubernetesEnvBuildItem createSimpleVar(String name, String value,
}

public static KubernetesEnvBuildItem createFromConfigMapKey(String varName, String key, String configmap, String target,
String prefix,
boolean... oldStyle) {
String prefix, boolean... oldStyle) {
return create(varName, key, null, configmap, null, target, prefix, isOldStyle(oldStyle));
}

Expand Down

0 comments on commit 3d415a3

Please sign in to comment.