> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Package Scopes

> Explains Glasskube package scopes, differences between cluster-scoped and namespaced packages, use cases, UI locations, and how to author package manifests safely.

Before we dive into package configuration and installation, it helps to understand the two package scopes Glasskube supports: cluster-scoped and namespaced packages. Choosing the right scope determines how a package is deployed, who can reuse it, and whether it can create cluster-level resources.

Cluster-scoped packages

* Cluster-scoped packages manage cluster-wide resources such as `ClusterRole`, `ClusterRoleBinding`, and `CustomResourceDefinition` (CRD).
* Because they operate at the cluster level, these packages are typically installed once per cluster and shared across namespaces.
* Common use cases: cluster networking, global observability, cluster-wide security tools, and CRD providers.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/9wfunwr4SxNjNTYq/images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Package-Scopes/single-node-cluster-diagram-observability-analytics.jpg?fit=max&auto=format&n=9wfunwr4SxNjNTYq&q=85&s=a01b19677961323ac89fc259faed5cad" alt="The image depicts a diagram of a Single-Node Cluster divided into &#x22;Cluster Scoped&#x22; and &#x22;Namespace Scoped&#x22; sections, featuring observability, continuous deployment, and analytics." width="1920" height="1080" data-path="images/Kubernetes-Administration-Package-Management-with-Glasskube/Package-Installation/Package-Scopes/single-node-cluster-diagram-observability-analytics.jpg" />
</Frame>

Namespaced packages

* Namespaced packages are confined to a single Kubernetes namespace and don’t manage cluster-level resources.
* They can be installed multiple times in different namespaces, providing isolated instances for teams, environments, or applications.
* Common use cases: per-team deployments, environment-specific instances (dev/stage/prod), and application-scoped tooling.

How to choose a scope

* Use cluster-scoped packages for functionality that must be shared across the cluster or that manages cluster-level resources (e.g., networking, cluster-wide monitoring, CRDs).
* Use namespaced packages when you need multiple isolated instances of the same package (e.g., separate team environments) or when the package only affects resources within a single namespace.

| Scope          | Typical resources managed                                           | When to use                                                       |
| -------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Cluster-scoped | `ClusterRole`, `ClusterRoleBinding`, `CustomResourceDefinition`     | Shared services, global controllers, CRD providers                |
| Namespaced     | `Role`, `RoleBinding`, `Deployment`, `Service` (within a namespace) | Per-team or per-environment isolation, application-scoped tooling |

<Callout icon="lightbulb" color="#1CB2FE">
  Cluster-scoped packages are ideal for functionality that must be installed only once per cluster (e.g., an operator that provides CRDs). Namespaced packages are best when you need repeatable, isolated deployments across namespaces.
</Callout>

Glasskube UI and where scopes appear

* In the Glasskube web UI:
  * Cluster-scoped packages appear under the `Cluster Packages` tab.
  * Namespaced packages appear under the `Packages` tab.

Authoring package manifests
When creating Glasskube package definition files, set the `kind` to `ClusterPackage` for cluster-scoped packages or `Package` for namespaced packages. For example:

```yaml theme={null}
apiVersion: packages.glasskube.dev/v1alpha1
kind: ClusterPackage
metadata:
  creationTimestamp: null
  name: argo-cd
spec:
  packageInfo:
    name: argo-cd
    repositoryName: glasskube
    version: v2.11.7+1
```

<Callout icon="warning" color="#FF6B6B">
  Be cautious when authoring cluster-scoped packages: because they affect cluster-wide state, changes can impact all namespaces. Test cluster-scoped manifests in a safe environment before deploying to production clusters.
</Callout>

Links and references

* Glasskube package docs: [https://glasskube.dev/docs](https://glasskube.dev/docs) (refer to your Glasskube installation docs)
* Kubernetes RBAC and resources: [https://kubernetes.io/docs/reference/access-authn-authz/rbac/](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)
* CustomResourceDefinitions: [https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/)

Now that you know how package scopes work and how to pick between them, you’re ready to move on to installing and configuring packages with Glasskube.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/k8s-administration-package-management-with-glasskube/module/c3806869-7f9e-4cc2-8dc5-aa10304e3d1c/lesson/2f9b77f1-bc91-4775-bf0f-c7f9bcb33428" />
</CardGroup>
