secret#

State module for managing Kubernetes Secret.

async idem_k8s.states.k8s.core.v1.secret.present(hub, ctx, name: str, metadata: Dict, type: str, data: Dict = None, immutable: bool = False, string_data: Dict = None, resource_id: str = None) Dict[str, Any][source]#

Create a Secret

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

  • data (dict, Optional) – Data contains the secret data. Each key must consist of alphanumeric characters, ‘-’, ‘_’ or ‘.’. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4.

  • immutable (bool, Optional) – Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.

  • metadata (dict) – Standard object’s metadata. More info: Kubernetes reference

  • string_data (dict, Optional) – stringData allows specifying non-binary secret data in string form. It is provided as a write- only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API.

  • type (str) – Used to facilitate programmatic handling of secret data. More info: Secret Types

Returns:

Dict[str, Any]

Examples

resource_is_present:
  k8s.core.v1.secret.present:
    - name: idem-test-secret
    - data:
        username: YWRtaW4=
        password: MWYyZDFlMmU2N2Rm
    - metadata:
       name: idem-test-secret
       namespace: default
       annotations:
        kubernetes.io/service-account.name: test-account
    - type: Opaque
async idem_k8s.states.k8s.core.v1.secret.absent(hub, ctx, name: str, metadata: Dict = {'namespace': 'default'}, resource_id: str = None) Dict[str, Any][source]#

Delete a Secret

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

  • metadata (dict, Optional) –

    Standard object’s metadata. Defaults to metadata with ‘default’ namespace, in case of value not provided in absent state. More info: Kubernetes reference

Returns:

Dict[str, Any]

Examples

resource_is_absent:
  k8s.core.v1.secret.absent:
    - name: value
    - metadata: value
async idem_k8s.states.k8s.core.v1.secret.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

List or watch objects of kind Secret.

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe k8s.core.v1.secret