Secret
Bases: DuploTenantResourceV3
Kubernetes Secrets
This class provides methods to manage Kubernetes Secrets in DuploCloud.
See more details at: https://docs.duplocloud.com/docs/kubernetes-overview/configs-and-secrets/setting-kubernetes-secrets
apply
Apply a Secret
Create or Update a Secret resource with Duplocloud cli.
CLI Usage
Contents of thesecret.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 Secret
Create a new Kubernetes secret managed through DuploCloud.
CLI Usage
Contents of thesecret.yaml
file
Create a secret using a one-liner.
Create a secret by specifying key-value pairs as literals.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
Name of the secret. Required if |
None
|
body
|
BODY
|
The complete secret resource definition. |
None
|
data
|
DATAMAP
|
Data to merge into the secret. |
None
|
dryrun
|
bool
|
If True, return the modified secret without applying changes. |
False
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The updated secret or a success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the secret create fails. |
delete
Delete Secret
Deletes the specified Secret by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of a Secret to delete. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
Returns a success message if deleted successfully; otherwise, an error. |
find
Find a Secret.
Retrieve details of a specific kubernetes Secret by name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
The name of the secret to find. |
required |
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The resource content or success message. |
Raises:
Type | Description |
---|---|
DuploError
|
Secret not found. |
list
update
Updates a secret resource.
Updates an existing Kubernetes Secret resource with new or modified data.
CLI Usage
Contents of thesecret.yaml
file
Update secret using a one-liner.
Add new keys in the secret.
Update existing keys from the secret.
Delete existing keys from the secret.
Update a secret by specifying key-value pairs as literals.
Adds labels and annotations to an existing Secret resource.
Since annotations and labels do have dots and tildes, there is some special syntax here.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
NAME
|
Name of the secret. Required if |
required |
body
|
BODY
|
The complete secret resource definition. |
None
|
data
|
DATAMAP
|
Data to merge into the secret. |
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 secret without applying changes. |
False
|
Returns:
Name | Type | Description |
---|---|---|
message |
dict
|
The updated secret or a success message. |
Raises:
Type | Description |
---|---|
DuploError
|
If the secret update fails. |