Skip to content

Commit 474511b

Browse files
pengzhoumlPeng ZhourwinieskiCopilot
authored
MLE-20430/Support Configure HAProxy At Group Level (#100)
* remove unused code and add comments * the non pathbased works for app server * support for pathbased routing * fix typo * fix bugs for pathbased routing * add TCP implementation * fix null pointer issue * fix nil pointer issue * add HAProxyGroup * Fix bug in TCP config have wrong number of backend servers * Update pkg/k8sutil/haProxyHelper.go Co-authored-by: Copilot <[email protected]> * update format * fix bug pointed by Copilot --------- Co-authored-by: Peng Zhou <[email protected]> Co-authored-by: Romain Winieski <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent e85553a commit 474511b

File tree

6 files changed

+345
-1409
lines changed

6 files changed

+345
-1409
lines changed

api/v1/common_types.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ type HAProxy struct {
9898
// +kubebuilder:default:=false
9999
PathBasedRouting *bool `json:"pathBasedRouting,omitempty"`
100100
Service *corev1.ServiceType `json:"service,omitempty"`
101-
// +kubebuilder:default:={enabled: false}
102-
TcpPorts Tcpports `json:"tcpPorts,omitempty"`
101+
TcpPorts *Tcpports `json:"tcpPorts,omitempty"`
103102
// +kubebuilder:default:={client: 600, connect: 600, server: 600}
104103
Timeout Timeout `json:"timeout,omitempty"`
105104
// +kubebuilder:default:={enabled: false, secretName: "", certFileName: ""}
@@ -112,6 +111,14 @@ type HAProxy struct {
112111
Ingress Ingress `json:"ingress,omitempty"`
113112
}
114113

114+
// HAProxyGroup represents group-level HAProxy configuration that can override cluster settings
115+
type HAProxyGroup struct {
116+
Enabled bool `json:"enabled,omitempty"`
117+
AppServers []AppServers `json:"appServers,omitempty"`
118+
PathBasedRouting *bool `json:"pathBasedRouting,omitempty"`
119+
TcpPorts *Tcpports `json:"tcpPorts,omitempty"`
120+
}
121+
115122
type AppServers struct {
116123
Name string `json:"name,omitempty"`
117124
Type string `json:"type,omitempty"`
@@ -138,9 +145,10 @@ type Tcpports struct {
138145
}
139146

140147
type TcpPort struct {
141-
Port int32 `json:"port,omitempty"`
142-
Name string `json:"name,omitempty"`
143-
Type string `json:"type,omitempty"`
148+
Port int32 `json:"port,omitempty"`
149+
TargetPort int32 `json:"targetPort,omitempty"`
150+
Name string `json:"name,omitempty"`
151+
Type string `json:"type,omitempty"`
144152
}
145153

146154
type Timeout struct {

api/v1/marklogiccluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ type MarklogicGroups struct {
110110
PriorityClassName string `json:"priorityClassName,omitempty"`
111111
HugePages *HugePages `json:"hugePages,omitempty"`
112112
LogCollection *LogCollection `json:"logCollection,omitempty"`
113-
HAProxy *HAProxy `json:"haproxy,omitempty"`
113+
HAProxy *HAProxyGroup `json:"haproxy,omitempty"`
114114
// +kubebuilder:default:=false
115115
IsBootstrap bool `json:"isBootstrap,omitempty"`
116116
Tls *Tls `json:"tls,omitempty"`

api/v1/zz_generated.deepcopy.go

Lines changed: 36 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)