piceli.k8s.templates.deployable.role_binding#

Module Contents#

Classes#

RoleBinding

Represents a Kubernetes RoleBinding, allowing you to assign a role to a set of users within a namespace.

ClusterRoleBinding

Defines a Kubernetes ClusterRoleBinding for assigning a ClusterRole to users cluster-wide.

Functions#

get_role_binding

gets a service account

API#

piceli.k8s.templates.deployable.role_binding.get_role_binding(role_binding_cls: type[kubernetes.client.V1RoleBinding | kubernetes.client.V1ClusterRoleBinding], name: piceli.k8s.templates.auxiliary.names.Name, service_account_name: Optional[str], users: Optional[list[str]], role_name: piceli.k8s.templates.auxiliary.names.Name, labels: Optional[piceli.k8s.templates.auxiliary.labels.Labels]) kubernetes.client.V1RoleBinding | kubernetes.client.V1ClusterRoleBinding[source]#

gets a service account

class piceli.k8s.templates.deployable.role_binding.RoleBinding(/, **data: typing.Any)[source]#

Bases: piceli.k8s.templates.deployable.base.Deployable

Represents a Kubernetes RoleBinding, allowing you to assign a role to a set of users within a namespace.

Parameters:
  • name (names.Name) – The name of the RoleBinding.

  • role_name (str) – The name of the Role being bound.

  • service_account_name (Optional[str]) – The ServiceAccount name, if any, the role is being assigned to.

  • users (list[str]) – The list of users being granted the role.

  • resource_names (list[str]) – Specific resource names the role applies to.

  • labels (Optional[Labels]) – Custom labels for organizational purposes.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: piceli.k8s.templates.auxiliary.names.Name#

None

role_name: str#

None

service_account_name: Optional[str]#

None

users: list[str]#

[]

resource_names: list[str]#

[]

labels: Optional[piceli.k8s.templates.auxiliary.labels.Labels]#

None

get() list[kubernetes.client.V1RoleBinding][source]#

gets the Job definition

class piceli.k8s.templates.deployable.role_binding.ClusterRoleBinding(/, **data: typing.Any)[source]#

Bases: piceli.k8s.templates.deployable.base.Deployable

Defines a Kubernetes ClusterRoleBinding for assigning a ClusterRole to users cluster-wide.

Parameters:
  • name (names.Name) – The name of the ClusterRoleBinding.

  • role_name (names.Name) – The name of the ClusterRole being assigned.

  • service_account_name (Optional[str]) – ServiceAccount being granted the ClusterRole.

  • users (list[str]) – List of users being assigned the ClusterRole.

  • labels (Optional[Labels]) – Custom labels for identification and organization.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: piceli.k8s.templates.auxiliary.names.Name#

None

role_name: piceli.k8s.templates.auxiliary.names.Name#

None

service_account_name: Optional[str]#

None

users: list[str]#

[]

labels: Optional[piceli.k8s.templates.auxiliary.labels.Labels]#

None

get() list[kubernetes.client.V1ClusterRoleBinding][source]#

gets the Job definition