-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
KEP-4788: Support mountPath replacing variable references with the values of given EnvVar #4820
base: master
Are you sure you want to change the base?
Conversation
dongjiang1989
commented
Sep 2, 2024
- One-line PR description: Support mountPath replacing variable references with the values of given EnvVar
- Issue link: Support mountPath replacing variable references with the values of given EnvVar #4788
- Other comments: feat(kubelet): support mountPath replacing variable references with the values of given EnvVar kubernetes#125587
Signed-off-by: dongjiang1989 <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dongjiang1989 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @dongjiang1989! |
Hi @dongjiang1989. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: dongjiang1989 <[email protected]>
args: | ||
- --log_file=$(LOG_MOUNT_PATH)/myapp.log | ||
volumeMounts: | ||
- mountPath: $(LOG_MOUNT_PATH) #support mountPath env |
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.
change mountPath
or add mountPathExpr
?
Co-authored-by: Itamar Holder <[email protected]>
/ok-to-test |
Signed-off-by: dongjiang1989 <[email protected]>
/retest |
/sig sig-node |
@dongjiang1989: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Thanks. @kannon92 PTAL |
metadata: | ||
name: my-configMap | ||
data: | ||
LOG_MOUNT_PATH: "/opt/somepath" |
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.
Configmap can be updated, and what is the behavior when someone changed the configmap? Does this mean that kubelet should change the mountPath accordingly? It is weird to me.
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.
+1, we shouldn't decouple environment variables from the pod itself, this seems dangerous and not a good design.
|
||
#### Story 1 | ||
|
||
I used a configMap to store the mount path value, but when i call in my pod it doesn't work it seems that the mountPath property can not be assigned to an env variable. |
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.
Maybe you can achieve something similar using an initContainer. The initContainer can write the required paths from specific ConfigMaps to a particular path within the pod, and the application container can directly read the required paths from that specific path.