diff options
author | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-07-31 15:32:28 -0700 |
---|---|---|
committer | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-08-28 12:45:14 -0700 |
commit | ab8c95eff5c1228237f758d3ccfc99c751f713f7 (patch) | |
tree | a950ac5356f547434f24c8cc3bf53f3620e84a74 /src/monitor/pkg/apis/k8splugin/v1alpha1/types.go | |
parent | dcace0784979890bb986fb078348b4b3ceef146c (diff) |
Adding monitor operator to monitor edge resources
Add an operator to monitor resources at the edge location.
The operator listens to pods and services right now and stores
their information in a CustomResource
Issue-ID: MULTICLOUD-675
Change-Id: I801478a77fcd019010ea1b4388d6077f63b89d05
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/monitor/pkg/apis/k8splugin/v1alpha1/types.go')
-rw-r--r-- | src/monitor/pkg/apis/k8splugin/v1alpha1/types.go | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go b/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go new file mode 100644 index 00000000..22dfdd25 --- /dev/null +++ b/src/monitor/pkg/apis/k8splugin/v1alpha1/types.go @@ -0,0 +1,55 @@ +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ResourceBundleState is the Schema for the ResourceBundleStatees API +// +k8s:openapi-gen=true +// +kubebuilder:subresource:status +type ResourceBundleState struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + Spec ResourceBundleStateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Status ResourceBundleStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// ResourceBundleStateSpec defines the desired state of ResourceBundleState +// +k8s:openapi-gen=true +type ResourceBundleStateSpec struct { + Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,1,opt,name=selector"` +} + +// ResourceBundleStatus defines the observed state of ResourceBundleState +// +k8s:openapi-gen=true +type ResourceBundleStatus struct { + Ready bool `json:"ready" protobuf:"varint,1,opt,name=ready"` + ResourceCount int32 `json:"resourceCount" protobuf:"varint,2,opt,name=resourceCount"` + PodStatuses []PodStatus `json:"podStatuses" protobuf:"varint,3,opt,name=podStatuses"` + ServiceStatuses []corev1.Service `json:"serviceStatuses" protobuf:"varint,4,opt,name=serviceStatuses"` +} + +// PodStatus defines the observed state of ResourceBundleState +// +k8s:openapi-gen=true +type PodStatus struct { + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Ready bool `json:"ready" protobuf:"varint,2,opt,name=ready"` + Status corev1.PodStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ResourceBundleStateList contains a list of ResourceBundleState +type ResourceBundleStateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ResourceBundleState `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ResourceBundleState{}, &ResourceBundleStateList{}) +} |