Documentation ¶
Overview ¶
Package v1alpha1 is the v1alpha1 version of the API. +groupName=tenants.k8s.io
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // SchemeBuilder is the exported SchemeBuilder for the API. SchemeBuilder = k8srt.NewSchemeBuilder(addKnownTypes) // AddToScheme is the exported AddToScheme func for the API. AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: api.GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects.
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource.
Types ¶
type NamespaceTemplate ¶
type NamespaceTemplate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec NamespaceTemplateSpec `json:"spec"` }
NamespaceTemplate defines a template of resources to be created inside a namespace.
func (*NamespaceTemplate) DeepCopy ¶
func (in *NamespaceTemplate) DeepCopy() *NamespaceTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceTemplate.
func (*NamespaceTemplate) DeepCopyInto ¶
func (in *NamespaceTemplate) DeepCopyInto(out *NamespaceTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NamespaceTemplate) DeepCopyObject ¶
func (in *NamespaceTemplate) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type NamespaceTemplateList ¶
type NamespaceTemplateList struct { metav1.TypeMeta `json:",inline"` // ListMeta is standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Items are list of NamespaceTemplate objects. Items []NamespaceTemplate `json:"items" protobuf:"bytes,2,rep,name=items` }
func (*NamespaceTemplateList) DeepCopy ¶
func (in *NamespaceTemplateList) DeepCopy() *NamespaceTemplateList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceTemplateList.
func (*NamespaceTemplateList) DeepCopyInto ¶
func (in *NamespaceTemplateList) DeepCopyInto(out *NamespaceTemplateList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NamespaceTemplateList) DeepCopyObject ¶
func (in *NamespaceTemplateList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type NamespaceTemplateSpec ¶
type NamespaceTemplateSpec struct {
Templates []apirt.RawExtension `json:"templates"`
}
NamespaceTemplateSpec defines the details in a NamespaceTemplate resource. The list of Templates is used for generating a manifest file containing all resources and shell-out to "kubectl apply" (let kubelet to handle the resource diff and merge, and don't re-implement this black-magic in client code) to be applied in a namespace. An example of a NamespaceTemplate will be something like:
apiVersion: tenants.k8s.io/v1alpha1 kind: NamespaceTemplate metadata:
name: restricted
spec:
templates: - apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: 'multitenancy:podsecuritypolicy' roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: 'multitenancy:use-psp:restricted' subjects: - kind: Group apiGroup: rbac.authorization.k8s.io name: system:serviceaccounts - apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: multitenancy-default spec: podSelector: {} policyTypes: - Ingress - Egress
func (*NamespaceTemplateSpec) DeepCopy ¶
func (in *NamespaceTemplateSpec) DeepCopy() *NamespaceTemplateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceTemplateSpec.
func (*NamespaceTemplateSpec) DeepCopyInto ¶
func (in *NamespaceTemplateSpec) DeepCopyInto(out *NamespaceTemplateSpec)
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"` // ObjectMeta is standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec is the details of the tenant. // +optional Spec TenantSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` // Status is the status of the tenant. // +optional Status TenantStatus `json:"status" protobuf:"bytes,3,opt,name=status"` }
Tenant is the resource represents a group of users belonging to the same tenant. A Tenant is a grouping concept of resources belong to a group of users (the tenant). Under a tenant, one or more namespaces are created. The OwerReferences in namespace resource will point to this Tenant resource, so once the Tenant resource is deleted, the namespaces will be garbage collected. Beyond this, the following labels are proposed to be associated with namespaces:
tenants.k8s.io/tenant=<name of Tenant resource>
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.
type TenantList ¶
type TenantList struct { metav1.TypeMeta `json:",inline"` // ListMeta is standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Items are list of Tenant objects. Items []Tenant `json:"items" protobuf:"bytes,2,rep,name=items` }
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 TenantNamespace ¶
TenantNamespace defines the namespaces belonging to this tenant.
func (*TenantNamespace) DeepCopy ¶
func (in *TenantNamespace) DeepCopy() *TenantNamespace
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantNamespace.
func (*TenantNamespace) DeepCopyInto ¶
func (in *TenantNamespace) DeepCopyInto(out *TenantNamespace)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TenantPhase ¶
type TenantPhase string
TenantPhase defines the phase of tenant status.
const ( // TenantPending means the tenant is going to be created, but not happening yet. // This is set right after the tenant is created. TenantPending TenantPhase = "Pending" // TenantCreating means tenant is being created. TenantCreating TenantPhase = "Creating" // TenantActive means tenant is ready and being used. TenantActive TenantPhase = "Active" // TenantTerminating means tenant is being removed. TenantTerminating TenantPhase = "Terminating" )
Known tenant phases.
type TenantSpec ¶
type TenantSpec struct { // Admins are the identities with admin privilege in namespaces. // +optional Admins []rbacv1.Subject `json:"admins"` // Namespaces are the namespaces created for the tenant. // +optional Namespaces []TenantNamespace `json:"namespaces"` }
TenantSpec defines the spec of a tenant resource. The Tenant controller will use the list of Namespaces here as the source of truth to reconciliate the actual namespaces belong to the tenant. Updating the namespace list here will trigger the reconciliation of namespaces.
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 { // Phase indicates if the tenant is Pending, Creating, Active or Terminating. // +optional Phase TenantPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=TenantPhase"` // Message provides human-readable information of current status. // +optional Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` // Reason is a brief CamelCase string describing the status. // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` }
TenantStatus defines the status of a tenant resource.
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.