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

  1. In the Codefresh UI, from Ops in the sidebar, select Kubernetes Services.
  2. Switch to list view.

Change View

Change View
  1. Select a namespace and hover over it.
  2. 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

  1. From the list of config maps, click Create a New Config Map.

Create a new config map in namespace

Create a new config map in namespace
  1. 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.

Define settings for new config map

Define settings for new config map

Managing variables in config maps

There are three options to add variables to config maps:

  1. Add a single variable at a time
  2. Add multiple variables by copying and pasting from text or file
  3. 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:

  1. Enter Key name and the Key value
  2. Click Add Variable.

Add single variable at a time to config map

Add single variable at a time to config map

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:

  1. Click Import from text.
  2. Copy text from file and paste it within the text area in the required format.
  3. Click Apply.

Add multiple variables from text or file to config map

Add multiple variables from text or file to config map

Import from file:

  1. Click Import from file.
  2. 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.

  1. Click Copy from Existing Config Map.
  2. Select the Cluster and Namespace from which to copy the configmap.
  3. Select the configmap from the list, and click Select.

Copy variables from existing config map

Copy variables from existing config map

Edit/remove variables in config maps

You can easily edit or remove variables in your config maps.

  1. Select the config map with the variables to modify or remove.
  2. Click the Edit (pencil) icon.
  3. Add new variables, as described in Managing variables in your config maps.

Edit/remove variables in config maps

Edit/remove variables in 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