# ClusterRole

- 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/ClusterRoleV1.cs)
- Inherits: [BaseKubernetesResource](/reference/api/csharp/aspire.hosting.kubernetes/basekubernetesresource.md)

Represents a Kubernetes ClusterRole resource in API version v1.

## Definition

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

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

## Remarks

A ClusterRole is a cluster-scoped resource in Kubernetes used for Role-Based Access Control (RBAC). It is used to define a set of permissions that are applicable across the entire cluster.

## Constructors

- [ClusterRole](/reference/api/csharp/aspire.hosting.kubernetes/clusterrole/constructors.md#constructor) -- Represents a Kubernetes ClusterRole resource in API version v1.

## Properties

- [AggregationRule](/reference/api/csharp/aspire.hosting.kubernetes/clusterrole/properties.md#aggregationrule) : [AggregationRuleV1?](/reference/api/csharp/aspire.hosting.kubernetes/aggregationrulev1.md) `get; set` -- Gets or sets the aggregation rule associated with the ClusterRole. Defines how multiple cluster roles can be aggregated together, simplifying role-based access control implementation.
- [Rules](/reference/api/csharp/aspire.hosting.kubernetes/clusterrole/properties.md#rules) : [List<PolicyRuleV1>](/reference/api/csharp/aspire.hosting.kubernetes/policyrulev1.md) `get` -- Represents a collection of policy rules applied to the Kubernetes ClusterRole.
