ConfigMaps
- Set the value of environment variables.
- Create a configuration file in volumes.
This tutorial demonstrates how to create a ConfigMap in KubeSphere.
You need to create a workspace, a project and an account (project-regular
). The account must be invited to the project with the role of . For more information, see Create Workspaces, Projects, Accounts and Roles.
Log in to the console as project-regular
. Go to Configurations of a project, choose ConfigMaps and click Create.
Specify a name for the ConfigMap (e.g. ) and click Next to continue.
Tip
You can see the ConfigMap manifest file in YAML format by enabling Edit Mode in the top right corner. KubeSphere allows you to edit the manifest file directly to create a ConfigMap. Alternatively, you can follow the steps below to create a ConfigMap via the dashboard.
Input a key-value pair. For example:
Note
key-value pairs displays under the field
data
in the manifest.On the KubeSphere dashboard, you can only add key-value pairs for a ConfigMap currently. In future releases, you will be able to add a path to a directory containing configuration files to create ConfigMaps directly on the dashboard.
Click √ in the bottom right corner to save it and click Add Data again if you want to add more key-value pairs.
After a ConfigMap is created, it displays in the list as below. You can click the three dots on the right and select the operation from the menu to modify it.
- Edit YAML: View, upload, download, or update the YAML file.
- Modify Config: Modify the key-value pair of the ConfigMap.
- Delete: Delete the ConfigMap.
Click the name of the ConfigMap and you can go to its detail page. Under the tab Detail, you can see all the key-value pairs you have added for the ConfigMap.
Click More to display what operations about this ConfigMap you can do.
- Edit YAML: View, upload, download, or update the YAML file.
- Modify Config: Modify the key-value pair of the ConfigMap.
- Delete: Delete the ConfigMap, and return to the list page.