in Education by
I've been using K8S ConfigMap and Secret to manage our properties. My design is pretty simple, that keeps properties files in a git repo and use build server such as Thoughtworks GO to automatically deploy them to be ConfigMaps or Secrets (on choice condition) to my k8s cluster. Currently, I found it's not efficient that I have to always delete the existing ConfigMap and Secret and create the new one to update as below: kubectl delete configmap foo kubectl create configmap foo --from-file foo.properties Is there a nice and simple way to make the above one step and more efficient than deleting current? potentially what I'm doing now may compromise the container that uses these configmaps if it tries to mount while the old configmap is deleted and the new one hasn't been created Select the correct answer from above options

1 Answer

0 votes
by
For updating k8s ConfigMap you can get the YAML file which helps you to update or replace from kubectl create configmap foo --from-file foo.properties -o yaml --dry-run | kubectl replace -f - Please mind the spaces in the command, these commands will enable you to get the yaml file that helps you in updating. There is one more way to replace and update(used for small changes), kubectl edit configmap This will open a vi editor of configMap there you can make changes and save it. Thus you can update your k8s configMap without deleting the existing one

Related questions

0 votes
    I am trying to start a local Kubernetes cluster using minikube start and getting the following error. Starting local ... this slow? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    The situation I have a kubernetes pod stuck in "Terminating" state that resists pod deletions NAME READY STATUS ... not exist. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Can you please tell me the difference between kubectl apply and kubectl create. Why there are 3 different commands ... the same thing? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    Now that links are deprecated in docker-compose.yml (and were able to use the new networking feature to ... docker-compose.yml? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I'm looking for a way to configure Nginx to access hosted services through a subdomain of my server. Those services ... me with this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Suppose you have two services on your topology API Web Interface Both supposed to be running on port 80. On docker ... to solve this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Do I need to use separate Docker containers for my complex web application or I can put all required services in ... in one container? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Can someone help me to differentiate between DevOps and Docker? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    My docker-compose file has some running docker files to create my containers. I don't want the docker files ... docker-compose syntax? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I am unable to find the containers under the directory: /var/lib/docker/containers Can you please tell me the ... the host machine? Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    I want to expose multiple ports to the machine’s interface. How to achieve this using a docker container? Please help. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I have created a docker image. I want to push it into my docker repo but I am facing this error: denied: ... to the resource is denied Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    I have deleted a folder containing a running Vagrant box before realizing it was still running. How can I delete ... the Virtualbox VM. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I have an application on GKE that I wish to be available via HTTPS only, so I have gotten a signed ... to the kubernetes cluster? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    So I am trying to build a docker image with the Golang SDK, everything runs except the section in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
...