role_binding#

State module for managening k8s RoleBinding.

async idem_k8s.states.k8s.rbac.v1.role_binding.present(hub, ctx, name: str, metadata: metadata, role_ref: role_ref, subjects: List[subjects], resource_id: str = None) Dict[str, Any][source]#

create a RoleBinding

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.

  • role_ref (dict) – RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.

  • subjects (list) – Subjects holds references to the objects the role applies to.

Request Syntax:
[unmanaged_resource]:
  k8s.rbac.v1.role_binding.present:
    - name: 'string'
    - metadata: 'dict'
    - role_ref: 'dict'
    - subjects: 'dict'
Returns:

Dict[str, Any]

Examples

resource_is_present:
  k8s.rbac.v1.role_binding.present:
      - resource_id: system:controller:token-cleaner
      - metadata:
          annotations:
            rbac.authorization.kubernetes.io/autoupdate: 'true'
          labels:
            kubernetes.io/bootstrapping: rbac-defaults
          name: system:controller:token-cleaner
          namespace: kube-system
      - role_ref:
          api_group: rbac.authorization.k8s.io
          kind: Role
          name: system:controller:token-cleaner
      - subjects:
        - kind: ServiceAccount
          name: token-cleaner
          namespace: kube-system
async idem_k8s.states.k8s.rbac.v1.role_binding.absent(hub, ctx, name: str, metadata: metadata = None, resource_id: str = None)[source]#

Delete a RoleBinding

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) – Defaults to metadata with ‘default’ namespace, in case of value not provided in absent state. Standard object’s metadata. More info: Kubernetes reference

Returns:

Dict[str, Any]

Request Syntax:
[k8s.rbac.v1.role_binding.name]:
  k8s.rbac.v1.role_binding.absent:
    - resource_id: 'string'
    - name: 'string'
    - metadata: 'dict'

Examples

resource_is_absent:
  k8s.rbac.v1.role_binding.absent:
    - resource_id: 'k8s.rbac.v1.role_binding.id'
    - name: 'role_binding_name'
async idem_k8s.states.k8s.rbac.v1.role_binding.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

list objects of kind RoleBinding

Returns:

Dict[str, Any]

Examples

$ idem describe k8s.rbac.v1.role_binding