-
Notifications
You must be signed in to change notification settings - Fork 352
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
resources: add options to configure mount path and key #554
Conversation
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 very useful. We'll be able to use it to customise the Prometheus JMX exporter configuration for example.
I wonder whether we could be closer to existing K8s semantic, e.g. instead of:
resources:
- contentRef: nexus3
contentKey: nexus3-persistent-template.yaml
mountPath: /etc/camel/resources/n3
name: nexus.yaml
type: data
Writing:
resources:
- configMap:
name: nexus3
subPath: nexus3-persistent-template.yaml
mountPath: /etc/camel/resources/n3/nexus.yaml
type: data
do you have a reference of the behavior so I can try to mimic it as much as
possible ? i.e. what’s the behavior when sub path is not set ?
On Wed, 13 Mar 2019 at 20:59, Antonin Stefanutti ***@***.***> wrote:
***@***.**** commented on this pull request.
This is very useful. We'll be able to use it to customise the Prometheus
JMX exporter configuration for example.
I wonder whether we could be closer to existing K8s semantic, e.g. instead
of:
resources:
- contentRef: nexus3
contentKey: nexus3-persistent-template.yaml
mountPath: /etc/camel/resources/n3
name: nexus.yaml
type: data
Writing:
resources:
- configMap:
name: nexus3
subPath: nexus3-persistent-template.yaml
mountPath: /etc/camel/resources/n3/nexus.yaml
type: data
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#554 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AByEhQfiNLDvphkf_v1SOAgyoZcOoU9sks5vWVi0gaJpZM4buTm->
.
--
--
Luca Burgazzoli
|
could we have a resource that is not translated in a configmap? If yes probably I would not bother with changing the syntax... |
if An alternative would be to use the
But the added value of We could also reuse the
|
the problem with subpath is that it is not allowed in knative
On Wed, 13 Mar 2019 at 22:12, Antonin Stefanutti ***@***.***> wrote:
if subPath is empty, it defaults to \, that the corresponding volume root
directory gets mounted, which for a config map is all the keys (c.f.
kubernetes/kubernetes#22575
<kubernetes/kubernetes#22575>). In that case
mountPath must be a directory.
An alternative would be to use the path field to specify the file path
for a specific ConfigMap item, e.g.:
resources:
- configMap:
name: nexus3
items:
- key: nexus3-persistent-template.yaml
path: keys
mountPath: /etc/camel/resources/n3/
type: data
See:
https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#add-configmap-data-to-a-specific-path-in-the-volume
.
But the added value of subPath is that you can project a config map key
into an existing directory without overriding the whole directory.
We could also reuse the configMapRef field name as in k8s.io/api/core/v1,
e.g.:
resources:
- configMapRef:
name: nexus3
subPath: nexus3-persistent-template.yaml
mountPath: /etc/camel/resources/n3/nexus.yaml
type: data
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#554 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AByEhcgGFAp3YeX67MAkucVHg89PQ4Kyks5vWWmggaJpZM4buTm->
.
--
--
Luca Burgazzoli
|
This is user provided so he/she/it knows what's the target environment. In Knative (and others), normal mount can be used:
|
We can go for the current API and create a new issue to keep track of the possible improvements. |
So I did went through all the hack we have at the moment to make things working on knative 0.3, 0.4 and standard deployment and it is not simple to implement what you suggested. However, if people agree on #552, we can implement your suggestion (which is great) when we are finally free from the env hack we have in place. |
@lburgazzoli sounds good! |
This allows to configure where a resource should be mounted and in case the resource references a config map, the key of the entry (default value
content
).NOTE in case the trait
deployer.container-image
is set totrue
themountPath
is relative to the/deployment
folder