get_configmap
Retrieve the full contents of a Kubernetes ConfigMap by name and namespace to inspect configuration data and binary key names.
Instructions
Retrieves the full contents of a single ConfigMap.
WARNING: ConfigMaps can contain secret-shaped values (e.g. credentials stored
as plain config). When this tool is served through the k8stools MCP server, the
output passes through a redaction step by default (see the `redaction` module
and the server's `--no-redact` flag). Callers using this function directly get
the raw values and are responsible for their own redaction.
Parameters
----------
name : str
Name of the ConfigMap.
namespace : str, optional
Namespace of the ConfigMap (default is "default").
Returns
-------
dict[str, Any]
A dictionary describing the ConfigMap with the following keys:
name : str
Name of the ConfigMap.
namespace : str
Namespace of the ConfigMap.
data : dict[str, str]
The string key/value data map (empty dict if none).
binary_data_keys : list[str]
Names of any binary keys. The binary values themselves are not
returned.
Raises
------
K8sConfigError
If unable to initialize the K8S API.
K8sApiError
If the ConfigMap is not found or the API call fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| namespace | No | default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||