-
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
How Can I Create ConfigMap From File #4184
Comments
I think this could be a good addition. We do have same functionality in Eclipse JKube ConfigMapEnricher . We should port this functionality to a static utility method (preferably KubernetesResourceUtil) in KubernetesClient. Expected Behavior:Method's expected behavior should be same as defined in Kubernetes Docs. Creating From FileGiven File enemies=aliens
lives=3
enemies.cheat=true
enemies.cheat.level=noGoodRotten
secret.code.passphrase=UUDDLRLRBABAS
secret.code.allowed=true
secret.code.lives=30 When upon running this command: kubectl create configmap game-config --from-file=game.properties then this ConfigMap is created: apiVersion: v1
data:
game.properties: |-
enemies=aliens
lives=3
enemies.cheat=true
enemies.cheat.level=noGoodRotten
secret.code.passphrase=UUDDLRLRBABAS
secret.code.allowed=true
secret.code.lives=30
kind: ConfigMap
metadata:
name: game-config ConfigMap from directoryGiven directory with files: $ ls configure-pod-container/configmap/
game.properties ui.properties When this command gets invoked: $ kubectl create configmap game-config --from-file=configure-pod-container/configmap Then this ConfigMap gets created: apiVersion: v1
data:
game.properties: |-
enemies=aliens
lives=3
enemies.cheat=true
enemies.cheat.level=noGoodRotten
secret.code.passphrase=UUDDLRLRBABAS
secret.code.allowed=true
secret.code.lives=30
ui.properties: |
color.good=purple
color.bad=yellow
allow.textmode=true
how.nice.to.look=fairlyNice
kind: ConfigMap
metadata:
name: game-config
namespace: default |
Maybe also include it as part of the DSL for ConfigMaps |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
…m file (fabric8io#4184) Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…netesResourceUtil Related to fabric8io/kubernetes-client#4184 Move creation of ConfigMap from file related logic to KubernetesResourceUtil. This would later be replaced by KubernetesClient's KubernetesResourceUtil methods on next upgrade. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…netesResourceUtil Related to fabric8io/kubernetes-client#4184 Move creation of ConfigMap from file related logic to KubernetesResourceUtil. This would later be replaced by KubernetesClient's KubernetesResourceUtil methods on next upgrade. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
now that we're considering allowing for the modification of the current item, and not just create, this makes the api more consistent with the rest of the dsl
now that we're considering allowing for the modification of the current item, and not just create, this makes the api more consistent with the rest of the dsl
…m file (fabric8io#4184) + Added ConfigMapResource for modifying default ConfigMap operations + Added FromFileCreatable DSL method to provide file + Move KubernetesResourceUtilTest to `io.fabric8.kubernetes.client.utils` Signed-off-by: Rohan Kumar <rohaan@redhat.com>
feat (kubernetes-client) : Add utility methods to KubernetesResourceUtil for creating ConfigMap from file (#4184)
Hi, I want to create a configmap from file, is there any api implements the action
kubectl create configmap [name] --from-flie=
The text was updated successfully, but these errors were encountered: