Modify bpa-operator for nestedk8s
[icn.git] / cmd / bpa-operator / pkg / apis / bpa / v1alpha1 / provisioning_types.go
1 package v1alpha1
2
3 import (
4         metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5 )
6
7 // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
8 // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
9
10 // ProvisioningSpec defines the desired state of Provisioning
11 // +k8s:openapi-gen=true
12 type ProvisioningSpec struct {
13         // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
14         // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
15         // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
16         Masters []map[string]Master  `json:"masters,omitempty"`
17         Workers []map[string]Worker  `json:"workers,omitempty"`
18         KUDPlugins []string `json:"KUDPlugins,omitempty"`
19         PodSubnet string `json:"PodSubnet,omitempty"`
20 }
21
22 // ProvisioningStatus defines the observed state of Provisioning
23 // +k8s:openapi-gen=true
24 type ProvisioningStatus struct {
25         // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
26         // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
27         // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
28 }
29
30 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
31
32 // Provisioning is the Schema for the provisionings API
33 // +k8s:openapi-gen=true
34 // +kubebuilder:subresource:status
35 type Provisioning struct {
36         metav1.TypeMeta   `json:",inline"`
37         metav1.ObjectMeta `json:"metadata,omitempty"`
38
39         Spec   ProvisioningSpec   `json:"spec,omitempty"`
40         Status ProvisioningStatus `json:"status,omitempty"`
41 }
42
43 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
44
45 // ProvisioningList contains a list of Provisioning
46 type ProvisioningList struct {
47         metav1.TypeMeta `json:",inline"`
48         metav1.ListMeta `json:"metadata,omitempty"`
49         Items           []Provisioning `json:"items"`
50 }
51
52 // master struct contains resource requirements for a master node
53 type Master struct {
54         MACaddress string `json:"mac-address,omitempty"`
55         CPU int32  `json:"cpu,omitempty"`
56         Memory string  `json:"memory,omitempty"`
57 }
58
59 // worker struct contains resource requirements for a worker node
60 type Worker struct {
61         MACaddress string `json:"mac-address,omitempty"`
62         CPU int32 `json:"cpu,omitempty"`
63         Memory string  `json:"memory,omitempty"`
64         SRIOV bool  `json:"sriov,omitempty"`
65         QAT  bool      `json:"qat,omitempty"`
66 }
67
68 func init() {
69         SchemeBuilder.Register(&Provisioning{}, &ProvisioningList{})
70 }