ConfigMap
Bases: DuploTenantResourceV3
Kubernetes ConfigMaps
This class offers methods to manage Kubernetes ConfigMaps within DuploCloud.
See more details at: https://docs.duplocloud.com/docs/kubernetes-overview/configs-and-secrets
apply
Apply a ConfigMap
Create or Update a ConfigMap resource with Duplocloud cli.
CLI Usage
Contents of theconfigmap.yaml
file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
BODY
|
The resource to apply. |
required |
wait
|
WAIT
|
Wait for the resource to be created. |
False
|
patches
|
PATCHES
|
The patches to apply to the resource. |
None
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
Success message. |
create
Create a Configmap resource.
Creates a new kubernetes ConfigMap resource with the specified metadata and data entries.
CLI Usage
Contents of theconfigmap.yaml
file
Create a ConfigMap using a one-liner.
Create a ConfigMap by specifying key-value pairs as literals.
Create a ConfigMap from a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
Name of the ConfigMap. Required if |
None
|
body
|
BODY
|
The complete ConfigMap resource definition. |
None
|
data
|
DATAMAP
|
Data to merge into the ConfigMap. |
None
|
dryrun
|
DRYRUN
|
Do not submit any changes to the server. |
False
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The created resource or success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the Configmap could not be created. |
delete
Delete ConfigMap
Deletes the specified ConfigMap by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of a ConfigMap to delete. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
Returns a success message if deleted successfully; otherwise, an error. |
find
Find a ConfigMap.
Retrieve details of a specific ConfigMap by name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the ConfigMap to find. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The resource content or success message. |
Raises:
Type | Description |
---|---|
DuploError
|
ConfigMap not found. |
list
Retrieve a List of ConfigMap resources
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
A list of ConfigMap. |
update
Updates a ConfigMap resource.
This function allows you to modify the contents of a ConfigMap without deleting or recreating it.
CLI Usage
Contents of theconfigmap.yaml
file
Update configmap using a one-liner.
Add new key in the configmap.
Update existing key from the configmap.
Delete existing key from the configmap.
Update a ConfigMap by specifying key-value pairs as literals.
Update a ConfigMap from a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
Name of the ConfigMap. Required if |
required |
body
|
BODY
|
The complete ConfigMap resource definition. |
None
|
data
|
DATAMAP
|
Data to merge into the ConfigMap. |
None
|
patches
|
PATCHES
|
A list of JSON patches as args to apply to the service.
The options are |
None
|
dryrun
|
bool
|
If True, return the modified ConfigMap without applying changes. |
False
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The updated ConfigMap or a success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the ConfigMap update fails. |