v1alpha2

package
v0.0.0-...-2e8aeb9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1alpha2 contains API Schema definitions for the instance v1alpha1 API group

Index

Constants

View Source
const (
	// ClassContainer -> the environment is constituted by a Docker container exposing a service through a VNC server.
	ClassContainer EnvironmentType = "Container"
	// ClassVM -> the environment is constituted by a Virtual Machine.
	ClassVM EnvironmentType = "VirtualMachine"
	// ClassCloudVM -> the environment is constituited by a Virtual Machine started from cloud images downloaded from HTTP URL.
	ClassCloudVM EnvironmentType = "CloudVM"
	// ClassStandalone -> the environment is constituted by a Docker Container exposing a web service through an http interface.
	ClassStandalone EnvironmentType = "Standalone"

	// ModeStandard -> Normal operation (authentication, ssh, files access).
	ModeStandard EnvironmentMode = "Standard"
	// ModeExam -> Restricted access (no authentication, no mydrive access).
	ModeExam EnvironmentMode = "Exam"
	// ModeExercise -> Restricted access (no authentication, no mydrive access).
	ModeExercise EnvironmentMode = "Exercise"
)
View Source
const (
	// Manager -> a Tenant with Manager role can interact with all the environments
	// (i.e. VMs) in a Workspace, as well as add new Tenants to the Workspace.
	Manager WorkspaceUserRole = "manager"
	// User -> a Tenant with User role can only interact with his/her own
	// environments (e.g. VMs) within that Workspace.
	User WorkspaceUserRole = "user"

	// SVCTenantName -> name of a system/service tenant to which other resources might belong.
	SVCTenantName string = "service-tenant"
)
View Source
const TnOperatorFinalizerName = "crownlabs.polito.it/tenant-operator"

TnOperatorFinalizerName is the name of the finalizer corresponding to the tenant operator.

View Source
const WorkspaceLabelPrefix = "crownlabs.polito.it/workspace-"

WorkspaceLabelPrefix is the prefix of a label assigned to a tenant indicating it is subscribed to a workspace.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "crownlabs.polito.it", Version: "v1alpha2"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type ContainerStartupOpts

type ContainerStartupOpts struct {
	// URL from which GET the archive to be extracted into ContentPath
	SourceArchiveURL string `json:"sourceArchiveURL,omitempty"`
	// Path on which storage (EmptyDir/Storage) will be mounted
	// and into which, if given in SourceArchiveURL, will be extracted the archive
	ContentPath string `json:"contentPath,omitempty"`
	// Arguments to be passed to the application container on startup
	StartupArgs []string `json:"startupArgs,omitempty"`
	// Whether forcing the container working directory to be the same as the contentPath (or default mydrive path if not specified)
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	EnforceWorkdir bool `json:"enforceWorkdir"`
}

ContainerStartupOpts specifies custom startup options for the created container, including the possibility to download and extract an archive to a given destination and specifying the arguments that will be passed to the application container.

func (*ContainerStartupOpts) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerStartupOpts.

func (*ContainerStartupOpts) DeepCopyInto

func (in *ContainerStartupOpts) DeepCopyInto(out *ContainerStartupOpts)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Environment

type Environment struct {
	// The name identifying the specific environment.
	Name string `json:"name"`

	// The VM or container to be started when instantiating the environment.
	Image string `json:"image"`

	// The type of environment to be instantiated, among VirtualMachine,
	// Container, CloudVM and Standalone.
	EnvironmentType EnvironmentType `json:"environmentType"`

	// Whether the environment is characterized by a graphical desktop or not.
	GuiEnabled bool `json:"guiEnabled,omitempty"`

	// For VNC based containers, hide the noVNC control bar when true
	DisableControls bool `json:"disableControls,omitempty"`

	// Whether the environment should be persistent (i.e. preserved when the
	// corresponding instance is terminated) or not.
	Persistent bool `json:"persistent,omitempty"`

	// The amount of computational resources associated with the environment.
	Resources EnvironmentResources `json:"resources"`

	// The mode associated with the environment (Standard, Exam, Exercise)
	Mode EnvironmentMode `json:"mode,omitempty"`

	// +kubebuilder:default=false
	// Whether the environment needs the URL Rewrite or not.
	RewriteURL bool `json:"rewriteURL,omitempty"`

	// Options to customize container startup
	ContainerStartupOptions *ContainerStartupOpts `json:"containerStartupOptions,omitempty"`

	// Name of the storage class to be used for the persistent volume (when needed)
	StorageClassName string `json:"storageClassName,omitempty"`

	// +kubebuilder:default=true
	// Whether the instance has to have the user's MyDrive volume
	MountMyDriveVolume bool `json:"mountMyDriveVolume"`
}

