v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterKind     = "Cluster"
	ClusterListKind = "ClusterList"

	ClusterSingular  = "cluster"
	ClusterPlural    = "clusters"
	ClusterShortName = "pc" // = Planter Cluster
)
View Source
const (
	KernelConfigKind     = "KernelConfig"
	KernelConfigListKind = "KernelConfigList"

	KernelConfigSingular = "kernelconfig"
	KernelConfigPlural   = "kernelconfigs"
)
View Source
const (
	MemoryConfigKind     = "MemoryConfig"
	MemoryConfigListKind = "MemoryConfigList"

	MemoryConfigSingular = "memoryconfig"
	MemoryConfigPlural   = "memoryconfigs"
)
View Source
const (
	NetworkKind     = "Network"
	NetworkListKind = "NetworkList"

	NetworkSingular = "network"
	NetworkPlural   = "networks"
)
View Source
const (
	SeedKind     = "Seed"
	SeedListKind = "SeedList"

	SeedSingular  = "seed"
	SeedPlural    = "seeds"
	SeedShortName = "ps" // = Planter Seed
)
View Source
const (
	WANKind     = "WAN"
	WANListKind = "WANList"

	WANSingular = "wan"
	WANPlural   = "wans"
)
View Source
const Version = "v1alpha1"

+k8s:deepcopy-gen=package +groupName=planter.nephio.org

Variables

View Source
var AddToScheme = schemeBuilder.AddToScheme

Registers this API group and version to a scheme Note: Generator *requires* it to be called "AddToScheme"

View Source
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",
									},
								},
							},
						},
					},
				},
			},
		},
	},
}
View Source
var ClusterGVK = SchemeGroupVersion.WithKind(ClusterKind)
View Source
var ClusterResourcesName = fmt.Sprintf("%s.%s", ClusterPlural, group.GroupName)
View Source
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{},
							},
						},
					},
				},
			},
		},
	},
}
View Source
var KernelConfigResourcesName = fmt.Sprintf("%s.%s", KernelConfigPlural, group.GroupName)
View Source
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{},
							},
						},
					},
				},
			},
		},
	},
}
View Source
var MemoryConfigResourcesName = fmt.Sprintf("%s.%s", MemoryConfigPlural, group.GroupName)
View Source
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{},
							},
						},
					},
				},
			},
		},
	},
}
View Source
var NetworkResourcesName = fmt.Sprintf("%s.%s", NetworkPlural, group.GroupName)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: group.GroupName, Version: Version}

Group version used to register these objects Note: Generator *requires* it to be called "SchemeGroupVersion"

View Source
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",
					},
				},
			},
		},
	},
}
View Source
var SeedGVK = SchemeGroupVersion.WithKind(SeedKind)
View Source
var SeedResourcesName = fmt.Sprintf("%s.%s", SeedPlural, group.GroupName)
View Source
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{},
							},
						},
					},
				},
			},
		},
	},
}
View Source
var WANResourcesName = fmt.Sprintf("%s.%s", WANPlural, group.GroupName)

Functions

func ClusterToARD

func ClusterToARD(cluster *Cluster) ard.StringMap

func Kind

func Kind(kind string) schema.GroupKind

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"

func SeedToARD

func SeedToARD(service *Seed) ard.StringMap

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

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

func (*Cluster) DeepCopyObject

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

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

func (in *Seed) DeepCopy() *Seed

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

func (*Seed) DeepCopyInto

func (in *Seed) DeepCopyInto(out *Seed)

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

func (*Seed) DeepCopyObject

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

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

func (in *SeedList) DeepCopy() *SeedList

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

func (*SeedList) DeepCopyInto

func (in *SeedList) DeepCopyInto(out *SeedList)

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

func (*SeedList) DeepCopyObject

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

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

func (in *SeedSpec) DeepCopy() *SeedSpec

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

func (*SeedSpec) DeepCopyInto

func (in *SeedSpec) DeepCopyInto(out *SeedSpec)

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.

Jump to

Keyboard shortcuts

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