Documentation ¶
Overview ¶
Package v1 defines version v1 k8s crd used by ote.
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type Cluster
- type ClusterController
- type ClusterControllerList
- type ClusterControllerSpec
- type ClusterControllerStatus
- type ClusterList
- type ClusterResource
- type ClusterSpec
- type ClusterStatus
Constants ¶
const ( ClusterControllerDestAPI = "api" // sent to k8s apiserver ClusterControllerDestHelm = "helm" // sent to helm ClusterControllerDestRegistCluster = "regist" // cluster regist ClusterControllerDestUnregistCluster = "unregist" // cluster unregist ClusterControllerDestClusterRoute = "route" // cluster route ClusterControllerDestClusterSubtree = "subtree" // cluster subtree ClusterStatusOnline = "online" ClusterStatusOffline = "offline" )
ClusterControllerDest* describe the way to process ClusterController, should be set to ClusterController.Spec.Destination.
const (
ClusterNamespace = "kube-system"
)
ClusterNamespace defines the namespace of k8s crd must be in. CRD out of the namespace won't be watched.
const (
ClusterStatusRegist = "regist"
)
ClusterStatusRegist describe a cluster registered status, should be set to Cluster.Spec.Status if a cluster've registered.
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
SchemeBuilder and AddToScheme is needed by k8s client-go, can be used to auto-generate crd clientset, etc.
var SchemeGroupVersion = schema.GroupVersion{Group: ote.GroupName, Version: "v1"}
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 Cluster ¶
type Cluster struct { metav1.TypeMeta `json:", inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ClusterSpec `json:"spec"` Status ClusterStatus `json:"status"` }
Cluster is the k8s crd to store cluster info.
func ClusterDeserialize ¶
ClusterDeserialize deserialize Cluster using json.
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.
func (*Cluster) WrapperToClusterController ¶
func (c *Cluster) WrapperToClusterController(dst string) (*ClusterController, error)
WrapperToClusterController wrapper a Cluster to a ClusterController using json.
type ClusterController ¶
type ClusterController struct { metav1.TypeMeta `json:", inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ClusterControllerSpec `json:"spec"` Status map[string]ClusterControllerStatus `json:"status"` }
ClusterController is the k8s crd to manipulate all clusters in ote.
func ClusterControllerDeserialize ¶
func ClusterControllerDeserialize(b []byte) (*ClusterController, error)
ClusterControllerDeserialize deserialize ClusterController using json.
func (*ClusterController) DeepCopy ¶
func (in *ClusterController) DeepCopy() *ClusterController
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterController.
func (*ClusterController) DeepCopyInto ¶
func (in *ClusterController) DeepCopyInto(out *ClusterController)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterController) DeepCopyObject ¶
func (in *ClusterController) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ClusterController) Serialize ¶
func (cc *ClusterController) Serialize() ([]byte, error)
Serialize serialize ClusterController using json.
type ClusterControllerList ¶
type ClusterControllerList struct { metav1.TypeMeta `json:", inline"` metav1.ListMeta `json:"metadata"` Items []ClusterController `json:"items,omitempty"` }
ClusterControllerList is a list of ClusterController.
func (*ClusterControllerList) DeepCopy ¶
func (in *ClusterControllerList) DeepCopy() *ClusterControllerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterControllerList.
func (*ClusterControllerList) DeepCopyInto ¶
func (in *ClusterControllerList) DeepCopyInto(out *ClusterControllerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterControllerList) DeepCopyObject ¶
func (in *ClusterControllerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ClusterControllerSpec ¶
type ClusterControllerSpec struct { ParentClusterName string `json:"parentClusterName"` ClusterSelector string `json:"clusterSelector"` Destination string `json:"destination"` Method string `json:"method"` URL string `json:"url"` Body string `json:"body"` }
ClusterControllerSpec is specification of a ClusterController.
func (*ClusterControllerSpec) DeepCopy ¶
func (in *ClusterControllerSpec) DeepCopy() *ClusterControllerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterControllerSpec.
func (*ClusterControllerSpec) DeepCopyInto ¶
func (in *ClusterControllerSpec) DeepCopyInto(out *ClusterControllerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterControllerStatus ¶
type ClusterControllerStatus struct { Timestamp int64 `json:"timestamp"` StatusCode int `json:"code"` Body string `json:"body"` }
ClusterControllerStatus is status of a ClusterController.
func (*ClusterControllerStatus) DeepCopy ¶
func (in *ClusterControllerStatus) DeepCopy() *ClusterControllerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterControllerStatus.
func (*ClusterControllerStatus) DeepCopyInto ¶
func (in *ClusterControllerStatus) DeepCopyInto(out *ClusterControllerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterList ¶
type ClusterList struct { metav1.TypeMeta `json:", inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Cluster `json:"items,omitempty"` }
ClusterList is a list of Cluster.
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 ClusterResource ¶
type ClusterResource struct { // Capacity represents the total resources of a cluster. Capacity map[corev1.ResourceName]*resource.Quantity `json:"capacity,omitempty"` // Allocatable represents the resources of a cluster that are available for scheduling. Allocatable map[corev1.ResourceName]*resource.Quantity `json:"allocatable,omitempty"` }
ClusterResource represents the resources of a cluster.
func (*ClusterResource) DeepCopy ¶
func (in *ClusterResource) DeepCopy() *ClusterResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResource.
func (*ClusterResource) DeepCopyInto ¶
func (in *ClusterResource) DeepCopyInto(out *ClusterResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterSpec ¶
type ClusterSpec struct {
Name string `json:"name"`
}
ClusterSpec is specification of a 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 { Listen string `json:"listen,omitempty"` ParentName string `json:"parentName,omitempty"` Status string `json:"status,omitempty"` Timestamp int64 `json:"timestamp"` ClusterResource }
ClusterStatus is status of a Cluster.
func ClusterStatusDeserialize ¶
func ClusterStatusDeserialize(b []byte) (*ClusterStatus, error)
ClusterStatusDeserialize deserialize ClusterStatus using json.
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.
func (*ClusterStatus) Serialize ¶
func (c *ClusterStatus) Serialize() ([]byte, error)
Serialize serialize ClusterStatus using json.