# ClusterRoleBinding

- Kind: `class`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Kubernetes.Resources`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ClusterRoleBindingV1.cs)
- Inherits: [BaseKubernetesResource](/reference/api/csharp/aspire.hosting.kubernetes/basekubernetesresource.md)

Represents a ClusterRoleBinding in a Kubernetes cluster.

## Definition

```csharp
namespace Aspire.Hosting.Kubernetes.Resources;

public sealed class ClusterRoleBinding
    : Aspire.Hosting.Kubernetes.Resources.BaseKubernetesResource
{
    // ...
}
```

## Remarks

A ClusterRoleBinding grants access to cluster-scoped resources by binding a ClusterRole to one or more subjects. It contains a reference to a ClusterRole and a collection of subjects, such as users, groups, or service accounts, to which it applies.

## Constructors

- [ClusterRoleBinding](/reference/api/csharp/aspire.hosting.kubernetes/clusterrolebinding/constructors.md#constructor) -- Represents a ClusterRoleBinding in a Kubernetes cluster.

## Properties

- [RoleRef](/reference/api/csharp/aspire.hosting.kubernetes/clusterrolebinding/properties.md#roleref) : [RoleRefV1](/reference/api/csharp/aspire.hosting.kubernetes/rolerefv1.md) `get; set` -- Gets or sets the RoleRef property, which contains information pointing to the Kubernetes role being referenced within the ClusterRoleBinding configuration. The RoleRef property defines the role name, kind, and the group for API access, to ensure the binding is correctly associated with the intended permissions and scope.
- [Subjects](/reference/api/csharp/aspire.hosting.kubernetes/clusterrolebinding/properties.md#subjects) : [List<SubjectV1>](/reference/api/csharp/aspire.hosting.kubernetes/subjectv1.md) `get` -- Gets the list of subjects associated with the ClusterRoleBinding. Subjects refer to the entities (users, groups, or service accounts) that the role binding applies to.
