generated from redhat-developer/new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RHIDP-4780: Document per-ConfigMap/Secret configuration of mountPath #842
Open
pabel-rh
wants to merge
7
commits into
redhat-developer:release-1.4
Choose a base branch
from
pabel-rh:rhidp-4780
base: release-1.4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c2f4b6e
Content added
pabel-rh 8574215
Fixing indentation error
pabel-rh 488a600
Incorporated peer review comments
pabel-rh 86bb3d2
Incorporate Gennady's comment
pabel-rh 2ee671c
Updated release notes link for the new feature
pabel-rh 326b6dc
Incorporate comments
pabel-rh e746cbf
Incorporated comments
pabel-rh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...mounting-additional-files-in-your-custom-configuration-using-rhdh-operator.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[id="mounting-additional-files-in-your-custom-configuration-using-rhdh-operator"] | ||
= Mounting additional files in your custom configuration using the {product} operator | ||
|
||
You can use the {product-short} Operator to mount extra files, such as config maps and secrets, to the container in a preferred location. | ||
|
||
The `mountPath` field specifies the location where a ConfigMap or Secret is mounted. The behavior of the mount, whether it includes or excludes a `subPath`, depends on the specification of the `key` or `mountPath` fields. | ||
|
||
* If `key` and `mountPath` are not specified: Each key or value is mounted as a `filename` or content with a `subPath`. | ||
* If `key` is specified with or without `mountPath`: The specified key or value is mounted with a `subPath`. | ||
* If only `mountPath` is specified: A directory containing all the keys or values is mounted without a `subPath`. | ||
|
||
[NOTE] | ||
==== | ||
* {ocp-short} does not automatically update a volume mounted with subPath. By default, the {product-very-short} operator monitors these ConfigMaps or Secrets and refreshes the {product-very-short} Pod when changes occur. | ||
* For security purposes, {product} does not give the Operator Service Account read access to Secrets. As a result, mounting files from Secrets without specifying both mountPath and key is not supported. | ||
==== | ||
|
||
|
||
.Prerequisites | ||
* You have developer permissions to access the {ocp-short} cluster containing your {product-short} instance using the {openshift-cli}. | ||
* link:{installing-on-ocp-book-url}[Your {ocp-short} administrator has installed the {product} Operator in {ocp-short}]. | ||
|
||
.Procedure | ||
|
||
. In {ocp-short}, create your config map or secret with the following YAML codes: | ||
+ | ||
.Minimal `{my-extra-file-configmap}` config map example | ||
==== | ||
[source,yaml,subs="+attributes,+quotes"] | ||
---- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {my-extra-file-configmap} | ||
data: | ||
file11.txt: | | ||
My file11 content | ||
file 12.txt: | | ||
My file12 content | ||
---- | ||
==== | ||
+ | ||
.Minimal `{my-product-secrets}` secret example | ||
==== | ||
[source,yaml,subs="+attributes,+quotes"] | ||
---- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {my-product-secrets} | ||
StringData: | ||
secret11.txt: | | ||
secret-content | ||
---- | ||
==== | ||
For more information, see xref:provisioning-your-custom-configuration[Provisioning and using your custom {product} configuration]. | ||
|
||
. Set the value of the `configMaps name` to the name of the config map or `secrets name` to the name of the secret file in your `{product-custom-resource-type}` CR. For example: | ||
==== | ||
[source,yaml,subs="+attributes,+quotes"] | ||
---- | ||
spec: | ||
application: | ||
extraFiles: | ||
mountPath: /my/path | ||
configMaps: | ||
- name: {my-extra-file-configmap} | ||
key: file12.txt | ||
mountPath: /my/my-rhdh-config-map/path | ||
secrets: | ||
- name: {my-product-secrets} | ||
key: secret11.txt | ||
mountPath: /my/my-rhdh-secret/path | ||
|
||
---- | ||
==== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is must clearer - thank you! The only comment I have is that Kubernetes formats these objects as ConfigMap and Secret (capitalized that way) so we should do the same in our docs. Please forgive me for not noticing that earlier!