multitenancy

package
v1.0.0-alpha.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeOwnerReferenceForNamespace

func MakeOwnerReferenceForNamespace(namespace *corev1.Namespace) metav1.OwnerReference

MakeOwnerReferenceForNamespace creates an owner reference for the given namespace.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is the implementation to set up multitenancy.

func NewManager

func NewManager(kubeclientset kubernetes.Interface,
	edgenetclientset clientset.Interface) *Manager

NewManager returns a new multitenancy manager

func (*Manager) ApplyTenantResourceQuota

func (m *Manager) ApplyTenantResourceQuota(name string, ownerReferences []metav1.OwnerReference, claim corev1alpha1.ResourceTuning, applied chan<- error)

ApplyTenantResourceQuota generates a tenant resource quota with the name provided

func (*Manager) CreateClusterRoles

func (m *Manager) CreateClusterRoles() error

CreateClusterRoles generate a cluster role for tenant owners, admins, and collaborators

func (*Manager) CreateTenant

func (m *Manager) CreateTenant(tenantRequest *registrationv1alpha1.TenantRequest) error

CreateTenant function is for being used by other resources to create a tenant

func (*Manager) EligibilityCheck

func (m *Manager) EligibilityCheck(objNamespace string) (bool, *corev1.Namespace, map[string]string)

EligibilityCheck checks whether namespace, in which object exists, is local to the cluster or is propagated along with a federated deployment. If another cluster propagates the namespace, we skip checking the owner tenant's status as the Selective Deployment entity manages this life-cycle.

func (*Manager) GrantObjectOwnership

func (m *Manager) GrantObjectOwnership(apiGroup, resource, resourceName, subject string, ownerReferences []metav1.OwnerReference) error

GrantObjectOwnership configures permission for the object owner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL