Add config maps to your namespaces
How to use manage Kubernetes Config Maps with Codefresh
Many applications require configuration with files, environment variables and command line arguments. It makes applications portable and easily manageable. It’s pretty easy to configure an application with this way. But it can become very hard to support tons of config files for different environments and hundreds of microservices.
Kubernetes provides an elegant and very convenient way for application configuration. This way is by using configuration maps. You can find more details about config maps at https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/.
You can manage all your cluster configuration using Codefresh. This article will explain you how to do it.
View existing config maps
In order to access the list of existing config maps, open the Kubernetes Services page and switch to list view.
Select a namespace and hover your mouse pointer on it. Click the gear button which appears at the end of the row. You will see a list of all config maps inside this namespace, including date of creation and number of configuration variables inside these maps.
Add a new config map
To add a new config map for the selected namespace, open the list of all config maps and click “Create a New Config Map” button.
In the config map form that will open, enter a name, add variables and click the “Create” button.
You can add variables to your config maps in several ways:
Add a single variable in config map
This is the easiest way to add a variable inside the config map. It’s very useful when you want to quickly create a small configmap with 1-2 variables inside.
- enter key name
- enter key value
- click “ADD VARIABLE”
Import variables from text / file
If you already have configuration variables inside a
*.property file you can easily import it inside your configmap.
To import from text:
- click “IMPORT FROM TEXT”
- copy text from file and insert inside text area
- click apply
To import from file:
- click “IMPORT FROM FILE”
- select file from your computer and click open button
Copy from existing config map
You can easily copy a previously created config map file and use it in other namespaces using the following steps:
- click “COPY FROM EXISTING CONFIG MAP”
- select cluster and namespace which contains configmap that you want to copy
- find this configmap inside the list and click “SELECT” button
Edit / remove config maps
You can easily edit / remove variables for each of your config maps.
- Select a config map
- Click on pencil icon
- You can add new variables using the same instructions as in “add new config map” section
To remove a config map, click on “remove” icon in the selected row. After your confirmation, the configmap will be removed.