Environment defines the characteristics of an environment composing the Template.

func (*Environment) DeepCopy

func (in *Environment) DeepCopy() *Environment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Environment.

func (*Environment) DeepCopyInto

func (in *Environment) DeepCopyInto(out *Environment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentMode

type EnvironmentMode string

EnvironmentMode is an enumeration of the mode in which associated instances should be started: each mode consists in presets for exposition and deployment.

type EnvironmentPhase

type EnvironmentPhase string

EnvironmentPhase is an enumeration of the different phases associated with an instance of a given environment template.

const (
	// EnvironmentPhaseUnset -> the environment phase is unknown.
	EnvironmentPhaseUnset EnvironmentPhase = ""
	// EnvironmentPhaseImporting -> the image of the environment is being imported.
	EnvironmentPhaseImporting EnvironmentPhase = "Importing"
	// EnvironmentPhaseStarting -> the environment is starting.
	EnvironmentPhaseStarting EnvironmentPhase = "Starting"
	// EnvironmentPhaseResourceQuotaExceeded -> the environment could not start because the resource quota is exceeded.
	EnvironmentPhaseResourceQuotaExceeded EnvironmentPhase = "ResourceQuotaExceeded"
	// EnvironmentPhaseRunning -> the environment is running, but not yet ready.
	EnvironmentPhaseRunning EnvironmentPhase = "Running"
	// EnvironmentPhaseReady -> the environment is ready to be accessed.
	// with the current CrownLabs dashboard.
	EnvironmentPhaseReady EnvironmentPhase = "Ready"
	// EnvironmentPhaseStopping -> the environment is being stopped.
	EnvironmentPhaseStopping EnvironmentPhase = "Stopping"
	// EnvironmentPhaseOff -> the environment is currently shut down.
	// with the current CrownLabs dashboard.
	EnvironmentPhaseOff EnvironmentPhase = "Off"
	// EnvironmentPhaseFailed -> the environment has failed, and cannot be restarted.
	EnvironmentPhaseFailed EnvironmentPhase = "Failed"
	// EnvironmentPhaseCreationLoopBackoff -> the environment has encountered a temporary error during creation.
	EnvironmentPhaseCreationLoopBackoff EnvironmentPhase = "CreationLoopBackoff"
)

type EnvironmentResources

type EnvironmentResources struct {

	// The maximum number of CPU cores made available to the environment
	// (at least 1 core). This maps to the 'limits' specified
	// for the actual pod representing the environment.
	CPU uint32 `json:"cpu"`

	// The percentage of reserved CPU cores, ranging between 1 and 100, with
	// respect to the 'CPU' value. Essentially, this corresponds to the 'requests'
	// specified for the actual pod representing the environment.
	ReservedCPUPercentage uint32 `json:"reservedCPUPercentage"`

	// The amount of RAM memory assigned to the given environment. Requests and
	// limits do correspond to avoid OOMKill issues.
	Memory resource.Quantity `json:"memory"`

	// The size of the persistent disk allocated for the given environment.
	// This field is meaningful only in case of persistent or container-based
	// environments, while it is silently ignored in the other cases.
	// In case of containers, when this field is not specified, an emptyDir will be
	// attached to the pod but this could result in data loss whenever the pod dies.
	Disk resource.Quantity `json:"disk,omitempty"`
}

EnvironmentResources is the specification of the amount of resources (i.e. CPU, RAM, ...) assigned to a certain environment.

func (*EnvironmentResources) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentResources.

func (*EnvironmentResources) DeepCopyInto

func (in *EnvironmentResources) DeepCopyInto(out *EnvironmentResources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentType

type EnvironmentType string

EnvironmentType is an enumeration of the different types of environments that can be instantiated in CrownLabs.

type GenericRef

type GenericRef struct {
	// The name of the resource to be referenced.
	Name string `json:"name"`

	// The namespace containing the resource to be referenced. It should be left
	// empty in case of cluster-wide resources.
	Namespace string `json:"namespace,omitempty"`
}

GenericRef represents a reference to a generic Kubernetes resource, and it is composed of the resource name and (optionally) its namespace.

func (*GenericRef) DeepCopy

func (in *GenericRef) DeepCopy() *GenericRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericRef.

func (*GenericRef) DeepCopyInto

func (in *GenericRef) DeepCopyInto(out *GenericRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Instance

type Instance struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   InstanceSpec   `json:"spec,omitempty"`
	Status InstanceStatus `json:"status,omitempty"`
}

Instance describes the instance of a CrownLabs environment Template.

func (*Instance) DeepCopy

func (in *Instance) DeepCopy() *Instance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance.

func (*Instance) DeepCopyInto

func (in *Instance) DeepCopyInto(out *Instance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Instance) DeepCopyObject

func (in *Instance) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InstanceAutomationStatus

type InstanceAutomationStatus struct {
	// The last time the Instance desired status was checked.
	LastCheckTime metav1.Time `json:"lastCheckTime,omitempty"`

	// The (possibly expected) termination time of the Instance.
	TerminationTime metav1.Time `json:"terminationTime,omitempty"`

	// The time the Instance content submission has been completed.
	SubmissionTime metav1.Time `json:"submissionTime,omitempty"`
}

InstanceAutomationStatus reflects the status of the instance's automation (termination and submission).

func (*InstanceAutomationStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceAutomationStatus.

func (*InstanceAutomationStatus) DeepCopyInto

func (in *InstanceAutomationStatus) DeepCopyInto(out *InstanceAutomationStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstanceCustomizationUrls

type InstanceCustomizationUrls struct {
	// URL from which GET the archive to be extracted into Template.ContainerStartupOptions.ContentPath. This field, if set, OVERRIDES Template.ContainerStartupOptions.SourceArchiveURL.
	ContentOrigin string `json:"contentOrigin,omitempty"`

	// URL to which POST an archive with the contents found (at instance termination) in Template.ContainerStartupOptions.ContentPath.
	ContentDestination string `json:"contentDestination,omitempty"`

	// URL which is periodically checked (with a GET request) to determine automatic instance shutdown. Should return any 2xx status code if the instance has to keep running, any 4xx otherwise. In case of 2xx response, it should output a JSON with a `deadline` field containing a ISO_8601 compliant date/time string of the expected instance termination time. See instautoctrl.StatusCheckResponse for exact definition.
	StatusCheck string `json:"statusCheck,omitempty"`
}

InstanceCustomizationUrls specifies optional urls for advanced integration features.

func (*InstanceCustomizationUrls) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceCustomizationUrls.

func (*InstanceCustomizationUrls) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstanceList

type InstanceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Instance `json:"items"`
}

InstanceList contains a list of Instance objects.

func (*InstanceList) DeepCopy

func (in *InstanceList) DeepCopy() *InstanceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceList.

func (*InstanceList) DeepCopyInto

func (in *InstanceList) DeepCopyInto(out *InstanceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InstanceList) DeepCopyObject

func (in *InstanceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InstanceSnapshot

type InstanceSnapshot struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   InstanceSnapshotSpec   `json:"spec,omitempty"`
	Status InstanceSnapshotStatus `json:"status,omitempty"`
}

InstanceSnapshot is the Schema for the instancesnapshots API.

func (*InstanceSnapshot) DeepCopy

func (in *InstanceSnapshot) DeepCopy() *InstanceSnapshot

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSnapshot.

func (*InstanceSnapshot) DeepCopyInto

func (in *InstanceSnapshot) DeepCopyInto(out *InstanceSnapshot)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InstanceSnapshot) DeepCopyObject

func (in *InstanceSnapshot) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InstanceSnapshotList

type InstanceSnapshotList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []InstanceSnapshot `json:"items"`
}

InstanceSnapshotList contains a list of InstanceSnapshot.

func (*InstanceSnapshotList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSnapshotList.

func (*InstanceSnapshotList) DeepCopyInto

func (in *InstanceSnapshotList) DeepCopyInto(out *InstanceSnapshotList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InstanceSnapshotList) DeepCopyObject

func (in *InstanceSnapshotList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InstanceSnapshotSpec

type InstanceSnapshotSpec struct {

	// Instance is the reference to the persistent VM instance to be snapshotted.
	// The instance should not be running, otherwise it won't be possible to
	// steal the volume and extract its content.
	Instance GenericRef `json:"instanceRef"`

	// Environment represents the reference to the environment to be snapshotted, in case more are
	// associated with the same Instance. If not specified, the first available environment is considered.
	Environment GenericRef `json:"environmentRef,omitempty"`

	// ImageName is the name of the image to pushed in the docker registry.
	ImageName string `json:"imageName"`
}

InstanceSnapshotSpec defines the desired state of InstanceSnapshot.

func (*InstanceSnapshotSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSnapshotSpec.

func (*InstanceSnapshotSpec) DeepCopyInto

func (in *InstanceSnapshotSpec) DeepCopyInto(out *InstanceSnapshotSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstanceSnapshotStatus

type InstanceSnapshotStatus struct {
	// Phase represents the current state of the Instance Snapshot.
	Phase SnapshotStatus `json:"phase"`
}

InstanceSnapshotStatus defines the observed state of InstanceSnapshot.

func (*InstanceSnapshotStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSnapshotStatus.

func (*InstanceSnapshotStatus) DeepCopyInto

func (in *InstanceSnapshotStatus) DeepCopyInto(out *InstanceSnapshotStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstanceSpec

type InstanceSpec struct {
	// The reference to the Template to be instantiated.
	Template GenericRef `json:"template.crownlabs.polito.it/TemplateRef"`

	// The reference to the Tenant which owns the Instance object.
	Tenant GenericRef `json:"tenant.crownlabs.polito.it/TenantRef"`

	// Whether the current instance is running or not.
	// The meaning of this flag is different depending on whether the instance
	// refers to a persistent environment or not. If the first case, it allows to
	// stop the environment (e.g. the underlying VM) without deleting the associated
	// disk. Setting the flag to true will restart the environment, attaching it
	// to the same disk used previously. Differently, if the environment is not
	// persistent, it only tears down the exposition objects, making the instance
	// effectively unreachable from outside the cluster, but allowing the
	// subsequent recreation without data loss.
	Running bool `json:"running"`

	// Custom name the user can assign and change at any time
	// in order to more easily identify the instance.
	// +kubebuilder:validation:Optional
	PrettyName string `json:"prettyName"`

	// Optional urls for advanced integration features.
	CustomizationUrls *InstanceCustomizationUrls `json:"customizationUrls,omitempty"`
}

InstanceSpec is the specification of the desired state of the Instance.

func (*InstanceSpec) DeepCopy

func (in *InstanceSpec) DeepCopy() *InstanceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec.

func (*InstanceSpec) DeepCopyInto

func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstanceStatus

type InstanceStatus struct {
	// The current status Instance, with reference to the associated environment
	// (e.g. VM). This conveys which resource is being created, as well as
	// whether the associated VM is being scheduled, is running or ready to
	// accept incoming connections.
	Phase EnvironmentPhase `json:"phase,omitempty"`

	// The URL where it is possible to access the remote desktop of the instance
	// (in case of graphical environments)
	URL string `json:"url,omitempty"`

	// The internal IP address associated with the remote environment, which can
	// be used to access it through the SSH protocol (leveraging the SSH bastion
	// in case it is not contacted from another CrownLabs Instance).
	IP string `json:"ip,omitempty"`

	// The amount of time the Instance required to become ready for the first time
	// upon creation.
	InitialReadyTime string `json:"initialReadyTime,omitempty"`

	// Timestamps of the Instance automation phases (check, termination and submission).
	Automation InstanceAutomationStatus `json:"automation,omitempty"`
}

InstanceStatus reflects the most recently observed status of the Instance.

func (*InstanceStatus) DeepCopy

func (in *InstanceStatus) DeepCopy() *InstanceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatus.

func (*InstanceStatus) DeepCopyInto

func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NameCreated

type NameCreated struct {
	// The name of the considered resource.
	Name string `json:"name,omitempty"`

	// Whether the creation succeeded or not.
	Created bool `json:"created"`
}

NameCreated contains information about the status of a resource created in the cluster (e.g. a namespace). Specifically, it contains the name of the resource and a flag indicating whether the creation succeeded.

func (*NameCreated) DeepCopy

func (in *NameCreated) DeepCopy() *NameCreated

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NameCreated.

func (*NameCreated) DeepCopyInto

func (in *NameCreated) DeepCopyInto(out *NameCreated)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SnapshotStatus

type SnapshotStatus string

SnapshotStatus is an enumeration representing the current state of the InstanceSnapshot.

const (
	// Pending -> The snapshot resource has been observed and the
	// process is waiting to be started.
	Pending SnapshotStatus = "Pending"
	// Processing -> The process of creation of the snapshot started.
	Processing SnapshotStatus = "Processing"
	// Completed -> The snapshot of the instance has been created.
	Completed SnapshotStatus = "Completed"
	// Failed -> The process of creation of the snapshot failed.
	Failed SnapshotStatus = "Failed"
)

type SubscriptionStatus

type SubscriptionStatus string

SubscriptionStatus is an enumeration of the different states that can be assumed by the subscription to a service (e.g. successful or failing).

const (
	// SubscrOk -> the subscription was successful.
	SubscrOk SubscriptionStatus = "Ok"
	// SubscrFailed -> the subscription has failed.
	SubscrFailed SubscriptionStatus = "Failed"
)

type Template

type Template struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TemplateSpec   `json:"spec,omitempty"`
	Status TemplateStatus `json:"status,omitempty"`
}

Template describes the template of a CrownLabs environment to be instantiated.

func (*Template) DeepCopy

func (in *Template) DeepCopy() *Template

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Template.

func (*Template) DeepCopyInto

func (in *Template) DeepCopyInto(out *Template)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Template) DeepCopyObject

func (in *Template) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TemplateList

type TemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Template `json:"items"`
}

TemplateList contains a list of Template objects.

func (*TemplateList) DeepCopy

func (in *TemplateList) DeepCopy() *TemplateList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateList.

func (*TemplateList) DeepCopyInto

func (in *TemplateList) DeepCopyInto(out *TemplateList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TemplateList) DeepCopyObject

func (in *TemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TemplateSpec

type TemplateSpec struct {
	// The human-readable name of the Template.
	PrettyName string `json:"prettyName"`

	// A textual description of the Template.
	Description string `json:"description"`

	// The reference to the Workspace this Template belongs to.
	WorkspaceRef GenericRef `json:"workspace.crownlabs.polito.it/WorkspaceRef,omitempty"`

	// The list of environments (i.e. VMs or containers) that compose the Template.
	EnvironmentList []Environment `json:"environmentList"`

	// The maximum lifetime of an Instance referencing the current Template.
	// Once this period is expired, the Instance may be automatically deleted
	// or stopped to save resources. If set to "never", the instance will not be
	// automatically terminated.
	DeleteAfter string `json:"deleteAfter,omitempty"`
}

TemplateSpec is the specification of the desired state of the Template.

func (*TemplateSpec) DeepCopy

func (in *TemplateSpec) DeepCopy() *TemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateSpec.

func (*TemplateSpec) DeepCopyInto

func (in *TemplateSpec) DeepCopyInto(out *TemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TemplateStatus

type TemplateStatus struct {
}

TemplateStatus reflects the most recently observed status of the Template.

func (*TemplateStatus) DeepCopy

func (in *TemplateStatus) DeepCopy() *TemplateStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateStatus.

func (*TemplateStatus) DeepCopyInto

func (in *TemplateStatus) DeepCopyInto(out *TemplateStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Tenant

type Tenant struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TenantSpec   `json:"spec,omitempty"`
	Status TenantStatus `json:"status,omitempty"`
}

Tenant describes a user of CrownLabs.

func (*Tenant) DeepCopy

func (in *Tenant) DeepCopy() *Tenant

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tenant.

func (*Tenant) DeepCopyInto

func (in *Tenant) DeepCopyInto(out *Tenant)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Tenant) DeepCopyObject

func (in *Tenant) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Tenant) SetupWebhookWithManager

func (r *Tenant) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager setups the webhook with the given manager.

type TenantList

type TenantList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Tenant `json:"items"`
}

TenantList contains a list of Tenant objects.

func (*TenantList) DeepCopy

func (in *TenantList) DeepCopy() *TenantList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantList.

func (*TenantList) DeepCopyInto

func (in *TenantList) DeepCopyInto(out *TenantList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TenantList) DeepCopyObject

func (in *TenantList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TenantResourceQuota

type TenantResourceQuota struct {
	// The maximum amount of CPU which can be used by this Tenant.
	CPU resource.Quantity `json:"cpu"`

	// The maximum amount of RAM memory which can be used by this Tenant.
	Memory resource.Quantity `json:"memory"`

	// +kubebuilder:validation:Minimum:=0
	// The maximum number of concurrent instances which can be created by this Tenant.
	Instances uint32 `json:"instances"`
}

TenantResourceQuota defines resource quota for each Tenant.

func (*TenantResourceQuota) DeepCopy

func (in *TenantResourceQuota) DeepCopy() *TenantResourceQuota

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResourceQuota.

func (*TenantResourceQuota) DeepCopyInto

func (in *TenantResourceQuota) DeepCopyInto(out *TenantResourceQuota)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TenantSpec

type TenantSpec struct {
	// The first name of the Tenant.
	FirstName string `json:"firstName"`

	// The last name of the Tenant.
	LastName string `json:"lastName"`

	// The last login timestamp.
	LastLogin metav1.Time `json:"lastLogin,omitempty"`

	// The email associated with the Tenant, which will be used to log-in
	// into the system.
	Email string `json:"email"`

	// The list of the Workspaces the Tenant is subscribed to, along with his/her
	// role in each of them.
	// +listType=map
	// +listMapKey=name
	Workspaces []TenantWorkspaceEntry `json:"workspaces,omitempty"`

	// The list of the SSH public keys associated with the Tenant. These will be
	// used to enable to access the remote environments through the SSH protocol.
	PublicKeys []string `json:"publicKeys,omitempty"`

	// Whether a sandbox namespace should be created to allow the Tenant play
	// with Kubernetes.
	CreateSandbox bool `json:"createSandbox,omitempty"`

	// The amount of resources associated with this Tenant, if defined it overrides the one computed from the workspaces the tenant is enrolled in.
	Quota *TenantResourceQuota `json:"quota,omitempty"`
}

TenantSpec is the specification of the desired state of the Tenant.

func (*TenantSpec) DeepCopy

func (in *TenantSpec) DeepCopy() *TenantSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantSpec.

func (*TenantSpec) DeepCopyInto

func (in *TenantSpec) DeepCopyInto(out *TenantSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TenantStatus

type TenantStatus struct {
	// The namespace containing all CrownLabs related objects of the Tenant.
	// This is the namespace that groups his/her own Instances, together with
	// all the accessory resources (e.g. RBACs, resource quota, network policies,
	// ...) created by the tenant-operator.
	PersonalNamespace NameCreated `json:"personalNamespace"`

	// The namespace that can be freely used by the Tenant to play with Kubernetes.
	// This namespace is created only if the .spec.CreateSandbox flag is true.
	SandboxNamespace NameCreated `json:"sandboxNamespace"`

	// The list of Workspaces that are throwing errors during subscription.
	// This mainly happens if .spec.Workspaces contains references to Workspaces
	// which do not exist.
	FailingWorkspaces []string `json:"failingWorkspaces"`

	// The list of the subscriptions to external services (e.g. Keycloak,
	// ...), indicating for each one whether it succeeded or an error
	// occurred.
	Subscriptions map[string]SubscriptionStatus `json:"subscriptions"`

	// Whether all subscriptions and resource creations succeeded or an error
	// occurred. In case of errors, the other status fields provide additional
	// information about which problem occurred.
	// Will be set to true even when personal workspace is intentionally deleted.
	Ready bool `json:"ready"`

	// The amount of resources associated with this Tenant, either inherited from the Workspaces in which he/she is enrolled, or manually overridden.
	Quota TenantResourceQuota `json:"quota,omitempty"`
}

TenantStatus reflects the most recently observed status of the Tenant.

func (*TenantStatus) DeepCopy

func (in *TenantStatus) DeepCopy() *TenantStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantStatus.

func (*TenantStatus) DeepCopyInto

func (in *TenantStatus) DeepCopyInto(out *TenantStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TenantWorkspaceEntry

type TenantWorkspaceEntry struct {
	// The Workspace the Tenant is subscribed to.
	Name string `json:"name"`

	// The role of the Tenant in the context of the Workspace.
	Role WorkspaceUserRole `json:"role"`
}

TenantWorkspaceEntry contains the information regarding one of the Workspaces the Tenant is subscribed to, including his/her role.

func (*TenantWorkspaceEntry) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantWorkspaceEntry.

func (*TenantWorkspaceEntry) DeepCopyInto

func (in *TenantWorkspaceEntry) DeepCopyInto(out *TenantWorkspaceEntry)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkspaceUserRole

type WorkspaceUserRole string

WorkspaceUserRole is an enumeration of the different roles that can be associated to a Tenant in a Workspace.

Jump to

Keyboard shortcuts

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