Questions tagged [configmap]

ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable.

ConfigMaps bind configuration files, command-line arguments, environment variables, port numbers, and other configuration artifacts to your Pods' containers and system components at runtime. ConfigMaps allow you to separate your configurations from your Pods and components, which helps keep your workloads portable, makes their configurations easier to change and manage, and prevents hardcoding configuration data to Pod specifications.

ConfigMaps are useful for storing and sharing non-sensitive, unencrypted configuration information. To use sensitive information in your clusters, you must use Secrets.

Documentations

503 questions
5
votes
2 answers

Azure kubernetes - python to read configmap?

I am trying to Dockerize the python application and want to read the configuration settings from the configmap. How do I read configmap in python?
One Developer
  • 99
  • 5
  • 43
  • 103
5
votes
2 answers

How to cleanup kubernetes configMaps that are no longer used by pods

We use kustomize to create a unique configMap for our Deployments whenever a new change to configMap data is made. We now are left with a number of old configMaps which are no longer in use by any Pods - I can find them in Rancher, but that's a…
JamesD
  • 679
  • 10
  • 36
5
votes
1 answer

Is there any way to use configMaps in K8s with nested values to be used as environment variable in the pod?

I have the sample cm.yml for configMap with nested json like data. kind: ConfigMap metadata: name: sample-cm data: spring: |- rabbitmq: |- host: "sample.com" datasource: |- url: "jdbc:postgresql:sampleDb" I have to set environment…
Sarabesh n.r
  • 73
  • 1
  • 6
5
votes
2 answers

How to mount a configMap as a volume mount in a Stateful Set

I don't see an option to mount a configMap as volume in the statefulset , as per https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#statefulset-v1-apps only PVC can be associated with "StatefulSet" . But PVC does not have option…
5
votes
3 answers

Spring Cloud Kubernetes ConfigMap reload not working

I was playing with Kubernetes in Minikube. I could able to deploy spring boot sample application into Kubernetes. I am exploring Kubernetes configMap. I could successfully run a spring boot application with a spring cloud starter and picking the…
5
votes
3 answers

How to put a whole directory and its subdirectories with a ConfigMap in a Kubernetes Pod on a multi-node cluster?

Problem We want to reuse the same image We have different static files (e.g. css) that should vary among different deployments. The folder-structure of these files should be preserved. e.g: test1.xml test2.xml layout 3.1 test1.css 3.1…
5
votes
1 answer

Terraform kubernetes_config_map --from-env-file

I am creating a kubernetes configMap using '--from-env-file' option to store the file contents as environment variables. kubectl create configmap env --from-env-file=env.properties -n namespace When I create a terraform resource as below, the…
5
votes
3 answers

Does helm upgrade on a configmap automatically inject new data into running pod?

When issuing a helm upgrade on a running pod, my configmap is updated, but will the pod know about the configmap updated values automatically or is there another step that I need to take to inject new configmap values into the pod? My overall goal…
texasdave
  • 506
  • 1
  • 4
  • 12
5
votes
2 answers

Kubernetes - ConfigMap for nested variables

We have an image deployed in an AKS cluster for which we need to update a config entry during deployment using configmaps. The configuration file has the following key and we are trying to replace the value of the "ChildKey" without replacing the…
RahulB
  • 197
  • 1
  • 8
4
votes
2 answers

Kubernetes: Disable TLS 1.0 and 1.1 on nginx ingress

An existing nginx ingress named nginx-proxy running on the K8 cluster. Now, there is a requirement from the Dev team to disable TLS 1.0, 1.1 support. Upon searching, I could see this solution using configmap. Do you think applying/creating a new…
vjwilson
  • 754
  • 2
  • 14
  • 30
4
votes
0 answers

ConfigMap mapping values

I'm trying to use configmaps from my python code instead of configuration json files. Created 2 .properties files (with key=value lines),…
zbeedatm
  • 157
  • 1
  • 10
4
votes
2 answers

How do you add multiple config files to configMap with kustomize configMapGenerator by using a pattern/regex/...?

Currently I do this: configMapGenerator: - name: sql-config-map files: - "someDirectory/one.sql" - "someDirectory/two.sql" - "someDirectory/three.sql" and I would like to do sth. like this: configMapGenerator: - name:…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
4
votes
0 answers

how to genrate notifaction when configMap change

I have node base application and I have many configmap so when someone changes into my configmap that time I need notification, for notification I am using kubewatch but when some edit configmap notification not coming
4
votes
1 answer

Setting ConfigMapRef and SecretRef for Deployment in Golang K8s client

I have got messed with this bug for hours and still dont know why! I created a simple Configmap and a Secret called config1 and secret1 respectively. (Yaml files for these are within this repo: https://github.com/hoangphanthai/test) After that I…
4
votes
1 answer

Kubernetes ConfigMap automatically changes Literal to Folded Block Scalar

I'm having problems with ConfigMap creation on OpenShift 4. I'm trying to add a data element which holds Java application.properties and to format the YAML using literal block scalar. Example: data: application.properties: | …
dplesa
  • 1,355
  • 6
  • 23
  • 56