Tip
|
This resource implements the "Manage Organizations" features. |
List operations on Kubernetes resources can not be filtered by RBAC, it’s a binary operation:
Resources can either be listed or not, there is no way to give access only to a sub-set.
To circumvent this limitation, Organization
is a virtual resource.
The Organization
resource represents a filtered and formatted list of standard Kubernetes Namespace
resources which have specific labels and annotations.
It is assumed that the Organization
resource is used for all operations, the represented Namespace
must not be directly manipulated.
apiVersion: appuio.io/v1
kind: Organization
metadata:
name: acme-corp (1)
annotations:
organization.appuio.io/namespace: org-acme-corp (2)
spec:
displayName: Acme Corp. (3)
Field mapping from the represented Namespace
resource:
-
metadata.labels[appuio.io/metadata.name]
-
metadata.name
-
metadata.annotations[organization.appuio.io/display-name]
An additional printer column can help to identify the associated namespace resource name. This is useful when working with organization-scoped objects which are available in the organization’s namespace.
apiVersion: v1
kind: Namespace
metadata:
name: org-acme-corp (1)
labels:
appuio.io/resource.type: organization (2)
appuio.io/metadata.name: acme-corp (3)
annotations:
organization.appuio.io/display-name: Acme Corp. (4)
-
Resource name, prefixed with
org-
to circumvent possible name collision -
Identify resource type, used by the API server to filter for namespaces representing organizations
-
metadata.name
of the virtualOrganization
object -
Reflected in the
Organization
object asspec.displayName
Name | Type | Resource | Description |
---|---|---|---|
|
label |
|
Identifies the resource type in the scope of the {controlapi} |
|
label |
|
|
|
annotation |
|
Display name of the organization |
The virtual resource is a filtered view of Namespaces
.
The filter uses the following heuristic:
-
API version:
v1
-
Kind:
Namespace
-
Label:
appuio.io/resource-type=organization
-
Subject is bound to one of the defined
ClusterRole
resources.
These are ClusterRole
resources which are bound to a subject by a namespaced RoleBinding
:
org-view
-
View (read only) access to an organization
org-admin
-
Admin (read / write) access to an organization
By default, creating organizations can be done by all authenticated users.
All members of an organization are configured in an OrganizationMembers
resource.
apiVersion: appuio.io/v1
kind: OrganizationMembers
metadata:
name: acme-corp-members
namespace: org-acme-corp
spec:
userRefs: (1)
- id: bec0d928-2ae2-4cec-94a0-5f72f12b8b39
- username: peter.muster
status:
resolvedUserRefs: (2)
- id: bec0d928-2ae2-4cec-94a0-5f72f12b8b39
username: kate.demo
- id: 508a9160-977c-4c57-963f-c7b511c4ecc5
username: peter.muster