Documentation ¶
Index ¶
- Constants
- Variables
- func ClusterToARD(cluster *Cluster) ard.StringMap
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- func SeedToARD(service *Seed) ard.StringMap
- type Cluster
- type ClusterList
- type ClusterNode
- type ClusterSpec
- type ClusterStatus
- type Seed
- type SeedList
- type SeedSpec
- type SeedStatus
Constants ¶
const ( ClusterKind = "Cluster" ClusterListKind = "ClusterList" ClusterSingular = "cluster" ClusterPlural = "clusters" ClusterShortName = "pc" // = Planter Cluster )
const ( KernelConfigKind = "KernelConfig" KernelConfigListKind = "KernelConfigList" KernelConfigSingular = "kernelconfig" KernelConfigPlural = "kernelconfigs" )
const ( MemoryConfigKind = "MemoryConfig" MemoryConfigListKind = "MemoryConfigList" MemoryConfigSingular = "memoryconfig" MemoryConfigPlural = "memoryconfigs" )
const ( NetworkKind = "Network" NetworkListKind = "NetworkList" NetworkSingular = "network" NetworkPlural = "networks" )
const ( SeedKind = "Seed" SeedListKind = "SeedList" SeedSingular = "seed" SeedPlural = "seeds" SeedShortName = "ps" // = Planter Seed )
const ( WANKind = "WAN" WANListKind = "WANList" WANSingular = "wan" WANPlural = "wans" )
const Version = "v1alpha1"
+k8s:deepcopy-gen=package +groupName=planter.nephio.org
Variables ¶
var AddToScheme = schemeBuilder.AddToScheme
Registers this API group and version to a scheme Note: Generator *requires* it to be called "AddToScheme"
var ClusterCustomResourceDefinition = apiextensions.CustomResourceDefinition{ ObjectMeta: meta.ObjectMeta{ Name: ClusterResourcesName, }, Spec: apiextensions.CustomResourceDefinitionSpec{ Group: group.GroupName, Names: apiextensions.CustomResourceDefinitionNames{ Singular: ClusterSingular, Plural: ClusterPlural, Kind: ClusterKind, ListKind: ClusterListKind, ShortNames: []string{ ClusterShortName, }, Categories: []string{ "all", }, }, Scope: apiextensions.NamespaceScoped, Versions: []apiextensions.CustomResourceDefinitionVersion{ { Name: Version, Served: true, Storage: true, Subresources: &apiextensions.CustomResourceSubresources{ Status: &apiextensions.CustomResourceSubresourceStatus{}, }, Schema: &apiextensions.CustomResourceValidation{ OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ Description: "Planter cluster", Type: "object", Required: []string{"spec"}, Properties: map[string]apiextensions.JSONSchemaProps{ "spec": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "nodes": { Description: "Grouped node configurations", Type: "array", Items: &apiextensions.JSONSchemaPropsOrArray{ Schema: &apiextensions.JSONSchemaProps{ Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "count": { Description: "Amount of nodes in this group", Type: "integer", }, "labels": { Description: "Labels for the nodes in this group", Type: "object", Items: &apiextensions.JSONSchemaPropsOrArray{ Schema: &apiextensions.JSONSchemaProps{ Type: "string", }, }, }, "kernelConfig": { Description: "Optional name of KernelConfig resource for the nodes in this group", Type: "string", }, "memoryConfig": { Description: "Optional name of MemoryConfig resource for the nodes in this group", Type: "string", }, }, }, }, }, "wans": { Description: "WANs for reaching this cluster", Type: "array", Items: &apiextensions.JSONSchemaPropsOrArray{ Schema: &apiextensions.JSONSchemaProps{ Type: "string", }, }, }, }, }, "status": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "kubeconfigUrl": { Description: "Full URL of kubeconfig (YAML file)", Type: "string", }, "context": { Description: "Name of context to use in kubeconfig", Type: "string", }, }, }, }, }, }, }, }, }, }
var ClusterGVK = SchemeGroupVersion.WithKind(ClusterKind)
var ClusterResourcesName = fmt.Sprintf("%s.%s", ClusterPlural, group.GroupName)
var KernelConfigCustomResourceDefinition = apiextensions.CustomResourceDefinition{ ObjectMeta: meta.ObjectMeta{ Name: KernelConfigResourcesName, }, Spec: apiextensions.CustomResourceDefinitionSpec{ Group: group.GroupName, Names: apiextensions.CustomResourceDefinitionNames{ Singular: KernelConfigSingular, Plural: KernelConfigPlural, Kind: KernelConfigKind, ListKind: KernelConfigListKind, Categories: []string{ "all", }, }, Scope: apiextensions.NamespaceScoped, Versions: []apiextensions.CustomResourceDefinitionVersion{ { Name: Version, Served: true, Storage: true, Subresources: &apiextensions.CustomResourceSubresources{ Status: &apiextensions.CustomResourceSubresourceStatus{}, }, Schema: &apiextensions.CustomResourceValidation{ OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ Description: "Planter kernel config", Type: "object", Required: []string{"spec"}, Properties: map[string]apiextensions.JSONSchemaProps{ "spec": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "realtime": { Description: "Whether a realtime kernel should be used", Type: "boolean", }, }, }, "status": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{}, }, }, }, }, }, }, }, }
var KernelConfigResourcesName = fmt.Sprintf("%s.%s", KernelConfigPlural, group.GroupName)
var MemoryConfigCustomResourceDefinition = apiextensions.CustomResourceDefinition{ ObjectMeta: meta.ObjectMeta{ Name: MemoryConfigResourcesName, }, Spec: apiextensions.CustomResourceDefinitionSpec{ Group: group.GroupName, Names: apiextensions.CustomResourceDefinitionNames{ Singular: MemoryConfigSingular, Plural: MemoryConfigPlural, Kind: MemoryConfigKind, ListKind: MemoryConfigListKind, Categories: []string{ "all", }, }, Scope: apiextensions.NamespaceScoped, Versions: []apiextensions.CustomResourceDefinitionVersion{ { Name: Version, Served: true, Storage: true, Subresources: &apiextensions.CustomResourceSubresources{ Status: &apiextensions.CustomResourceSubresourceStatus{}, }, Schema: &apiextensions.CustomResourceValidation{ OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ Description: "Planter memory config", Type: "object", Required: []string{"spec"}, Properties: map[string]apiextensions.JSONSchemaProps{ "spec": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "numa": { Description: "Whether NUMA should be enabled", Type: "boolean", }, "hugePages": { Description: "Size of huge pages to be used", Type: "string", }, }, }, "status": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{}, }, }, }, }, }, }, }, }
var MemoryConfigResourcesName = fmt.Sprintf("%s.%s", MemoryConfigPlural, group.GroupName)
var NetworkCustomResourceDefinition = apiextensions.CustomResourceDefinition{ ObjectMeta: meta.ObjectMeta{ Name: NetworkResourcesName, }, Spec: apiextensions.CustomResourceDefinitionSpec{ Group: group.GroupName, Names: apiextensions.CustomResourceDefinitionNames{ Singular: NetworkSingular, Plural: NetworkPlural, Kind: NetworkKind, ListKind: NetworkListKind, Categories: []string{ "all", }, }, Scope: apiextensions.NamespaceScoped, Versions: []apiextensions.CustomResourceDefinitionVersion{ { Name: Version, Served: true, Storage: true, Subresources: &apiextensions.CustomResourceSubresources{ Status: &apiextensions.CustomResourceSubresourceStatus{}, }, Schema: &apiextensions.CustomResourceValidation{ OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ Description: "Planter network", Type: "object", Required: []string{"spec"}, Properties: map[string]apiextensions.JSONSchemaProps{ "spec": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "provider": { Description: "Network provider", Type: "string", }, }, }, "status": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{}, }, }, }, }, }, }, }, }
var NetworkResourcesName = fmt.Sprintf("%s.%s", NetworkPlural, group.GroupName)
var SchemeGroupVersion = schema.GroupVersion{Group: group.GroupName, Version: Version}
Group version used to register these objects Note: Generator *requires* it to be called "SchemeGroupVersion"
var SeedCustomResourceDefinition = apiextensions.CustomResourceDefinition{ ObjectMeta: meta.ObjectMeta{ Name: SeedResourcesName, }, Spec: apiextensions.CustomResourceDefinitionSpec{ Group: group.GroupName, Names: apiextensions.CustomResourceDefinitionNames{ Singular: SeedSingular, Plural: SeedPlural, Kind: SeedKind, ListKind: SeedListKind, ShortNames: []string{ SeedShortName, }, Categories: []string{ "all", }, }, Scope: apiextensions.NamespaceScoped, Versions: []apiextensions.CustomResourceDefinitionVersion{ { Name: Version, Served: true, Storage: true, Subresources: &apiextensions.CustomResourceSubresources{ Status: &apiextensions.CustomResourceSubresourceStatus{}, }, Schema: &apiextensions.CustomResourceValidation{ OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ Description: "Planter seed", Type: "object", Required: []string{"spec"}, Properties: map[string]apiextensions.JSONSchemaProps{ "spec": { Type: "object", Required: []string{"seedUrl"}, Properties: map[string]apiextensions.JSONSchemaProps{ "seedUrl": { Description: "Full URL of seed (YAML file)", Type: "string", }, "planted": { Description: "Whether the seed should be planted", Type: "boolean", }, }, }, "status": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "plantedPath": { Description: "Planted seed path or empty if not planted", Type: "string", }, }, }, }, }, }, AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{ { Name: "PlantedPath", Description: "Planted seed path or empty if not planted", Type: "string", JSONPath: ".status.plantedPath", }, }, }, }, }, }
var SeedGVK = SchemeGroupVersion.WithKind(SeedKind)
var SeedResourcesName = fmt.Sprintf("%s.%s", SeedPlural, group.GroupName)
var WANCustomResourceDefinition = apiextensions.CustomResourceDefinition{ ObjectMeta: meta.ObjectMeta{ Name: WANResourcesName, }, Spec: apiextensions.CustomResourceDefinitionSpec{ Group: group.GroupName, Names: apiextensions.CustomResourceDefinitionNames{ Singular: WANSingular, Plural: WANPlural, Kind: WANKind, ListKind: WANListKind, Categories: []string{ "all", }, }, Scope: apiextensions.NamespaceScoped, Versions: []apiextensions.CustomResourceDefinitionVersion{ { Name: Version, Served: true, Storage: true, Subresources: &apiextensions.CustomResourceSubresources{ Status: &apiextensions.CustomResourceSubresourceStatus{}, }, Schema: &apiextensions.CustomResourceValidation{ OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ Description: "Planter WAN", Type: "object", Required: []string{"spec"}, Properties: map[string]apiextensions.JSONSchemaProps{ "spec": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{ "provider": { Description: "WAN provider", Type: "string", }, }, }, "status": { Type: "object", Properties: map[string]apiextensions.JSONSchemaProps{}, }, }, }, }, }, }, }, }
Functions ¶
func ClusterToARD ¶
func Kind ¶
Takes an unqualified kind and returns a group-qualified GroupKind Note: Generator *requires* it to be called "Kind"
func Resource ¶
func Resource(resource string) schema.GroupResource
Takes an unqualified resource and returns a group-qualified GroupResource Note: Generator *requires* it to be called "Resource"
Types ¶
type Cluster ¶
type Cluster struct { meta.TypeMeta `json:",inline"` meta.ObjectMeta `json:"metadata,omitempty"` Spec ClusterSpec `json:"spec"` Status ClusterStatus `json:"status"` }
+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*Cluster) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
func (*Cluster) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Cluster) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterList ¶
type ClusterList struct { meta.TypeMeta `json:",inline"` meta.ListMeta `json:"metadata"` Items []Cluster `json:"items"` }
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*ClusterList) DeepCopy ¶
func (in *ClusterList) DeepCopy() *ClusterList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
func (*ClusterList) DeepCopyInto ¶
func (in *ClusterList) DeepCopyInto(out *ClusterList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterList) DeepCopyObject ¶
func (in *ClusterList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterNode ¶
type ClusterNode struct { Count int `json:"count"` // Amount of nodes in this group Labels map[string]string `json:"labels"` // Labels for the nodes in this group KernelConfig string `json:"kernelConfig,omitempty"` // Optional name of KernelConfig resource for the nodes in this group MemoryConfig string `json:"memoryConfig,omitempty"` // Optional name of MemoryConfig resource for the nodes in this group }
func (*ClusterNode) DeepCopy ¶
func (in *ClusterNode) DeepCopy() *ClusterNode
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNode.
func (*ClusterNode) DeepCopyInto ¶
func (in *ClusterNode) DeepCopyInto(out *ClusterNode)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterSpec ¶
type ClusterSpec struct { Nodes []ClusterNode `json:"nodes,omitempty"` // Grouped node configurations WANs []string `json:"wans"` // WANs for reaching this cluster }
func (*ClusterSpec) DeepCopy ¶
func (in *ClusterSpec) DeepCopy() *ClusterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
func (*ClusterSpec) DeepCopyInto ¶
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterStatus ¶
type ClusterStatus struct { KubeConfigURL string `json:"kubeconfigUrl,omitempty"` // Full URL of kubeconfig (YAML file) Context string `json:"context,omitempty"` // Name of context to use in kubeconfig }
func (*ClusterStatus) DeepCopy ¶
func (in *ClusterStatus) DeepCopy() *ClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
func (*ClusterStatus) DeepCopyInto ¶
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Seed ¶
type Seed struct { meta.TypeMeta `json:",inline"` meta.ObjectMeta `json:"metadata,omitempty"` Spec SeedSpec `json:"spec"` Status SeedStatus `json:"status"` }
+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*Seed) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Seed.
func (*Seed) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Seed) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SeedList ¶
type SeedList struct { meta.TypeMeta `json:",inline"` meta.ListMeta `json:"metadata"` Items []Seed `json:"items"` }
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*SeedList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SeedList.
func (*SeedList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SeedList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SeedSpec ¶
type SeedSpec struct { SeedURL string `json:"seedUrl"` // Full URL of seed (YAML file) Planted bool `json:"planted"` // Whether the seed should be planted }
func (*SeedSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SeedSpec.
func (*SeedSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SeedStatus ¶
type SeedStatus struct {
PlantedPath string `json:"plantedPath"` // Planted seed path or empty if not planted
}
func (*SeedStatus) DeepCopy ¶
func (in *SeedStatus) DeepCopy() *SeedStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SeedStatus.
func (*SeedStatus) DeepCopyInto ¶
func (in *SeedStatus) DeepCopyInto(out *SeedStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.