service_account#

State module for managing Kubernetes ServiceAccount.

async idem_k8s.states.k8s.core.v1.service_account.present(hub, ctx, name: str, metadata: Dict, automount_service_account_token: bool = True, image_pull_secrets: List = None, secrets: List = None, resource_id: str = None) Dict[str, Any][source]#

Create a ServiceAccount

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

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

  • automount_service_account_token (bool, Optional) – AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.

  • image_pull_secrets (list, Optional) – ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: Kubernetes reference.

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

  • secrets (list, Optional) – Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. More info: Kubernetes secret reference.

Returns:

Dict[str, Any]

Examples

resource_is_present:
  k8s.core.v1.service_account.present:
    - name: value
    - metadata:
      name: idem-service-account-test
      namespace: default
      labels:
        example-label-name: example-label-value
    - automount_service_account_token: false
async idem_k8s.states.k8s.core.v1.service_account.absent(hub, ctx, name: str, metadata: Dict = {'namespace': 'default'}, resource_id: str = None) Dict[str, Any][source]#

Delete a ServiceAccount

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 metadata reference

Returns:

Dict[str, Any]

Examples

resource_is_absent:
  k8s.core.v1.service_account.absent:
    - name: value
    - metadata: value
    - resource_id: value
async idem_k8s.states.k8s.core.v1.service_account.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 ServiceAccount.

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe k8s.core.v1.service_account