Skip to content

Commit 2f86491

Browse files
README update for configuring HAProxy (#30)
1 parent 2dd7417 commit 2f86491

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,36 @@ helm upgrade marklogic-operator ./charts/marklogic-operator --install --namespac
6969
Once MarkLogic Operator is installed, go to config/samples folder and pick one sample file to deploy. For example, to deploy marklogic single group, use the following script:
7070
```sh
7171
kubectl apply -f marklogicgroup.yaml
72-
```
72+
```
73+
74+
### Configure HAProxy Load Balancer
75+
HAProxy is provided as a load balancer configured to support cookie-based session affinity and multi-statement transactions. These configurations are needed by some MarkLogic client applications, like mlcp. HAProxy is recommended for production workloads.
76+
77+
#### Enable the HAProxy Load Balancer
78+
The HAProxy Load Balancer is disabled by default. To enable it, provide the following configuration in the crd yaml file to be used for cluster creation:
79+
```
80+
haproxy:
81+
enabled: true
82+
```
83+
#### Configuration
84+
HAProxy can be configured for cluster and group. By default, ports 8000, 8001, and 8002 are configured to handle HTTP traffic.
85+
Ports can be configured for additional app servers. For example, to add port 8010 for HTTP load balancing, add this configuration to the marklogicgroup.yaml file:
86+
```
87+
- name: my-app-1
88+
type: HTTP
89+
port: 8010
90+
targetPort: 8010
91+
```
92+
#### Access HA Proxy
93+
The HAProxy can be accessed from a service with the name of marklogic-haproxy.
94+
95+
#### External access
96+
By default, HAProxy is configured to provide access within the Kubernetes cluster. However, HAProxy can provide external access by setting the service type in the marklogicgroup.yaml file:
97+
```
98+
haproxy:
99+
service:
100+
type: LoadBalancer
101+
```
102+
103+
> [!WARNING]
104+
> Please note, by setting the haproxy service type to LoadBalancer, the MarkLogic endpoint is exposed to the public internet. Because of this, networkPolicy should be set to limit the sources that can visit MarkLogic.

0 commit comments

Comments
 (0)