Working with secrets
These methods allow you to work with Kubernetes cluster secrets in the Managed Containers service, which hosts the Cloud Spark cluster. Kubernetes secrets enable secure storage and use of sensitive data that may be needed during Spark job execution.
Create a secret in the specified namespace based on the provided manifest. The manifest must be in YAML format.
Required token role: Administrator. Learn more about token roles.
Argument | Type | Description |
|---|---|---|
(required) |
| ID of the Cloud Spark cluster in which to create the secret. The list of Cloud Spark clusters and their IDs can be obtained using the get_clusters method |
(required) |
| Path to the YAML file with the manifest |
(optional) |
| Name of the namespace in which to create the secret. This namespace must exist, otherwise the secret will not be created. If this argument is omitted when calling the method, the default value is used: |
An object of the K8sSecret class with information about the created secret.
Field | Type | Description |
|---|---|---|
|
| Name of the secret |
|
| Type of the secret |
|
| Name of the namespace in which the secret is located |
|
| Secret data as |
Get the list of secret names in the specified namespace.
To get detailed information about an individual secret from the list, use the get_secret_detail method.
Required token role: Administrator or User. Learn more about token roles.
Argument | Type | Description |
|---|---|---|
(optional) |
| ID of the Cloud Spark cluster for which to get the list of secrets. The list of Cloud Spark clusters and their IDs can be obtained using the get_clusters method |
(optional) |
| Name of the namespace from which to get the list of secrets. If this argument is omitted when calling the method, the default value is used: |
An object of the K8sObjectNamesList class that contains the list of secret names.
Get detailed information about a Kubernetes secret by its name.
Required token role: Administrator or User. Learn more about token roles.
Argument | Type | Description |
|---|---|---|
(required) |
| ID of the Cloud Spark cluster for which to get information about the secret. The list of Cloud Spark clusters and their IDs can be obtained using the get_clusters method |
(required) |
| Name of the secret to get information about. The list of secret names can be obtained using the list_secrets method |
(optional) |
| Name of the namespace in which the secret is located. If this argument is omitted when calling the method, the default value is used: |
An object of the K8sSecret class with information about the secret.
Field | Type | Description |
|---|---|---|
|
| Name of the secret |
|
| Type of the secret |
|
| Name of the namespace in which the secret is located |
|
| Secret data as For security reasons, the data is not displayed in plain text |
Delete a secret by its name.
Required token role: Administrator. Learn more about token roles.
Argument | Type | Description |
|---|---|---|
(required) |
| ID of the Cloud Spark cluster for which to get information about the secret. The list of Cloud Spark clusters and their IDs can be obtained using the get_clusters method |
(required) |
| Name of the secret to delete. The list of secret names can be obtained using the list_secrets method |
(optional) |
| Name of the namespace in which the secret is located. If this argument is omitted when calling the method, the default value is used: |
No return value.