@@ -20,76 +20,6 @@ import (
20
20
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21
21
)
22
22
23
- // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24
- // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25
-
26
- // CLBPodBindingSpec defines the desired state of CLBPodBinding.
27
- type CLBPodBindingSpec struct {
28
- // 网络隔离
29
- // +optional
30
- Disabled * bool `json:"disabled,omitempty"`
31
- // 需要绑定的端口配置列表
32
- Ports []PortEntry `json:"ports"`
33
- }
34
-
35
- // PortEntry 定义单个端口的绑定配置
36
- type PortEntry struct {
37
- // 应用监听的端口号
38
- Port uint16 `json:"port"`
39
- // 端口使用的协议
40
- // +kubebuilder:validation:Enum=TCP;UDP;TCPUDP
41
- Protocol string `json:"protocol"`
42
- // 使用的端口池列表
43
- Pools []string `json:"pools"`
44
- // 是否跨端口池分配相同端口号
45
- // +optional
46
- UseSamePortAcrossPools * bool `json:"useSamePortAcrossPools,omitempty"`
47
- }
48
-
49
- type CLBBindingState string
50
-
51
- const (
52
- CLBBindingStatePending CLBBindingState = "Pending"
53
- CLBBindingStateBound CLBBindingState = "Bound"
54
- CLBBindingStateWaitForPod CLBBindingState = "WaitForPod"
55
- CLBBindingStateWaitForNode CLBBindingState = "WaitForNode"
56
- CLBBindingStateWaitForLB CLBBindingState = "WaitForLB"
57
- CLBBindingStateDisabled CLBBindingState = "Disabled"
58
- CLBBindingStateFailed CLBBindingState = "Failed"
59
- CLBBindingStateDeleting CLBBindingState = "Deleting"
60
- )
61
-
62
- // CLBPodBindingStatus defines the observed state of CLBPodBinding.
63
- type CLBPodBindingStatus struct {
64
- // 绑定状态
65
- State CLBBindingState `json:"state"`
66
- // 状态信息
67
- Message string `json:"message,omitempty"`
68
- // 端口绑定详情
69
- PortBindings []PortBindingStatus `json:"portBindings,omitempty"`
70
- }
71
-
72
- // PortBindingStatus 描述单个端口的实际绑定情况
73
- type PortBindingStatus struct {
74
- // 应用端口
75
- Port uint16 `json:"port"`
76
- // 协议类型
77
- Protocol string `json:"protocol"`
78
- // 使用的端口池
79
- Pool string `json:"pool"`
80
- // 地域信息
81
- Region string `json:"region"`
82
- // 负载均衡器ID
83
- LoadbalancerId string `json:"loadbalancerId"`
84
- // 负载均衡器端口
85
- LoadbalancerPort uint16 `json:"loadbalancerPort"`
86
- // 负载均衡器端口段结束端口(当使用端口段时)
87
- // +optional
88
- LoadbalancerEndPort * uint16 `json:"loadbalancerEndPort,omitempty"`
89
- // 监听器ID
90
- ListenerId string `json:"listenerId"`
91
- }
92
-
93
23
// +kubebuilder:object:root=true
94
24
// +kubebuilder:subresource:status
95
25
// +kubebuilder:resource:shortName=cpb
@@ -100,8 +30,8 @@ type CLBPodBinding struct {
100
30
metav1.TypeMeta `json:",inline"`
101
31
metav1.ObjectMeta `json:"metadata,omitempty"`
102
32
103
- Spec CLBPodBindingSpec `json:"spec,omitempty"`
104
- Status CLBPodBindingStatus `json:"status,omitempty"`
33
+ Spec CLBBindingSpec `json:"spec,omitempty"`
34
+ Status CLBBindingStatus `json:"status,omitempty"`
105
35
}
106
36
107
37
// +kubebuilder:object:root=true
0 commit comments