-
Notifications
You must be signed in to change notification settings - Fork 430
/
types.go
1373 lines (1151 loc) · 43.6 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package v1
import (
"fmt"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/kubeovn/kube-ovn/pkg/ovsdb/ovnnb"
)
const (
ProtocolIPv4 = "IPv4"
ProtocolIPv6 = "IPv6"
ProtocolDual = "Dual"
GWDistributedType = "distributed"
GWCentralizedType = "centralized"
)
type SgRemoteType string
const (
SgRemoteTypeAddress SgRemoteType = "address"
SgRemoteTypeSg SgRemoteType = "securityGroup"
)
type SgProtocol string
const (
ProtocolALL SgProtocol = "all"
ProtocolICMP SgProtocol = "icmp"
ProtocolTCP SgProtocol = "tcp"
ProtocolUDP SgProtocol = "udp"
)
type SgPolicy string
var (
PolicyAllow = SgPolicy(ovnnb.ACLActionAllow)
PolicyDrop = SgPolicy(ovnnb.ACLActionDrop)
)
type QoSPolicyBindingType string
const (
QoSBindingTypeEIP QoSPolicyBindingType = "EIP"
QoSBindingTypeNatGw QoSPolicyBindingType = "NATGW"
)
type QoSPolicyRuleDirection string
const (
DirectionIngress QoSPolicyRuleDirection = "ingress"
DirectionEgress QoSPolicyRuleDirection = "egress"
)
type QoSPolicyRuleMatchType string
const (
MatchTypeIP QoSPolicyRuleMatchType = "ip"
)
// Constants for condition
const (
// Ready => controller considers this resource Ready
Ready = "Ready"
// Validated => Spec passed validating
Validated = "Validated"
// Error => last recorded error
Error = "Error"
ReasonInit = "Init"
)
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
type IP struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IPSpec `json:"spec"`
}
type IPSpec struct {
PodName string `json:"podName"`
Namespace string `json:"namespace"`
Subnet string `json:"subnet"`
AttachSubnets []string `json:"attachSubnets"`
NodeName string `json:"nodeName"`
IPAddress string `json:"ipAddress"`
V4IPAddress string `json:"v4IpAddress"`
V6IPAddress string `json:"v6IpAddress"`
AttachIPs []string `json:"attachIps"`
MacAddress string `json:"macAddress"`
AttachMacs []string `json:"attachMacs"`
ContainerID string `json:"containerID"`
PodType string `json:"podType"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IPList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []IP `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
type Subnet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec SubnetSpec `json:"spec"`
Status SubnetStatus `json:"status,omitempty"`
}
type SubnetSpec struct {
Default bool `json:"default"`
Vpc string `json:"vpc,omitempty"`
Protocol string `json:"protocol,omitempty"`
Namespaces []string `json:"namespaces,omitempty"`
CIDRBlock string `json:"cidrBlock"`
Gateway string `json:"gateway"`
ExcludeIps []string `json:"excludeIps,omitempty"`
Provider string `json:"provider,omitempty"`
GatewayType string `json:"gatewayType,omitempty"`
GatewayNode string `json:"gatewayNode"`
NatOutgoing bool `json:"natOutgoing"`
ExternalEgressGateway string `json:"externalEgressGateway,omitempty"`
PolicyRoutingPriority uint32 `json:"policyRoutingPriority,omitempty"`
PolicyRoutingTableID uint32 `json:"policyRoutingTableID,omitempty"`
Private bool `json:"private"`
AllowSubnets []string `json:"allowSubnets,omitempty"`
Vlan string `json:"vlan,omitempty"`
Vips []string `json:"vips,omitempty"`
LogicalGateway bool `json:"logicalGateway,omitempty"`
DisableGatewayCheck bool `json:"disableGatewayCheck,omitempty"`
DisableInterConnection bool `json:"disableInterConnection,omitempty"`
EnableDHCP bool `json:"enableDHCP,omitempty"`
DHCPv4Options string `json:"dhcpV4Options,omitempty"`
DHCPv6Options string `json:"dhcpV6Options,omitempty"`
EnableIPv6RA bool `json:"enableIPv6RA,omitempty"`
IPv6RAConfigs string `json:"ipv6RAConfigs,omitempty"`
Acls []Acl `json:"acls,omitempty"`
U2OInterconnection bool `json:"u2oInterconnection,omitempty"`
EnableLb *bool `json:"enableLb,omitempty"`
EnableEcmp bool `json:"enableEcmp,omitempty"`
RouteTable string `json:"routeTable,omitempty"`
}
type Acl struct {
Direction string `json:"direction,omitempty"`
Priority int `json:"priority,omitempty"`
Match string `json:"match,omitempty"`
Action string `json:"action,omitempty"`
}
// ConditionType encodes information on the condition
type ConditionType string
// SubnetCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type SubnetCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
type SubnetStatus struct {
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []SubnetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
V4AvailableIPs float64 `json:"v4availableIPs"`
V4AvailableIPRange string `json:"v4availableIPrange"`
V4UsingIPs float64 `json:"v4usingIPs"`
V4UsingIPRange string `json:"v4usingIPrange"`
V6AvailableIPs float64 `json:"v6availableIPs"`
V6AvailableIPRange string `json:"v6availableIPrange"`
V6UsingIPs float64 `json:"v6usingIPs"`
V6UsingIPRange string `json:"v6usingIPrange"`
ActivateGateway string `json:"activateGateway"`
DHCPv4OptionsUUID string `json:"dhcpV4OptionsUUID"`
DHCPv6OptionsUUID string `json:"dhcpV6OptionsUUID"`
U2OInterconnectionIP string `json:"u2oInterconnectionIP"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type SubnetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Subnet `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
type Vlan struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VlanSpec `json:"spec"`
Status VlanStatus `json:"status"`
}
type VlanSpec struct {
// deprecated fields, use ID & Provider instead
VlanId int `json:"vlanId,omitempty"`
ProviderInterfaceName string `json:"providerInterfaceName,omitempty"`
ID int `json:"id"`
Provider string `json:"provider,omitempty"`
}
type VlanStatus struct {
// +optional
// +patchStrategy=merge
Subnets []string `json:"subnets,omitempty"`
// Conditions represents the latest state of the object
// +optional
Conditions []VlanCondition `json:"conditions,omitempty"`
}
// VlanCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type VlanCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VlanList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Vlan `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=provider-networks
type ProviderNetwork struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ProviderNetworkSpec `json:"spec"`
Status ProviderNetworkStatus `json:"status"`
}
type CustomInterface struct {
Interface string `json:"interface"`
Nodes []string `json:"nodes"`
}
type ProviderNetworkSpec struct {
DefaultInterface string `json:"defaultInterface,omitempty"`
CustomInterfaces []CustomInterface `json:"customInterfaces,omitempty"`
ExcludeNodes []string `json:"excludeNodes,omitempty"`
ExchangeLinkName bool `json:"exchangeLinkName,omitempty"`
}
type ProviderNetworkStatus struct {
// +optional
Ready bool `json:"ready"`
// +optional
ReadyNodes []string `json:"readyNodes,omitempty"`
// +optional
NotReadyNodes []string `json:"notReadyNodes,omitempty"`
// +optional
Vlans []string `json:"vlans,omitempty"`
// Conditions represents the latest state of the object
// +optional
Conditions []ProviderNetworkCondition `json:"conditions,omitempty"`
}
// ProviderNetworkCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type ProviderNetworkCondition struct {
// Node name
Node string `json:"node"`
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ProviderNetworkList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ProviderNetwork `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
type Vpc struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VpcSpec `json:"spec"`
Status VpcStatus `json:"status,omitempty"`
}
type VpcSpec struct {
Namespaces []string `json:"namespaces,omitempty"`
StaticRoutes []*StaticRoute `json:"staticRoutes,omitempty"`
PolicyRoutes []*PolicyRoute `json:"policyRoutes,omitempty"`
VpcPeerings []*VpcPeering `json:"vpcPeerings,omitempty"`
EnableExternal bool `json:"enableExternal,omitempty"`
EnableBfd bool `json:"enableBfd,omitempty"`
}
type VpcPeering struct {
RemoteVpc string `json:"remoteVpc,omitempty"`
LocalConnectIP string `json:"localConnectIP,omitempty"`
}
type RoutePolicy string
const (
PolicySrc RoutePolicy = "policySrc"
PolicyDst RoutePolicy = "policyDst"
)
type StaticRoute struct {
Policy RoutePolicy `json:"policy,omitempty"`
CIDR string `json:"cidr"`
NextHopIP string `json:"nextHopIP"`
ECMPMode string `json:"ecmpMode"`
BfdId string `json:"bfdId"`
RouteTable string `json:"routeTable"`
}
type PolicyRouteAction string
var (
PolicyRouteActionAllow = PolicyRouteAction(ovnnb.LogicalRouterPolicyActionAllow)
PolicyRouteActionDrop = PolicyRouteAction(ovnnb.LogicalRouterPolicyActionDrop)
PolicyRouteActionReroute = PolicyRouteAction(ovnnb.LogicalRouterPolicyActionReroute)
)
type PolicyRoute struct {
Priority int `json:"priority,omitempty"`
Match string `json:"match,omitempty"`
Action PolicyRouteAction `json:"action,omitempty"`
// NextHopIP is an optional parameter. It needs to be provided only when 'action' is 'reroute'.
// +optional
NextHopIP string `json:"nextHopIP,omitempty"`
}
type VpcStatus struct {
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []VpcCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Standby bool `json:"standby"`
Default bool `json:"default"`
DefaultLogicalSwitch string `json:"defaultLogicalSwitch"`
Router string `json:"router"`
TcpLoadBalancer string `json:"tcpLoadBalancer"`
UdpLoadBalancer string `json:"udpLoadBalancer"`
SctpLoadBalancer string `json:"sctpLoadBalancer"`
TcpSessionLoadBalancer string `json:"tcpSessionLoadBalancer"`
UdpSessionLoadBalancer string `json:"udpSessionLoadBalancer"`
SctpSessionLoadBalancer string `json:"sctpSessionLoadBalancer"`
Subnets []string `json:"subnets"`
VpcPeerings []string `json:"vpcPeerings"`
EnableExternal bool `json:"enableExternal"`
EnableBfd bool `json:"enableBfd"`
}
// VpcCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type VpcCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VpcList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Vpc `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=vpc-nat-gateways
type VpcNatGateway struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VpcNatSpec `json:"spec"`
Status VpcNatStatus `json:"status,omitempty"`
}
type VpcNatSpec struct {
Vpc string `json:"vpc"`
Subnet string `json:"subnet"`
ExternalSubnets []string `json:"externalSubnets"`
LanIp string `json:"lanIp"`
Selector []string `json:"selector"`
Tolerations []corev1.Toleration `json:"tolerations"`
Affinity corev1.Affinity `json:"affinity"`
QoSPolicy string `json:"qosPolicy"`
}
type VpcNatStatus struct {
QoSPolicy string `json:"qosPolicy" patchStrategy:"merge"`
ExternalSubnets []string `json:"externalSubnets" patchStrategy:"merge"`
Selector []string `json:"selector" patchStrategy:"merge"`
Tolerations []corev1.Toleration `json:"tolerations" patchStrategy:"merge"`
Affinity corev1.Affinity `json:"affinity" patchStrategy:"merge"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=iptables-eips
type IptablesEIP struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IptablesEipSpec `json:"spec"`
Status IptablesEipStatus `json:"status,omitempty"`
}
type IptablesEipSpec struct {
V4ip string `json:"v4ip"`
V6ip string `json:"v6ip"`
MacAddress string `json:"macAddress"`
NatGwDp string `json:"natGwDp"`
QoSPolicy string `json:"qosPolicy"`
ExternalSubnet string `json:"externalSubnet"`
}
// IptablesEIPCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type IptablesEIPCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
type IptablesEipStatus struct {
// +optional
// +patchStrategy=merge
Ready bool `json:"ready" patchStrategy:"merge"`
IP string `json:"ip" patchStrategy:"merge"`
Redo string `json:"redo" patchStrategy:"merge"`
Nat string `json:"nat" patchStrategy:"merge"`
QoSPolicy string `json:"qosPolicy" patchStrategy:"merge"`
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []IptablesEIPCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IptablesEIPList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []IptablesEIP `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=iptables-fip-rules
type IptablesFIPRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IptablesFIPRuleSpec `json:"spec"`
Status IptablesFIPRuleStatus `json:"status,omitempty"`
}
type IptablesFIPRuleSpec struct {
EIP string `json:"eip"`
InternalIp string `json:"internalIp"`
}
// IptablesFIPRuleCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type IptablesFIPRuleCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
type IptablesFIPRuleStatus struct {
// +optional
// +patchStrategy=merge
Ready bool `json:"ready" patchStrategy:"merge"`
V4ip string `json:"v4ip" patchStrategy:"merge"`
V6ip string `json:"v6ip" patchStrategy:"merge"`
NatGwDp string `json:"natGwDp" patchStrategy:"merge"`
Redo string `json:"redo" patchStrategy:"merge"`
InternalIp string `json:"internalIp" patchStrategy:"merge"`
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []IptablesFIPRuleCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IptablesFIPRuleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []IptablesFIPRule `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=iptables-snat-rules
type IptablesSnatRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IptablesSnatRuleSpec `json:"spec"`
Status IptablesSnatRuleStatus `json:"status,omitempty"`
}
type IptablesSnatRuleSpec struct {
EIP string `json:"eip"`
InternalCIDR string `json:"internalCIDR"`
}
// IptablesSnatRuleCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type IptablesSnatRuleCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
type IptablesSnatRuleStatus struct {
// +optional
// +patchStrategy=merge
Ready bool `json:"ready" patchStrategy:"merge"`
V4ip string `json:"v4ip" patchStrategy:"merge"`
V6ip string `json:"v6ip" patchStrategy:"merge"`
NatGwDp string `json:"natGwDp" patchStrategy:"merge"`
Redo string `json:"redo" patchStrategy:"merge"`
InternalCIDR string `json:"internalCIDR" patchStrategy:"merge"`
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []IptablesSnatRuleCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IptablesSnatRuleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []IptablesSnatRule `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=iptables-dnat-rules
type IptablesDnatRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IptablesDnatRuleSpec `json:"spec"`
Status IptablesDnatRuleStatus `json:"status,omitempty"`
}
type IptablesDnatRuleSpec struct {
EIP string `json:"eip"`
ExternalPort string `json:"externalPort"`
Protocol string `json:"protocol,omitempty"`
InternalIp string `json:"internalIp"`
InternalPort string `json:"internalPort"`
}
// IptablesDnatRuleCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type IptablesDnatRuleCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
type IptablesDnatRuleStatus struct {
// +optional
// +patchStrategy=merge
Ready bool `json:"ready" patchStrategy:"merge"`
V4ip string `json:"v4ip" patchStrategy:"merge"`
V6ip string `json:"v6ip" patchStrategy:"merge"`
NatGwDp string `json:"natGwDp" patchStrategy:"merge"`
Redo string `json:"redo" patchStrategy:"merge"`
Protocol string `json:"protocol" patchStrategy:"merge"`
InternalIp string `json:"internalIp" patchStrategy:"merge"`
InternalPort string `json:"internalPort" patchStrategy:"merge"`
ExternalPort string `json:"externalPort" patchStrategy:"merge"`
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []IptablesDnatRuleCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type IptablesDnatRuleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []IptablesDnatRule `json:"items"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VpcNatGatewayList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []VpcNatGateway `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=security-groups
type SecurityGroup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec SecurityGroupSpec `json:"spec"`
Status SecurityGroupStatus `json:"status"`
}
type SecurityGroupSpec struct {
IngressRules []*SgRule `json:"ingressRules,omitempty"`
EgressRules []*SgRule `json:"egressRules,omitempty"`
AllowSameGroupTraffic bool `json:"allowSameGroupTraffic,omitempty"`
}
type SecurityGroupStatus struct {
PortGroup string `json:"portGroup"`
AllowSameGroupTraffic bool `json:"allowSameGroupTraffic"`
IngressMd5 string `json:"ingressMd5"`
EgressMd5 string `json:"egressMd5"`
IngressLastSyncSuccess bool `json:"ingressLastSyncSuccess"`
EgressLastSyncSuccess bool `json:"egressLastSyncSuccess"`
}
type SgRule struct {
IPVersion string `json:"ipVersion"`
Protocol SgProtocol `json:"protocol,omitempty"`
Priority int `json:"priority,omitempty"`
RemoteType SgRemoteType `json:"remoteType"`
RemoteAddress string `json:"remoteAddress,omitempty"`
RemoteSecurityGroup string `json:"remoteSecurityGroup,omitempty"`
PortRangeMin int `json:"portRangeMin,omitempty"`
PortRangeMax int `json:"portRangeMax,omitempty"`
Policy SgPolicy `json:"policy"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type SecurityGroupList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []SecurityGroup `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
type Vip struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VipSpec `json:"spec"`
Status VipStatus `json:"status,omitempty"`
}
type VipSpec struct {
Namespace string `json:"namespace"`
Subnet string `json:"subnet"`
V4ip string `json:"v4ip"`
V6ip string `json:"v6ip"`
MacAddress string `json:"macAddress"`
ParentV4ip string `json:"parentV4ip"`
ParentV6ip string `json:"parentV6ip"`
ParentMac string `json:"parentMac"`
AttachSubnets []string `json:"attachSubnets"`
}
// VipCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type VipCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
type VipStatus struct {
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []VipCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Ready bool `json:"ready" patchStrategy:"merge"`
V4ip string `json:"v4ip" patchStrategy:"merge"`
V6ip string `json:"v6ip" patchStrategy:"merge"`
Mac string `json:"mac" patchStrategy:"merge"`
Pv4ip string `json:"pv4ip" patchStrategy:"merge"`
Pv6ip string `json:"pv6ip" patchStrategy:"merge"`
Pmac string `json:"pmac" patchStrategy:"merge"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VipList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Vip `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=vpc-dnses
type VpcDns struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VpcDnsSpec `json:"spec"`
Status VpcDnsStatus `json:"status,omitempty"`
}
type VpcDnsSpec struct {
Vpc string `json:"vpc"`
Subnet string `json:"subnet"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VpcDnsList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []VpcDns `json:"items"`
}
type VpcDnsStatus struct {
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []VpcDnsCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Active bool `json:"active" patchStrategy:"merge"`
}
// VpcDnsCondition describes the state of an object at a certain point.
// +k8s:deepcopy-gen=true
type VpcDnsCondition struct {
// Type of condition.
Type ConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
// The reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
// +optional
Message string `json:"message,omitempty"`
// Last time the condition was probed
// +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
type SlrPort struct {
Name string `json:"name"`
Port int32 `json:"port"`
TargetPort int32 `json:"targetPort,omitempty"`
Protocol string `json:"protocol"`
}
type SwitchLBRuleSpec struct {
Vip string `json:"vip"`
Namespace string `json:"namespace"`
Selector []string `json:"selector"`
SessionAffinity string `json:"sessionAffinity,omitempty"`
Ports []SlrPort `json:"ports"`
}
type SwitchLBRuleStatus struct {
// Conditions represents the latest state of the object
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []SwitchLBRuleCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
Ports string `json:"ports" patchStrategy:"merge"`
Service string `json:"service" patchStrategy:"merge"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient:nonNamespaced
// +resourceName=switch-lb-rules
type SwitchLBRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec SwitchLBRuleSpec `json:"spec"`
Status SwitchLBRuleStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type SwitchLBRuleList struct {
metav1.TypeMeta `json:",inline"`