Documentation
¶
Overview ¶
Package v1beta2 contains API Schema definitions for the capsule v1beta2 API group +kubebuilder:object:generate=true +groupName=capsule.clastix.io
Index ¶
- Constants
- Variables
- func GetLimitResourceFromTenant(tenant Tenant, kindGroup string) (int64, error)
- func GetTypeLabel(t metav1.Object) (label string, err error)
- func GetUsedResourceFromTenant(tenant Tenant, kindGroup string) (int64, error)
- func HardQuotaFor(resource fmt.Stringer) (string, error)
- func LimitAnnotationForResource(kindGroup string) string
- func UsedAnnotationForResource(kindGroup string) string
- func UsedQuotaFor(resource fmt.Stringer) (string, error)
- type AdditionalRoleBindingsSpec
- type ByKindAndName
- type CapsuleConfiguration
- type CapsuleConfigurationList
- type CapsuleConfigurationSpec
- type CapsuleResources
- type GatewayOptions
- type GlobalTenantResource
- type GlobalTenantResourceList
- type GlobalTenantResourceSpec
- type GlobalTenantResourceStatus
- type IngressOptions
- type NamespaceOptions
- type NodeMetadata
- type NonLimitedResourceError
- type ObjectReference
- type ObjectReferenceAbstract
- type ObjectReferenceStatus
- type OwnerKind
- type OwnerListSpec
- type OwnerSpec
- type ProcessedItems
- type ProxyOperation
- type ProxyServiceKind
- type ProxySettings
- type RawExtension
- type ResourcePool
- func (r *ResourcePool) AddClaimToStatus(claim *ResourcePoolClaim)
- func (r *ResourcePool) AssignClaims()
- func (r *ResourcePool) AssignNamespaces(namespaces []corev1.Namespace)
- func (r *ResourcePool) CalculateAvailableResources()
- func (r *ResourcePool) CalculateClaimedResources()
- func (r *ResourcePool) CanClaimFromPool(claim corev1.ResourceList) []error
- func (in *ResourcePool) DeepCopy() *ResourcePool
- func (in *ResourcePool) DeepCopyInto(out *ResourcePool)
- func (in *ResourcePool) DeepCopyObject() runtime.Object
- func (r *ResourcePool) GetAvailableClaimableResources() corev1.ResourceList
- func (r *ResourcePool) GetClaimFromStatus(cl *ResourcePoolClaim) *ResourcePoolClaimsItem
- func (r *ResourcePool) GetClaimedByNamespaceClaims() (claims map[string]corev1.ResourceList)
- func (r *ResourcePool) GetNamespaceClaims(namespace string) (claims map[string]*ResourcePoolClaimsItem, ...)
- func (r *ResourcePool) GetResourceQuotaHardResources(namespace string) corev1.ResourceList
- func (r *ResourcePool) RemoveClaimFromStatus(claim *ResourcePoolClaim)
- type ResourcePoolClaim
- type ResourcePoolClaimList
- type ResourcePoolClaimSpec
- type ResourcePoolClaimStatus
- type ResourcePoolClaimsItem
- type ResourcePoolClaimsList
- type ResourcePoolList
- type ResourcePoolNamespaceClaimsStatus
- type ResourcePoolQuotaStatus
- type ResourcePoolSpec
- type ResourcePoolSpecConfiguration
- type ResourcePoolStatus
- type ResourceSpec
- type Tenant
- func (in *Tenant) AssignNamespaces(namespaces []corev1.Namespace)
- func (in *Tenant) ConvertFrom(raw conversion.Hub) error
- func (in *Tenant) ConvertTo(raw conversion.Hub) error
- func (in *Tenant) DeepCopy() *Tenant
- func (in *Tenant) DeepCopyInto(out *Tenant)
- func (in *Tenant) DeepCopyObject() runtime.Object
- func (in *Tenant) GetClusterRolesBySubject(ignoreOwnerKind []OwnerKind) (maps map[string]map[string]api.TenantSubjectRoles)
- func (in *Tenant) GetNamespaces() (res []string)
- func (in *Tenant) GetOwnerProxySettings(name string, kind OwnerKind) []ProxySettings
- func (in *Tenant) GetSubjectsByClusterRoles(ignoreOwnerKind []OwnerKind) (rolePerms map[string][]rbacv1.Subject)
- func (in *Tenant) IsFull() bool
- type TenantList
- type TenantResource
- type TenantResourceList
- type TenantResourceSpec
- type TenantResourceStatus
- type TenantSpec
- type TenantStatus
- func (in *TenantStatus) DeepCopy() *TenantStatus
- func (in *TenantStatus) DeepCopyInto(out *TenantStatus)
- func (ms *TenantStatus) GetInstance(stat *TenantStatusNamespaceItem) *TenantStatusNamespaceItem
- func (ms *TenantStatus) RemoveInstance(stat *TenantStatusNamespaceItem)
- func (ms *TenantStatus) UpdateInstance(stat *TenantStatusNamespaceItem)
- type TenantStatusNamespaceItem
- type TenantStatusNamespaceMetadata
Constants ¶
const ( ResourceQuotaAnnotationPrefix = "quota.resources.capsule.clastix.io" ResourceUsedAnnotationPrefix = "used.resources.capsule.clastix.io" )
const ( NodesProxy ProxyServiceKind = "Nodes" StorageClassesProxy ProxyServiceKind = "StorageClasses" IngressClassesProxy ProxyServiceKind = "IngressClasses" PriorityClassesProxy ProxyServiceKind = "PriorityClasses" RuntimeClassesProxy ProxyServiceKind = "RuntimeClasses" PersistentVolumesProxy ProxyServiceKind = "PersistentVolumes" TenantProxy ProxyServiceKind = "Tenant" ListOperation ProxyOperation = "List" UpdateOperation ProxyOperation = "Update" DeleteOperation ProxyOperation = "Delete" UserOwner OwnerKind = "User" GroupOwner OwnerKind = "Group" ServiceAccountOwner OwnerKind = "ServiceAccount" )
const ( HardCapsuleQuotaAnnotation = "quota.capsule.clastix.io/hard-" UsedCapsuleQuotaAnnotation = "quota.capsule.clastix.io/used-" )
const ( TenantStateActive tenantState = "Active" TenantStateCordoned tenantState = "Cordoned" )
Variables ¶
var ( // GroupVersion is group version used to register these objects. GroupVersion = schema.GroupVersion{Group: "capsule.clastix.io", Version: "v1beta2"} // 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 ¶
Types ¶
type AdditionalRoleBindingsSpec ¶
type AdditionalRoleBindingsSpec struct {
ClusterRoleName string `json:"clusterRoleName"`
// kubebuilder:validation:Minimum=1
Subjects []rbacv1.Subject `json:"subjects"`
}
func (*AdditionalRoleBindingsSpec) DeepCopy ¶
func (in *AdditionalRoleBindingsSpec) DeepCopy() *AdditionalRoleBindingsSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalRoleBindingsSpec.
func (*AdditionalRoleBindingsSpec) DeepCopyInto ¶
func (in *AdditionalRoleBindingsSpec) DeepCopyInto(out *AdditionalRoleBindingsSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ByKindAndName ¶
type ByKindAndName OwnerListSpec
func (ByKindAndName) DeepCopy ¶
func (in ByKindAndName) DeepCopy() ByKindAndName
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ByKindAndName.
func (ByKindAndName) DeepCopyInto ¶
func (in ByKindAndName) DeepCopyInto(out *ByKindAndName)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ByKindAndName) Len ¶
func (b ByKindAndName) Len() int
func (ByKindAndName) Less ¶
func (b ByKindAndName) Less(i, j int) bool
func (ByKindAndName) Swap ¶
func (b ByKindAndName) Swap(i, j int)
type CapsuleConfiguration ¶
type CapsuleConfiguration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec CapsuleConfigurationSpec `json:"spec,omitempty"`
}
CapsuleConfiguration is the Schema for the Capsule configuration API.
func (*CapsuleConfiguration) DeepCopy ¶
func (in *CapsuleConfiguration) DeepCopy() *CapsuleConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapsuleConfiguration.
func (*CapsuleConfiguration) DeepCopyInto ¶
func (in *CapsuleConfiguration) DeepCopyInto(out *CapsuleConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CapsuleConfiguration) DeepCopyObject ¶
func (in *CapsuleConfiguration) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CapsuleConfigurationList ¶
type CapsuleConfigurationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []CapsuleConfiguration `json:"items"`
}
CapsuleConfigurationList contains a list of CapsuleConfiguration.
func (*CapsuleConfigurationList) DeepCopy ¶
func (in *CapsuleConfigurationList) DeepCopy() *CapsuleConfigurationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapsuleConfigurationList.
func (*CapsuleConfigurationList) DeepCopyInto ¶
func (in *CapsuleConfigurationList) DeepCopyInto(out *CapsuleConfigurationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CapsuleConfigurationList) DeepCopyObject ¶
func (in *CapsuleConfigurationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CapsuleConfigurationSpec ¶
type CapsuleConfigurationSpec struct {
// Names of the users considered as Capsule users.
UserNames []string `json:"userNames,omitempty"`
// Names of the groups considered as Capsule users.
// +kubebuilder:default={capsule.clastix.io}
UserGroups []string `json:"userGroups,omitempty"`
// Define groups which when found in the request of a user will be ignored by the Capsule
// this might be useful if you have one group where all the users are in, but you want to separate administrators from normal users with additional groups.
IgnoreUserWithGroups []string `json:"ignoreUserWithGroups,omitempty"`
// ServiceAccounts within tenant namespaces can be promoted to owners of the given tenant
// this can be achieved by labeling the serviceaccount and then they are considered owners. This can only be done by other owners of the tenant.
// However ServiceAccounts which have been promoted to owner can not promote further serviceAccounts.
// +kubebuilder:default=false
AllowServiceAccountPromotion bool `json:"allowServiceAccountPromotion,omitempty"`
// Enforces the Tenant owner, during Namespace creation, to name it using the selected Tenant name as prefix,
// separated by a dash. This is useful to avoid Namespace name collision in a public CaaS environment.
// +kubebuilder:default=false
ForceTenantPrefix bool `json:"forceTenantPrefix,omitempty"`
// Disallow creation of namespaces, whose name matches this regexp
ProtectedNamespaceRegexpString string `json:"protectedNamespaceRegex,omitempty"`
// Allows to set different name rather than the canonical one for the Capsule configuration objects,
// such as webhook secret or configurations.
// +kubebuilder:default={TLSSecretName:"capsule-tls",mutatingWebhookConfigurationName:"capsule-mutating-webhook-configuration",validatingWebhookConfigurationName:"capsule-validating-webhook-configuration"}
CapsuleResources CapsuleResources `json:"overrides,omitempty"`
// Allows to set the forbidden metadata for the worker nodes that could be patched by a Tenant.
// This applies only if the Tenant has an active NodeSelector, and the Owner have right to patch their nodes.
NodeMetadata *NodeMetadata `json:"nodeMetadata,omitempty"`
// Toggles the TLS reconciler, the controller that is able to generate CA and certificates for the webhooks
// when not using an already provided CA and certificate, or when these are managed externally with Vault, or cert-manager.
// +kubebuilder:default=true
EnableTLSReconciler bool `json:"enableTLSReconciler"` //nolint:tagliatelle
}
CapsuleConfigurationSpec defines the Capsule configuration.
func (*CapsuleConfigurationSpec) DeepCopy ¶
func (in *CapsuleConfigurationSpec) DeepCopy() *CapsuleConfigurationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapsuleConfigurationSpec.
func (*CapsuleConfigurationSpec) DeepCopyInto ¶
func (in *CapsuleConfigurationSpec) DeepCopyInto(out *CapsuleConfigurationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CapsuleResources ¶
type CapsuleResources struct {
// Defines the Secret name used for the webhook server.
// Must be in the same Namespace where the Capsule Deployment is deployed.
// +kubebuilder:default=capsule-tls
TLSSecretName string `json:"TLSSecretName"` //nolint:tagliatelle
// Name of the MutatingWebhookConfiguration which contains the dynamic admission controller paths and resources.
// +kubebuilder:default=capsule-mutating-webhook-configuration
MutatingWebhookConfigurationName string `json:"mutatingWebhookConfigurationName"`
// Name of the ValidatingWebhookConfiguration which contains the dynamic admission controller paths and resources.
// +kubebuilder:default=capsule-validating-webhook-configuration
ValidatingWebhookConfigurationName string `json:"validatingWebhookConfigurationName"`
}
func (*CapsuleResources) DeepCopy ¶
func (in *CapsuleResources) DeepCopy() *CapsuleResources
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapsuleResources.
func (*CapsuleResources) DeepCopyInto ¶
func (in *CapsuleResources) DeepCopyInto(out *CapsuleResources)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GatewayOptions ¶ added in v0.10.0
type GatewayOptions struct {
AllowedClasses *api.SelectionListWithDefaultSpec `json:"allowedClasses,omitempty"`
}
func (*GatewayOptions) DeepCopy ¶ added in v0.10.0
func (in *GatewayOptions) DeepCopy() *GatewayOptions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayOptions.
func (*GatewayOptions) DeepCopyInto ¶ added in v0.10.0
func (in *GatewayOptions) DeepCopyInto(out *GatewayOptions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GlobalTenantResource ¶
type GlobalTenantResource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec GlobalTenantResourceSpec `json:"spec,omitempty"`
Status GlobalTenantResourceStatus `json:"status,omitempty"`
}
GlobalTenantResource allows to propagate resource replications to a specific subset of Tenant resources.
func (*GlobalTenantResource) DeepCopy ¶
func (in *GlobalTenantResource) DeepCopy() *GlobalTenantResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTenantResource.
func (*GlobalTenantResource) DeepCopyInto ¶
func (in *GlobalTenantResource) DeepCopyInto(out *GlobalTenantResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GlobalTenantResource) DeepCopyObject ¶
func (in *GlobalTenantResource) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type GlobalTenantResourceList ¶
type GlobalTenantResourceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []GlobalTenantResource `json:"items"`
}
GlobalTenantResourceList contains a list of GlobalTenantResource.
func (*GlobalTenantResourceList) DeepCopy ¶
func (in *GlobalTenantResourceList) DeepCopy() *GlobalTenantResourceList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTenantResourceList.
func (*GlobalTenantResourceList) DeepCopyInto ¶
func (in *GlobalTenantResourceList) DeepCopyInto(out *GlobalTenantResourceList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GlobalTenantResourceList) DeepCopyObject ¶
func (in *GlobalTenantResourceList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type GlobalTenantResourceSpec ¶
type GlobalTenantResourceSpec struct {
TenantResourceSpec `json:",inline"`
// Defines the Tenant selector used target the tenants on which resources must be propagated.
TenantSelector metav1.LabelSelector `json:"tenantSelector,omitempty"`
}
GlobalTenantResourceSpec defines the desired state of GlobalTenantResource.
func (*GlobalTenantResourceSpec) DeepCopy ¶
func (in *GlobalTenantResourceSpec) DeepCopy() *GlobalTenantResourceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTenantResourceSpec.
func (*GlobalTenantResourceSpec) DeepCopyInto ¶
func (in *GlobalTenantResourceSpec) DeepCopyInto(out *GlobalTenantResourceSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GlobalTenantResourceStatus ¶
type GlobalTenantResourceStatus struct {
// List of Tenants addressed by the GlobalTenantResource.
SelectedTenants []string `json:"selectedTenants"`
// List of the replicated resources for the given TenantResource.
ProcessedItems ProcessedItems `json:"processedItems"`
}
GlobalTenantResourceStatus defines the observed state of GlobalTenantResource.
func (*GlobalTenantResourceStatus) DeepCopy ¶
func (in *GlobalTenantResourceStatus) DeepCopy() *GlobalTenantResourceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTenantResourceStatus.
func (*GlobalTenantResourceStatus) DeepCopyInto ¶
func (in *GlobalTenantResourceStatus) DeepCopyInto(out *GlobalTenantResourceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IngressOptions ¶
type IngressOptions struct {
// Specifies the allowed IngressClasses assigned to the Tenant.
// Capsule assures that all Ingress resources created in the Tenant can use only one of the allowed IngressClasses.
// A default value can be specified, and all the Ingress resources created will inherit the declared class.
// Optional.
AllowedClasses *api.DefaultAllowedListSpec `json:"allowedClasses,omitempty"`
// Defines the scope of hostname collision check performed when Tenant Owners create Ingress with allowed hostnames.
//
//
// - Cluster: disallow the creation of an Ingress if the pair hostname and path is already used across the Namespaces managed by Capsule.
//
// - Tenant: disallow the creation of an Ingress if the pair hostname and path is already used across the Namespaces of the Tenant.
//
// - Namespace: disallow the creation of an Ingress if the pair hostname and path is already used in the Ingress Namespace.
//
//
// Optional.
// +kubebuilder:default=Disabled
HostnameCollisionScope api.HostnameCollisionScope `json:"hostnameCollisionScope,omitempty"`
// Specifies the allowed hostnames in Ingresses for the given Tenant. Capsule assures that all Ingress resources created in the Tenant can use only one of the allowed hostnames. Optional.
AllowedHostnames *api.AllowedListSpec `json:"allowedHostnames,omitempty"`
// Toggles the ability for Ingress resources created in a Tenant to have a hostname wildcard.
AllowWildcardHostnames bool `json:"allowWildcardHostnames,omitempty"`
}
func (*IngressOptions) DeepCopy ¶
func (in *IngressOptions) DeepCopy() *IngressOptions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressOptions.
func (*IngressOptions) DeepCopyInto ¶
func (in *IngressOptions) DeepCopyInto(out *IngressOptions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NamespaceOptions ¶
type NamespaceOptions struct {
// +kubebuilder:validation:Minimum=1
// Specifies the maximum number of namespaces allowed for that Tenant. Once the namespace quota assigned to the Tenant has been reached, the Tenant owner cannot create further namespaces. Optional.
Quota *int32 `json:"quota,omitempty"`
// Specifies additional labels and annotations the Capsule operator places on any Namespace resource in the Tenant. Optional.
// Deprecated: Use additionalMetadataList instead
AdditionalMetadata *api.AdditionalMetadataSpec `json:"additionalMetadata,omitempty"`
// Specifies additional labels and annotations the Capsule operator places on any Namespace resource in the Tenant via a list. Optional.
AdditionalMetadataList []api.AdditionalMetadataSelectorSpec `json:"additionalMetadataList,omitempty"`
// Define the labels that a Tenant Owner cannot set for their Namespace resources.
ForbiddenLabels api.ForbiddenListSpec `json:"forbiddenLabels,omitempty"`
// Define the annotations that a Tenant Owner cannot set for their Namespace resources.
ForbiddenAnnotations api.ForbiddenListSpec `json:"forbiddenAnnotations,omitempty"`
// If enabled only metadata from additionalMetadata is reconciled to the namespaces.
//+kubebuilder:default:=false
ManagedMetadataOnly bool `json:"managedMetadataOnly,omitempty"`
}
func (*NamespaceOptions) DeepCopy ¶
func (in *NamespaceOptions) DeepCopy() *NamespaceOptions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOptions.
func (*NamespaceOptions) DeepCopyInto ¶
func (in *NamespaceOptions) DeepCopyInto(out *NamespaceOptions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NodeMetadata ¶
type NodeMetadata struct {
// Define the labels that a Tenant Owner cannot set for their nodes.
ForbiddenLabels api.ForbiddenListSpec `json:"forbiddenLabels"`
// Define the annotations that a Tenant Owner cannot set for their nodes.
ForbiddenAnnotations api.ForbiddenListSpec `json:"forbiddenAnnotations"`
}
func (*NodeMetadata) DeepCopy ¶
func (in *NodeMetadata) DeepCopy() *NodeMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeMetadata.
func (*NodeMetadata) DeepCopyInto ¶
func (in *NodeMetadata) DeepCopyInto(out *NodeMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NonLimitedResourceError ¶
type NonLimitedResourceError struct {
// contains filtered or unexported fields
}
func NewNonLimitedResourceError ¶
func NewNonLimitedResourceError(kindGroup string) *NonLimitedResourceError
func (*NonLimitedResourceError) DeepCopy ¶
func (in *NonLimitedResourceError) DeepCopy() *NonLimitedResourceError
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NonLimitedResourceError.
func (*NonLimitedResourceError) DeepCopyInto ¶
func (in *NonLimitedResourceError) DeepCopyInto(out *NonLimitedResourceError)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (NonLimitedResourceError) Error ¶
func (n NonLimitedResourceError) Error() string
type ObjectReference ¶
type ObjectReference struct {
ObjectReferenceAbstract `json:",inline"`
// Label selector used to select the given resources in the given Namespace.
Selector metav1.LabelSelector `json:"selector"`
}
func (*ObjectReference) DeepCopy ¶
func (in *ObjectReference) DeepCopy() *ObjectReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference.
func (*ObjectReference) DeepCopyInto ¶
func (in *ObjectReference) DeepCopyInto(out *ObjectReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ObjectReferenceAbstract ¶
type ObjectReferenceAbstract struct {
// Kind of the referent.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Kind string `json:"kind"`
// Namespace of the referent.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Namespace string `json:"namespace"`
// API version of the referent.
APIVersion string `json:"apiVersion,omitempty"`
}
func (*ObjectReferenceAbstract) DeepCopy ¶
func (in *ObjectReferenceAbstract) DeepCopy() *ObjectReferenceAbstract
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReferenceAbstract.
func (*ObjectReferenceAbstract) DeepCopyInto ¶
func (in *ObjectReferenceAbstract) DeepCopyInto(out *ObjectReferenceAbstract)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ObjectReferenceStatus ¶
type ObjectReferenceStatus struct {
ObjectReferenceAbstract `json:",inline"`
// Name of the referent.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Name string `json:"name"`
}
func (*ObjectReferenceStatus) DeepCopy ¶
func (in *ObjectReferenceStatus) DeepCopy() *ObjectReferenceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReferenceStatus.
func (*ObjectReferenceStatus) DeepCopyInto ¶
func (in *ObjectReferenceStatus) DeepCopyInto(out *ObjectReferenceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ObjectReferenceStatus) ParseFromString ¶
func (in *ObjectReferenceStatus) ParseFromString(value string) error
func (*ObjectReferenceStatus) String ¶
func (in *ObjectReferenceStatus) String() string
type OwnerListSpec ¶
type OwnerListSpec []OwnerSpec
func (OwnerListSpec) DeepCopy ¶
func (in OwnerListSpec) DeepCopy() OwnerListSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OwnerListSpec.
func (OwnerListSpec) DeepCopyInto ¶
func (in OwnerListSpec) DeepCopyInto(out *OwnerListSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OwnerSpec ¶
type OwnerSpec struct {
// Kind of tenant owner. Possible values are "User", "Group", and "ServiceAccount"
Kind OwnerKind `json:"kind"`
// Name of tenant owner.
Name string `json:"name"`
// Defines additional cluster-roles for the specific Owner.
// +kubebuilder:default={admin,capsule-namespace-deleter}
ClusterRoles []string `json:"clusterRoles,omitempty"`
// Proxy settings for tenant owner.
ProxyOperations []ProxySettings `json:"proxySettings,omitempty"`
// Additional Labels for the synchronized rolebindings
Labels map[string]string `json:"labels,omitempty"`
// Additional Annotations for the synchronized rolebindings
Annotations map[string]string `json:"annotations,omitempty"`
}
func (*OwnerSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OwnerSpec.
func (*OwnerSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProcessedItems ¶
type ProcessedItems []ObjectReferenceStatus
func (ProcessedItems) DeepCopy ¶
func (in ProcessedItems) DeepCopy() ProcessedItems
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProcessedItems.
func (ProcessedItems) DeepCopyInto ¶
func (in ProcessedItems) DeepCopyInto(out *ProcessedItems)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProxyOperation ¶
type ProxyOperation string
+kubebuilder:validation:Enum=List;Update;Delete
func (ProxyOperation) String ¶
func (p ProxyOperation) String() string
type ProxyServiceKind ¶
type ProxyServiceKind string
+kubebuilder:validation:Enum=Nodes;StorageClasses;IngressClasses;PriorityClasses;RuntimeClasses;PersistentVolumes
func (ProxyServiceKind) String ¶
func (p ProxyServiceKind) String() string
type ProxySettings ¶
type ProxySettings struct {
Kind ProxyServiceKind `json:"kind"`
Operations []ProxyOperation `json:"operations"`
}
func (*ProxySettings) DeepCopy ¶
func (in *ProxySettings) DeepCopy() *ProxySettings
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySettings.
func (*ProxySettings) DeepCopyInto ¶
func (in *ProxySettings) DeepCopyInto(out *ProxySettings)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RawExtension ¶
type RawExtension struct {
runtime.RawExtension `json:",inline"`
}
+kubebuilder:validation:XEmbeddedResource +kubebuilder:validation:XPreserveUnknownFields
func (*RawExtension) DeepCopy ¶
func (in *RawExtension) DeepCopy() *RawExtension
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawExtension.
func (*RawExtension) DeepCopyInto ¶
func (in *RawExtension) DeepCopyInto(out *RawExtension)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePool ¶ added in v0.10.0
type ResourcePool struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ResourcePoolSpec `json:"spec,omitempty"`
Status ResourcePoolStatus `json:"status,omitempty"`
}
Resourcepools allows you to define a set of resources as known from ResoureQuotas. The Resourcepools are defined at cluster-scope an should be administrated by cluster-administrators. However they create an interface, where cluster-administrators can define from which namespaces resources from a Resourcepool can be claimed. The claiming is done via a namespaced CRD called ResourcePoolClaim. Then it's up the group of users within these namespaces, to manage the resources they consume per namespace. Each Resourcepool provisions a ResourceQuotainto all the selected namespaces. Then essentially the ResourcePoolClaims, when they can be assigned to the ResourcePool stack resources on top of that ResourceQuota based on the namspace, where the ResourcePoolClaim was made from.
func (*ResourcePool) AddClaimToStatus ¶ added in v0.10.0
func (r *ResourcePool) AddClaimToStatus(claim *ResourcePoolClaim)
func (*ResourcePool) AssignClaims ¶ added in v0.10.0
func (r *ResourcePool) AssignClaims()
func (*ResourcePool) AssignNamespaces ¶ added in v0.10.0
func (r *ResourcePool) AssignNamespaces(namespaces []corev1.Namespace)
func (*ResourcePool) CalculateAvailableResources ¶ added in v0.10.0
func (r *ResourcePool) CalculateAvailableResources()
func (*ResourcePool) CalculateClaimedResources ¶ added in v0.10.0
func (r *ResourcePool) CalculateClaimedResources()
func (*ResourcePool) CanClaimFromPool ¶ added in v0.10.0
func (r *ResourcePool) CanClaimFromPool(claim corev1.ResourceList) []error
func (*ResourcePool) DeepCopy ¶ added in v0.10.0
func (in *ResourcePool) DeepCopy() *ResourcePool
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePool.
func (*ResourcePool) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePool) DeepCopyInto(out *ResourcePool)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourcePool) DeepCopyObject ¶ added in v0.10.0
func (in *ResourcePool) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ResourcePool) GetAvailableClaimableResources ¶ added in v0.10.0
func (r *ResourcePool) GetAvailableClaimableResources() corev1.ResourceList
func (*ResourcePool) GetClaimFromStatus ¶ added in v0.10.0
func (r *ResourcePool) GetClaimFromStatus(cl *ResourcePoolClaim) *ResourcePoolClaimsItem
func (*ResourcePool) GetClaimedByNamespaceClaims ¶ added in v0.10.0
func (r *ResourcePool) GetClaimedByNamespaceClaims() (claims map[string]corev1.ResourceList)
Calculate usage for each namespace.
func (*ResourcePool) GetNamespaceClaims ¶ added in v0.10.0
func (r *ResourcePool) GetNamespaceClaims(namespace string) (claims map[string]*ResourcePoolClaimsItem, claimedResources corev1.ResourceList)
Gets the total amount of claimed resources for a namespace.
func (*ResourcePool) GetResourceQuotaHardResources ¶ added in v0.10.0
func (r *ResourcePool) GetResourceQuotaHardResources(namespace string) corev1.ResourceList
Gets the Hard specification for the resourcequotas This takes into account the default resources being used. However they don't count towards the claim usage This can be changed in the future, the default is not calculated as usage because this might interrupt the namespace management As we would need to verify if a new namespace with it's defaults still has place in the Pool. Same with attempting to join existing namespaces.
func (*ResourcePool) RemoveClaimFromStatus ¶ added in v0.10.0
func (r *ResourcePool) RemoveClaimFromStatus(claim *ResourcePoolClaim)
type ResourcePoolClaim ¶ added in v0.10.0
type ResourcePoolClaim struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ResourcePoolClaimSpec `json:"spec,omitempty"`
Status ResourcePoolClaimStatus `json:"status,omitempty"`
}
ResourcePoolClaim is the Schema for the resourcepoolclaims API.
func (*ResourcePoolClaim) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolClaim) DeepCopy() *ResourcePoolClaim
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolClaim.
func (*ResourcePoolClaim) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolClaim) DeepCopyInto(out *ResourcePoolClaim)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourcePoolClaim) DeepCopyObject ¶ added in v0.10.0
func (in *ResourcePoolClaim) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ResourcePoolClaim) IsBoundToResourcePool ¶ added in v0.10.0
func (r *ResourcePoolClaim) IsBoundToResourcePool() bool
Indicate the claim is bound to a resource pool.
type ResourcePoolClaimList ¶ added in v0.10.0
type ResourcePoolClaimList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourcePoolClaim `json:"items"`
}
ResourceQuotaClaimList contains a list of ResourceQuotaClaim.
func (*ResourcePoolClaimList) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolClaimList) DeepCopy() *ResourcePoolClaimList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolClaimList.
func (*ResourcePoolClaimList) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolClaimList) DeepCopyInto(out *ResourcePoolClaimList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourcePoolClaimList) DeepCopyObject ¶ added in v0.10.0
func (in *ResourcePoolClaimList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ResourcePoolClaimSpec ¶ added in v0.10.0
type ResourcePoolClaimSpec struct {
// If there's the possability to claim from multiple global Quotas
// You must be specific about which one you want to claim resources from
// Once bound to a ResourcePool, this field is immutable
Pool string `json:"pool"`
// Amount which should be claimed for the resourcequota
ResourceClaims corev1.ResourceList `json:"claim"`
}
func (*ResourcePoolClaimSpec) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolClaimSpec) DeepCopy() *ResourcePoolClaimSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolClaimSpec.
func (*ResourcePoolClaimSpec) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolClaimSpec) DeepCopyInto(out *ResourcePoolClaimSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePoolClaimStatus ¶ added in v0.10.0
type ResourcePoolClaimStatus struct {
// Reference to the GlobalQuota being claimed from
Pool api.StatusNameUID `json:"pool,omitempty"`
// Condtion for this resource claim
Condition metav1.Condition `json:"condition,omitempty"`
}
ResourceQuotaClaimStatus defines the observed state of ResourceQuotaClaim.
func (*ResourcePoolClaimStatus) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolClaimStatus) DeepCopy() *ResourcePoolClaimStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolClaimStatus.
func (*ResourcePoolClaimStatus) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolClaimStatus) DeepCopyInto(out *ResourcePoolClaimStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePoolClaimsItem ¶ added in v0.10.0
type ResourcePoolClaimsItem struct {
// Reference to the GlobalQuota being claimed from
api.StatusNameUID `json:",inline"`
// Claimed resources
Claims corev1.ResourceList `json:"claims,omitempty"`
}
ResourceQuotaClaimStatus defines the observed state of ResourceQuotaClaim.
func (*ResourcePoolClaimsItem) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolClaimsItem) DeepCopy() *ResourcePoolClaimsItem
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolClaimsItem.
func (*ResourcePoolClaimsItem) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolClaimsItem) DeepCopyInto(out *ResourcePoolClaimsItem)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePoolClaimsList ¶ added in v0.10.0
type ResourcePoolClaimsList []*ResourcePoolClaimsItem
func (ResourcePoolClaimsList) DeepCopy ¶ added in v0.10.0
func (in ResourcePoolClaimsList) DeepCopy() ResourcePoolClaimsList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolClaimsList.
func (ResourcePoolClaimsList) DeepCopyInto ¶ added in v0.10.0
func (in ResourcePoolClaimsList) DeepCopyInto(out *ResourcePoolClaimsList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourcePoolClaimsList) GetClaimByUID ¶ added in v0.10.0
func (r *ResourcePoolClaimsList) GetClaimByUID(uid types.UID) *ResourcePoolClaimsItem
type ResourcePoolList ¶ added in v0.10.0
type ResourcePoolList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ResourcePool `json:"items"`
}
ResourcePoolList contains a list of ResourcePool.
func (*ResourcePoolList) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolList) DeepCopy() *ResourcePoolList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolList.
func (*ResourcePoolList) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolList) DeepCopyInto(out *ResourcePoolList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourcePoolList) DeepCopyObject ¶ added in v0.10.0
func (in *ResourcePoolList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ResourcePoolNamespaceClaimsStatus ¶ added in v0.10.0
type ResourcePoolNamespaceClaimsStatus map[string]ResourcePoolClaimsList
func (ResourcePoolNamespaceClaimsStatus) DeepCopy ¶ added in v0.10.0
func (in ResourcePoolNamespaceClaimsStatus) DeepCopy() ResourcePoolNamespaceClaimsStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolNamespaceClaimsStatus.
func (ResourcePoolNamespaceClaimsStatus) DeepCopyInto ¶ added in v0.10.0
func (in ResourcePoolNamespaceClaimsStatus) DeepCopyInto(out *ResourcePoolNamespaceClaimsStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePoolQuotaStatus ¶ added in v0.10.0
type ResourcePoolQuotaStatus struct {
// Hard is the set of enforced hard limits for each named resource.
// More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/
// +optional
Hard corev1.ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"`
// Used is the current observed total usage of the resource in the namespace.
// +optional
Claimed corev1.ResourceList `json:"used,omitempty" protobuf:"bytes,2,rep,name=used,casttype=ResourceList,castkey=ResourceName"`
// Used to track the usage of the resource in the pool (diff hard - claimed). May be used for further automation
// +optional
Available corev1.ResourceList `json:"available,omitempty" protobuf:"bytes,2,rep,name=available,casttype=ResourceList,castkey=ResourceName"`
}
func (*ResourcePoolQuotaStatus) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolQuotaStatus) DeepCopy() *ResourcePoolQuotaStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolQuotaStatus.
func (*ResourcePoolQuotaStatus) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolQuotaStatus) DeepCopyInto(out *ResourcePoolQuotaStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePoolSpec ¶ added in v0.10.0
type ResourcePoolSpec struct {
// Selector to match the namespaces that should be managed by the GlobalResourceQuota
Selectors []api.NamespaceSelector `json:"selectors,omitempty"`
// Define the resourcequota served by this resourcepool.
Quota corev1.ResourceQuotaSpec `json:"quota"`
// The Defaults given for each namespace, the default is not counted towards the total allocation
// When you use claims it's recommended to provision Defaults as the prevent the scheduling of any resources
Defaults corev1.ResourceList `json:"defaults,omitempty"`
// Additional Configuration
//+kubebuilder:default:={}
Config ResourcePoolSpecConfiguration `json:"config,omitempty"`
}
ResourcePoolSpec.
func (*ResourcePoolSpec) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolSpec) DeepCopy() *ResourcePoolSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolSpec.
func (*ResourcePoolSpec) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolSpec) DeepCopyInto(out *ResourcePoolSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePoolSpecConfiguration ¶ added in v0.10.0
type ResourcePoolSpecConfiguration struct {
// With this option all resources which can be allocated are set to 0 for the resourcequota defaults.
// +kubebuilder:default=false
DefaultsAssignZero *bool `json:"defaultsZero,omitempty"`
// Claims are queued whenever they are allocated to a pool. A pool tries to allocate claims in order based on their
// creation date. But no matter their creation time, if a claim is requesting too much resources it's put into the queue
// but if a lower priority claim still has enough space in the available resources, it will be able to claim them. Eventough
// it's priority was lower
// Enabling this option respects to Order. Meaning the Creationtimestamp matters and if a resource is put into the queue, no
// other claim can claim the same resources with lower priority.
// +kubebuilder:default=false
OrderedQueue *bool `json:"orderedQueue,omitempty"`
// When a resourcepool is deleted, the resourceclaims bound to it are disassociated from the resourcepool but not deleted.
// By Enabling this option, the resourceclaims will be deleted when the resourcepool is deleted, if they are in bound state.
// +kubebuilder:default=false
DeleteBoundResources *bool `json:"deleteBoundResources,omitempty"`
}
func (*ResourcePoolSpecConfiguration) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolSpecConfiguration) DeepCopy() *ResourcePoolSpecConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolSpecConfiguration.
func (*ResourcePoolSpecConfiguration) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolSpecConfiguration) DeepCopyInto(out *ResourcePoolSpecConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePoolStatus ¶ added in v0.10.0
type ResourcePoolStatus struct {
// How many namespaces are considered
// +kubebuilder:default=0
NamespaceSize uint `json:"namespaceCount,omitempty"`
// Amount of claims
// +kubebuilder:default=0
ClaimSize uint `json:"claimCount,omitempty"`
// Namespaces which are considered for claims
Namespaces []string `json:"namespaces,omitempty"`
// Tracks the quotas for the Resource.
Claims ResourcePoolNamespaceClaimsStatus `json:"claims,omitempty"`
// Tracks the Usage from Claimed against what has been granted from the pool
Allocation ResourcePoolQuotaStatus `json:"allocation,omitempty"`
// Exhaustions from claims associated with the pool
Exhaustions map[string]api.PoolExhaustionResource `json:"exhaustions,omitempty"`
}
GlobalResourceQuotaStatus defines the observed state of GlobalResourceQuota.
func (*ResourcePoolStatus) DeepCopy ¶ added in v0.10.0
func (in *ResourcePoolStatus) DeepCopy() *ResourcePoolStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePoolStatus.
func (*ResourcePoolStatus) DeepCopyInto ¶ added in v0.10.0
func (in *ResourcePoolStatus) DeepCopyInto(out *ResourcePoolStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceSpec ¶
type ResourceSpec struct {
// Defines the Namespace selector to select the Tenant Namespaces on which the resources must be propagated.
// In case of nil value, all the Tenant Namespaces are targeted.
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`
// List of the resources already existing in other Namespaces that must be replicated.
NamespacedItems []ObjectReference `json:"namespacedItems,omitempty"`
// List of raw resources that must be replicated.
RawItems []RawExtension `json:"rawItems,omitempty"`
// Besides the Capsule metadata required by TenantResource controller, defines additional metadata that must be
// added to the replicated resources.
AdditionalMetadata *api.AdditionalMetadataSpec `json:"additionalMetadata,omitempty"`
}
func (*ResourceSpec) DeepCopy ¶
func (in *ResourceSpec) DeepCopy() *ResourceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSpec.
func (*ResourceSpec) DeepCopyInto ¶
func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec)
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"`
}
+kubebuilder:object:root=true +kubebuilder:storageversion +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,shortName=tnt +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.conditions[?(@.type==\"Cordoned\")].reason",description="The actual state of the Tenant" +kubebuilder:printcolumn:name="Namespace quota",type="integer",JSONPath=".spec.namespaceOptions.quota",description="The max amount of Namespaces can be created" +kubebuilder:printcolumn:name="Namespace count",type="integer",JSONPath=".status.size",description="The total amount of Namespaces in use" +kubebuilder:printcolumn:name="Node selector",type="string",JSONPath=".spec.nodeSelector",description="Node Selector applied to Pods" +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="Reconcile Status for the tenant" +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description="Reconcile Message for the tenant" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Age" Tenant is the Schema for the tenants API.
func (*Tenant) AssignNamespaces ¶
func (*Tenant) ConvertFrom ¶
func (in *Tenant) ConvertFrom(raw conversion.Hub) error
func (*Tenant) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tenant.
func (*Tenant) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Tenant) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Tenant) GetClusterRolesBySubject ¶ added in v0.7.2
func (in *Tenant) GetClusterRolesBySubject(ignoreOwnerKind []OwnerKind) (maps map[string]map[string]api.TenantSubjectRoles)
Get the permissions for a tenant ordered by groups and users.
func (*Tenant) GetNamespaces ¶
func (*Tenant) GetOwnerProxySettings ¶
func (in *Tenant) GetOwnerProxySettings(name string, kind OwnerKind) []ProxySettings
func (*Tenant) GetSubjectsByClusterRoles ¶ added in v0.7.2
func (in *Tenant) GetSubjectsByClusterRoles(ignoreOwnerKind []OwnerKind) (rolePerms map[string][]rbacv1.Subject)
GetClusterRolePermissions returns a map where the clusterRole is the key and the value is a list of permission subjects (kind and name) that reference that role. These mappings are gathered from the owners and additionalRolebindings spec.
type TenantList ¶
type TenantList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Tenant `json:"items"`
}
TenantList contains a list of Tenant.
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 TenantResource ¶
type TenantResource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec TenantResourceSpec `json:"spec,omitempty"`
Status TenantResourceStatus `json:"status,omitempty"`
}
TenantResource allows a Tenant Owner, if enabled with proper RBAC, to propagate resources in its Namespace. The object must be deployed in a Tenant Namespace, and cannot reference object living in non-Tenant namespaces. For such cases, the GlobalTenantResource must be used.
func (*TenantResource) DeepCopy ¶
func (in *TenantResource) DeepCopy() *TenantResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResource.
func (*TenantResource) DeepCopyInto ¶
func (in *TenantResource) DeepCopyInto(out *TenantResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TenantResource) DeepCopyObject ¶
func (in *TenantResource) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TenantResourceList ¶
type TenantResourceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []TenantResource `json:"items"`
}
TenantResourceList contains a list of TenantResource.
func (*TenantResourceList) DeepCopy ¶
func (in *TenantResourceList) DeepCopy() *TenantResourceList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResourceList.
func (*TenantResourceList) DeepCopyInto ¶
func (in *TenantResourceList) DeepCopyInto(out *TenantResourceList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TenantResourceList) DeepCopyObject ¶
func (in *TenantResourceList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TenantResourceSpec ¶
type TenantResourceSpec struct {
// Define the period of time upon a second reconciliation must be invoked.
// Keep in mind that any change to the manifests will trigger a new reconciliation.
// +kubebuilder:default="60s"
ResyncPeriod metav1.Duration `json:"resyncPeriod"`
// When the replicated resource manifest is deleted, all the objects replicated so far will be automatically deleted.
// Disable this to keep replicated resources although the deletion of the replication manifest.
// +kubebuilder:default=true
PruningOnDelete *bool `json:"pruningOnDelete,omitempty"`
// Defines the rules to select targeting Namespace, along with the objects that must be replicated.
Resources []ResourceSpec `json:"resources"`
}
TenantResourceSpec defines the desired state of TenantResource.
func (*TenantResourceSpec) DeepCopy ¶
func (in *TenantResourceSpec) DeepCopy() *TenantResourceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResourceSpec.
func (*TenantResourceSpec) DeepCopyInto ¶
func (in *TenantResourceSpec) DeepCopyInto(out *TenantResourceSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TenantResourceStatus ¶
type TenantResourceStatus struct {
// List of the replicated resources for the given TenantResource.
ProcessedItems ProcessedItems `json:"processedItems"`
}
TenantResourceStatus defines the observed state of TenantResource.
func (*TenantResourceStatus) DeepCopy ¶
func (in *TenantResourceStatus) DeepCopy() *TenantResourceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantResourceStatus.
func (*TenantResourceStatus) DeepCopyInto ¶
func (in *TenantResourceStatus) DeepCopyInto(out *TenantResourceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TenantSpec ¶
type TenantSpec struct {
// Specifies the owners of the Tenant.
// Optional
Owners OwnerListSpec `json:"owners,omitempty"`
// Specifies options for the Namespaces, such as additional metadata or maximum number of namespaces allowed for that Tenant. Once the namespace quota assigned to the Tenant has been reached, the Tenant owner cannot create further namespaces. Optional.
NamespaceOptions *NamespaceOptions `json:"namespaceOptions,omitempty"`
// Specifies options for the Service, such as additional metadata or block of certain type of Services. Optional.
ServiceOptions *api.ServiceOptions `json:"serviceOptions,omitempty"`
// Specifies options for the Pods deployed in the Tenant namespaces, such as additional metadata.
PodOptions *api.PodOptions `json:"podOptions,omitempty"`
// Specifies the allowed StorageClasses assigned to the Tenant.
// Capsule assures that all PersistentVolumeClaim resources created in the Tenant can use only one of the allowed StorageClasses.
// A default value can be specified, and all the PersistentVolumeClaim resources created will inherit the declared class.
// Optional.
StorageClasses *api.DefaultAllowedListSpec `json:"storageClasses,omitempty"`
// Specifies options for the Ingress resources, such as allowed hostnames and IngressClass. Optional.
IngressOptions IngressOptions `json:"ingressOptions,omitempty"`
// Specifies the trusted Image Registries assigned to the Tenant. Capsule assures that all Pods resources created in the Tenant can use only one of the allowed trusted registries. Optional.
ContainerRegistries *api.AllowedListSpec `json:"containerRegistries,omitempty"`
// Specifies the label to control the placement of pods on a given pool of worker nodes. All namespaces created within the Tenant will have the node selector annotation. This annotation tells the Kubernetes scheduler to place pods on the nodes having the selector label. Optional.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Specifies the NetworkPolicies assigned to the Tenant. The assigned NetworkPolicies are inherited by any namespace created in the Tenant. Optional.
// Deprecated: Use Tenant Replications instead (https://projectcapsule.dev/docs/replications/)
NetworkPolicies api.NetworkPolicySpec `json:"networkPolicies,omitempty"`
// Specifies the resource min/max usage restrictions to the Tenant. The assigned values are inherited by any namespace created in the Tenant. Optional.
// Deprecated: Use Tenant Replications instead (https://projectcapsule.dev/docs/replications/)
LimitRanges api.LimitRangesSpec `json:"limitRanges,omitempty"`
// Specifies a list of ResourceQuota resources assigned to the Tenant. The assigned values are inherited by any namespace created in the Tenant. The Capsule operator aggregates ResourceQuota at Tenant level, so that the hard quota is never crossed for the given Tenant. This permits the Tenant owner to consume resources in the Tenant regardless of the namespace. Optional.
ResourceQuota api.ResourceQuotaSpec `json:"resourceQuotas,omitempty"`
// Specifies additional RoleBindings assigned to the Tenant. Capsule will ensure that all namespaces in the Tenant always contain the RoleBinding for the given ClusterRole. Optional.
AdditionalRoleBindings []api.AdditionalRoleBindingsSpec `json:"additionalRoleBindings,omitempty"`
// Specify the allowed values for the imagePullPolicies option in Pod resources. Capsule assures that all Pod resources created in the Tenant can use only one of the allowed policy. Optional.
ImagePullPolicies []api.ImagePullPolicySpec `json:"imagePullPolicies,omitempty"`
// Specifies the allowed RuntimeClasses assigned to the Tenant.
// Capsule assures that all Pods resources created in the Tenant can use only one of the allowed RuntimeClasses.
// Optional.
RuntimeClasses *api.DefaultAllowedListSpec `json:"runtimeClasses,omitempty"`
// Specifies the allowed priorityClasses assigned to the Tenant.
// Capsule assures that all Pods resources created in the Tenant can use only one of the allowed PriorityClasses.
// A default value can be specified, and all the Pod resources created will inherit the declared class.
// Optional.
PriorityClasses *api.DefaultAllowedListSpec `json:"priorityClasses,omitempty"`
// Specifies options for the GatewayClass resources.
GatewayOptions GatewayOptions `json:"gatewayOptions,omitempty"`
// Toggling the Tenant resources cordoning, when enable resources cannot be deleted.
//+kubebuilder:default:=false
Cordoned bool `json:"cordoned,omitempty"`
// Prevent accidental deletion of the Tenant.
// When enabled, the deletion request will be declined.
//+kubebuilder:default:=false
PreventDeletion bool `json:"preventDeletion,omitempty"`
// Use this if you want to disable/enable the Tenant name prefix to specific Tenants, overriding global forceTenantPrefix in CapsuleConfiguration.
// When set to 'true', it enforces Namespaces created for this Tenant to be named with the Tenant name prefix,
// separated by a dash (i.e. for Tenant 'foo', namespace names must be prefixed with 'foo-'),
// this is useful to avoid Namespace name collision.
// When set to 'false', it allows Namespaces created for this Tenant to be named anything.
// Overrides CapsuleConfiguration global forceTenantPrefix for the Tenant only.
// If unset, Tenant uses CapsuleConfiguration's forceTenantPrefix
// Optional
ForceTenantPrefix *bool `json:"forceTenantPrefix,omitempty"`
}
TenantSpec defines the desired state of 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 {
// +kubebuilder:default=Active
// The operational state of the Tenant. Possible values are "Active", "Cordoned".
State tenantState `json:"state"`
// How many namespaces are assigned to the Tenant.
Size uint `json:"size"`
// List of namespaces assigned to the Tenant. (Deprecated)
Namespaces []string `json:"namespaces,omitempty"`
// Tracks state for the namespaces associated with this tenant
Spaces []*TenantStatusNamespaceItem `json:"spaces,omitempty"`
// Tenant Condition
Conditions meta.ConditionList `json:"conditions"`
}
Returns the observed state 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.
func (*TenantStatus) GetInstance ¶ added in v0.11.0
func (ms *TenantStatus) GetInstance(stat *TenantStatusNamespaceItem) *TenantStatusNamespaceItem
func (*TenantStatus) RemoveInstance ¶ added in v0.11.0
func (ms *TenantStatus) RemoveInstance(stat *TenantStatusNamespaceItem)
func (*TenantStatus) UpdateInstance ¶ added in v0.11.0
func (ms *TenantStatus) UpdateInstance(stat *TenantStatusNamespaceItem)
type TenantStatusNamespaceItem ¶ added in v0.11.0
type TenantStatusNamespaceItem struct {
// Conditions
Conditions meta.ConditionList `json:"conditions"`
// Namespace Name
Name string `json:"name"`
// Namespace UID
UID k8stypes.UID `json:"uid,omitempty"`
// Managed Metadata
Metadata *TenantStatusNamespaceMetadata `json:"metadata,omitempty"`
}
func (*TenantStatusNamespaceItem) DeepCopy ¶ added in v0.11.0
func (in *TenantStatusNamespaceItem) DeepCopy() *TenantStatusNamespaceItem
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantStatusNamespaceItem.
func (*TenantStatusNamespaceItem) DeepCopyInto ¶ added in v0.11.0
func (in *TenantStatusNamespaceItem) DeepCopyInto(out *TenantStatusNamespaceItem)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TenantStatusNamespaceMetadata ¶ added in v0.11.0
type TenantStatusNamespaceMetadata struct {
// Managed Labels
Labels map[string]string `json:"labels,omitempty"`
// Managed Annotations
Annotations map[string]string `json:"annotations,omitempty"`
}
func (*TenantStatusNamespaceMetadata) DeepCopy ¶ added in v0.11.0
func (in *TenantStatusNamespaceMetadata) DeepCopy() *TenantStatusNamespaceMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantStatusNamespaceMetadata.
func (*TenantStatusNamespaceMetadata) DeepCopyInto ¶ added in v0.11.0
func (in *TenantStatusNamespaceMetadata) DeepCopyInto(out *TenantStatusNamespaceMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Source Files
¶
- additional_role_bindings.go
- capsuleconfiguration_types.go
- custom_resource_quota.go
- gateway_options.go
- groupversion_info.go
- ingress_options.go
- namespace_options.go
- owner.go
- owner_list.go
- resourcepool_func.go
- resourcepool_status.go
- resourcepool_types.go
- resourcepoolclaim_func.go
- resourcepoolclaim_types.go
- tenant_annotations.go
- tenant_conversion_hub.go
- tenant_func.go
- tenant_labels.go
- tenant_status.go
- tenant_types.go
- tenantresource_global.go
- tenantresource_namespaced.go
- tenantresource_types.go
- zz_generated.deepcopy.go