4 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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.
10 // NetworkSpec defines the desired state of Network
11 // +k8s:openapi-gen=true
12 type NetworkSpec 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 CniType string `json:"cniType"`
17 Ipv4Subnets []IpSubnet `json:"ipv4Subnets"`
18 Ipv6Subnets []IpSubnet `json:"ipv6Subnets,omitempty"`
19 DNS DnsSpec `json:"dns,omitempty"`
20 Routes []Route `json:"routes,omitempty"`
23 type IpSubnet struct {
24 Name string `json:"name"`
25 Subnet string `json:"subnet"`
26 Gateway string `json:"gateway,omitempty"`
27 ExcludeIps string `json:"excludeIps,omitempty"`
31 Dst string `json:"dst"`
32 GW string `json:"gw,omitempty"`
36 Nameservers []string `json:"nameservers,omitempty"`
37 Domain string `json:"domain,omitempty"`
38 Search []string `json:"search,omitempty"`
39 Options []string `json:"options,omitempty"`
43 //Created indicates the status of success
45 //Indicates internal Irrecoverable Error
46 InternalError = "InternalError"
49 // NetworkStatus defines the observed state of Network
50 // +k8s:openapi-gen=true
51 type NetworkStatus struct {
52 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
53 // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
54 // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
55 State string `json:"state"` // Indicates if Network is in "created" state
58 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
60 // Network is the Schema for the networks API
61 // +k8s:openapi-gen=true
62 // +kubebuilder:subresource:status
64 metav1.TypeMeta `json:",inline"`
65 metav1.ObjectMeta `json:"metadata,omitempty"`
67 Spec NetworkSpec `json:"spec,omitempty"`
68 Status NetworkStatus `json:"status,omitempty"`
71 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
73 // NetworkList contains a list of Network
74 type NetworkList struct {
75 metav1.TypeMeta `json:",inline"`
76 metav1.ListMeta `json:"metadata,omitempty"`
77 Items []Network `json:"items"`
81 SchemeBuilder.Register(&Network{}, &NetworkList{})