daemon_set#

State module for managing Kubernetes DaemonSet.

async idem_k8s.states.k8s.apps.v1.daemon_set.present(hub, ctx, name: str, metadata: Dict, spec: Dict, resource_id: str = None, timeout: Dict = None) Dict[str, Any][source]#

Create a DaemonSet.

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) – Standard object’s metadata. More info: Kubernetes metadata reference

  • spec (dict) – The desired behavior of this daemon set. More info: More info: Kubernetes spec reference

  • timeout (dict, Optional) –

    Timeout configuration for resource creation.

    • create(dict) – Timeout configuration for resource creation
      • delay(int, Optional) – The amount of time in seconds to wait between attempts. Defaults to 15

      • max_attempts(int, Optional) – Customized timeout configuration containing delay and max attempts. Defaults to 40.

Returns:

Dict[str, Any]

Examples

resource_is_present:
  k8s.apps.v1.daemon_set.present:
    - name: daemon_set_1
    - metadata: value
    - spec: value


resource_is_present:
  k8s.apps.v1.daemon_set.present:
  - metadata:
      name: nginx-ds
      namespace: default
  - spec:
      selector:
        match_labels:
          name: nginx
      update_strategy:
        rolling_update:
          max_unavailable: 1
        type: RollingUpdate
      template:
        metadata:
          labels:
            name: nginx
        spec:
          containers:
          - image: nginx:1.14.2
            image_pull_policy: IfNotPresent
            name: nginx
            resources:
              limits:
                memory: 200Mi
              requests:
                cpu: 100m
                memory: 200Mi
            termination_message_path: /dev/termination-log
            termination_message_policy: File
          restart_policy: Always
async idem_k8s.states.k8s.apps.v1.daemon_set.absent(hub, ctx, name: str, metadata: Dict = {'namespace': 'default'}, resource_id: str = None, timeout: Dict = None) Dict[str, Any][source]#

Delete a DaemonSet.

Parameters:
  • name (str, Optional) – 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

  • timeout (dict, Optional) –

    Timeout configuration for resource deletion.

    • delete(dict) – Timeout configuration for resource deletion
      • delay(int, Optional) – The amount of time in seconds to wait between attempts. Defaults to 15

      • max_attempts(int, Optional) – Customized timeout configuration containing delay and max attempts. Defaults to 40.

Returns:

Dict[str, Any]

Examples

resource_is_absent:
  k8s.apps.v1.daemon_set.absent:
    - name: value
    - metadata: value
    - resource_id: value
async idem_k8s.states.k8s.apps.v1.daemon_set.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 DaemonSet.

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe k8s.apps.v1.daemon_set