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
configmap file as executable script #71356
Comments
@FritschAuctores: There are no sig labels on this issue. Please add a sig label by either:
Note: Method 1 will trigger an email to the group. See the group list. 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/test-infra repository. |
/sig-feature-requests |
@FritschAuctores It's already supported in k8s to specify the file permissions of mounted configmap files. You can reference the usage in secret https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod. |
Thank you, this works: Pod: ...
volumeMounts:
- name: test-script
mountPath: /script/test.sh
subPath: test.sh
- name: test-script
configMap:
name: test-script
defaultMode: 0777
... /close |
For anyone that lands here and is wondering how you set this is you're using JSON overrides, you need the decimal equivalent of the defaultMode octal. This works:
|
What would you like to be added:
A configmap file as executable script into a pod
Pod:
Inside the Pod:
From
-rw-r--r-- 1 root root 1.3K Nov 22 15:32 test.sh
To
-rwxr-xr-x 1 root root 1.3K Nov 22 15:41 test.sh
Why is this needed:
It is easier to create a flexible Pod
/kind feature
The text was updated successfully, but these errors were encountered: