Adding config maps to namespaces
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. While this makes for easy configuration, 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, using configuration maps. You can find more details about config maps at Kubernetes - Configure a Pod to Use a ConfigMap.
You can manage all your cluster configuration using Codefresh.
View existing config maps
- In the Codefresh UI, from Ops in the sidebar, select Kubernetes Services.
- Switch to list view.
- Select a namespace and hover over it.
- Click the Settings icon which appears at the end of the row.
A list of all config maps within this namespace are displayed, with their date of creation and number of configuration variables.
Add a new config map
- From the list of config maps, click Create a New Config Map.
- In the Add a New Config Map form, enter a Name, add variables, as described in Managing variables in your config maps, and then click Create.
Managing variables in config maps
There are three options to add variables to config maps:
- Add a single variable at a time
- Add multiple variables by copying and pasting from text or file
- Import a set of variables from an existing config map
Add a single variable to config map
This is the easiest way to add a variable to the config map. This method is very useful to quickly create a small configmap with 1-2 variables:
- Enter Key name and the Key value
- Click Add Variable.
Import variables from text/file
If you already have configuration variables in a
*.property file, you can easily import it to your configmap.
Import from text:
- Click Import from text.
- Copy text from file and paste it within the text area in the required format.
- Click Apply.
Import from file:
- Click Import from file.
- Select the file from your computer, and click Open.
Copy variables from existing config map
You can easily copy the variables from an existing config map file, and use it in other namespaces.
- Click Copy from Existing Config Map.
- Select the Cluster and Namespace from which to copy the configmap.
- Select the configmap from the list, and click Select.
Edit/remove variables in config maps
You can easily edit or remove variables in your config maps.
- Select the config map with the variables to modify or remove.
- Click the Edit (pencil) icon.
- Add new variables, as described in Managing variables in your config maps.
To remove a config map, click on “remove” icon in the selected row. After your confirmation, the configmap will be removed.
Connect to a Kubernetes cluster
Managing Kubernetes clusters
Kubernetes deployment quick start