Skip to main content
Admin only: All orka rbac and orka rolebinding operations require administrative privileges.

Understanding RBAC in Orka

Orka relies on RBAC (role-based access control) for the management of user access to resources. In Orka, RBAC consists of the following elements:
  • Roles: A set of permissions. Roles are managed by MacStadium.
  • Subjects: Users and service accounts which can be bound to a role. Subjects are managed by Orka users with administrative privileges.
  • Namespaces: Groups of resources dedicated to specific users or service accounts. Namespaces are managed by Orka users with administrative privileges.
  • Rolebindings: K8s objects describing which subjects belong to which role and which subjects can access which namespaces. Rolebindings are managed by Orka users with administrative privileges.
Default access:
  • All admin users have access to all namespaces
  • All non-admin users have user access to the orka-default namespace
Granting access:
  • To grant a user access to a specific namespace, add that user as a subject to the rolebinding for the namespace
  • Service accounts automatically have access to the namespace where they were created
  • To grant a service account access to a specific namespace, add that service account as a subject to the rolebinding for the namespace
If --namespace is not set, rolebinding commands operate in the orka-default namespace. The shorthand alias for rolebinding is rb.

Managing role subjects

Requires Orka 4.0 or later. On earlier versions, use the orka rolebinding commands that follow.
Use orka rbac to grant and revoke Orka roles for users and service accounts. Every orka rbac command requires administrative privileges and a --role:
  • --role dev modifies the orka-dev rolebinding in a single namespace, granting access to that namespace. Use --namespace to choose the namespace. It defaults to your default namespace.
  • --role admin is cluster-wide. Subjects are added to or removed from every rolebinding and cluster rolebinding that grants the admin role to its OIDC group, so --namespace isn’t valid with --role admin.

orka rbac add-subject

Grant a role to one or more users and/or service accounts. Admin grants apply only to the admin bindings that exist at grant time. Bindings created later, for example when you create a new namespace, start without the granted subjects. Re-run this command after creating namespaces to include them. It’s safe to run more than once. Syntax:
Options:
Examples:

orka rbac list-subjects

List the subjects currently granted a role. With --role admin, the list combines the subjects from every binding that grants the admin role, without duplicates. Syntax:
Options:
Examples:

orka rbac remove-subject

Revoke a role from one or more users and/or service accounts. Syntax:
Options:
Examples:

Managing rolebindings

Deprecated in Orka 4.0. Use orka rbac with --role dev instead. The orka rolebinding commands still work in Orka 4.0 and behave the same as before, but each one prints a deprecation message to stderr that names its replacement, for example Command "list-subjects" is deprecated, use "orka rbac list-subjects --role dev --namespace TARGET_NAMESPACE" instead, and no longer appear in orka --help. They map to the new commands as follows:
  • orka rolebinding add-subject becomes orka rbac add-subject --role dev
  • orka rolebinding list-subjects becomes orka rbac list-subjects --role dev
  • orka rolebinding remove-subject becomes orka rbac remove-subject --role dev

orka rolebinding add-subject

Add a subject to the rolebinding for the specified namespace. This grants the user or the service account access to the specified namespace. Syntax:
Options:
Examples:

orka rolebinding list-subjects

List all rolebinding subjects, along with their kind, in the orka-default namespace or another specified namespace. Syntax:
Options:
Examples:

orka rolebinding remove-subject

Remove a subject from a rolebinding. This revokes the user or service account access to the specified namespace. Syntax:
Options:
Examples:

Common workflows

Adding and removing access

Common workflow:
  1. Create a namespace:
  1. Move nodes to the namespace:
  1. Grant users access:
  1. Grant service accounts access:
  1. Verify access:

Service account access

Service accounts are automatically granted access to the namespace where they are created. To grant a service account access to additional namespaces, use the rolebinding commands: