Skip to content

Commit fba05e9

Browse files
MLE-19770: README updates for GA release (#60)
* readme updates for GA release
1 parent 0b3aa63 commit fba05e9

File tree

2 files changed

+94
-150
lines changed

2 files changed

+94
-150
lines changed

README.md

Lines changed: 57 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,182 +1,89 @@
1-
# MarkLogic Kubernetes Operator (Private Repo)
1+
# MarkLogic Operator for Kuberentes
22

33
## Introduction
44

5-
The MarkLogic Kubernetes Operator is a tool that allows you to deploy and manage MarkLogic clusters on Kubernetes. It provides a declarative way to define and manage MarkLogic resources such as clusters, databases, and forests.
5+
The MarkLogic Operator for Kubernetes is an operator that allows you to deploy and manage MarkLogic clusters on Kubernetes. It provides a declarative way to define and manage MarkLogic resources. For detailed documentation, please refer to [MarkLogic Operator for Kubernetes](https://docs.progress.com/bundle/marklogic-server-on-kubernetes).
66

7-
## Code Structure
8-
api/ Contains the API definition
9-
internal/controller Contains the code for controllers
10-
config/ Contains configuration files to launch the project on a cluster
11-
config/samples/ Contains the samples to create marklogic cluster using the Operator.
12-
test/ Contains E2E tests for the operator
13-
pkg/ Contains golang packges to support reconciliation, utilities.
7+
## Getting Started
148

15-
## Run or deploy Operator
9+
### Prerequisites
1610

17-
### Deploy Operator with Helm Chart in Private Repo
18-
The EA release is currently in a private repository. To access and work with this private repository, please follow these steps:
19-
1. First you need to create a Fine-grained tokens in Github with Read-only permission for marklogic/marklogic-kubernetes-operator repository
20-
Once you have the token, put store it in a safe place and put it in the environmental variable:
21-
```sh
22-
GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>
23-
```
24-
2. Then add the private repo to Helm repository with the GITHUB_TOKEN:
11+
[Helm](https://helm.sh/docs/intro/install/) v3.0.0 or later and [Kubectl](https://kubernetes.io/docs/tasks/tools/) v1.30 or same as your Kubernetes version must be installed locally in order to use MarkLogic operator helm chart.
12+
13+
### Kubernetes Version
14+
15+
This operator supports Kubernetes 1.30 or later.
16+
17+
### MarkLogic Version
18+
19+
This operator supports MarkLogic 11.1 or later.
20+
21+
### Run MarkLogic Operator for Kubernetes using Helm Chart
22+
23+
1. Add MarkLogic Operator for Kubernees Helm Repo:
2524
```sh
26-
helm repo add marklogic-private https://raw.githubusercontent.com/marklogic/marklogic-kubernetes-operator/gh-pages/ --username <YOUR_USERNAME> --password $GITHUB_TOKEN
25+
helm repo add marklogic-operator-kubernetes https://raw.githubusercontent.com/marklogic/marklogic-operator-kubernetes/gh-pages/
26+
2727
helm repo update
2828
```
29-
3. Install the Helm Chart for MarkLogic Operator:
29+
30+
2. Install the Helm Chart for MarkLogic Operator:
3031
```sh
31-
helm upgrade marklogic-operator marklogic-private/marklogic-operator --version=1.0.0-ea2 --install --namespace marklogic-operator-system --create-namespace
32+
helm upgrade marklogic-operator-kubernetes marklogic-operator-kubernetes/marklogic-operator-kubernetes --version=1.0.0 --install --namespace marklogic-operator-system --create-namespace
3233
```
33-
4. Check the Operator Pod and make sure it is in Running state:
34+
35+
3. Make sure the Marklogic Operator pod is running:
3436
```sh
3537
kubectl get pods -n marklogic-operator-system
3638
```
3739

38-
### Run Operator locally
39-
After checking out the source code, you can run the MarkLogic Operator locally by following these steps:
40+
### Install MarkLogic Cluster
41+
Once MarkLogic Operator Pod is running, use your custom manifests or choose from sample manifests from this repository located in the ./config/samples directory. For example, to deploy marklogic single group, use the `quick_start.yaml` from the samples:
4042
```sh
41-
make build # build the project
42-
make install # instal CRD to Kubernetes cluster
43-
make run # run the operator controller locally
43+
kubectl apply -f quick_start.yaml
4444
```
45+
Once the installation is complete and the pod is in a running state, the MarkLogic Admin UI can be accessed using the port-forwarding command:
4546

46-
### Deploy Operator locally
47-
After checking out the source code, you can deploy the MarkLogic Operator locally by following these steps:
48-
```sh
49-
make build # build the project
50-
make docker-build # build the operator to docker image
51-
make docker-push # push the operator to remote docker repo
52-
make deploy # deploy the CRD and Operator into marklogic-operator-system namespace
53-
```
47+
```shell
48+
kubectl port-forward <pod-name> 8000:8000 8001:8001 --namespace=<namespace-name>
49+
```
5450

55-
### Build Helm Chart locally
56-
If you don't have the GITHUB_TOKEN that is required to visit the Github Repo, you can also build the Helm Chart locally.
57-
First build the Helm Chart
58-
```sh
59-
make build
60-
make docker-build
61-
make helm
62-
```
63-
Then deploy the Operator with Helm Chart
64-
```sh
65-
helm upgrade marklogic-operator ./charts/marklogic-operator --install --namespace marklogic-operator-system --create-namespace
66-
```
51+
If you used the automatically generated admin credentials, use these steps to extract the admin username, password, and wallet-password from a secret:
6752

68-
## Install MarkLogic Cluster with MarkLogic Operator
69-
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:
70-
```sh
71-
kubectl apply -f marklogicgroup.yaml
72-
```
53+
1. Run this command to fetch all of the secret names:
54+
```shell
55+
kubectl get secrets
56+
```
57+
The MarkLogic admin secret name is in the format `<marklogicCluster-name>-admin`. For example if markLogicCluster name is `single-node`, the secret name is `single-node-admin`.
7358

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.
59+
2. Using the secret name from step 1, retrieve the MarkLogic admin credentials using these commands:
60+
```shell
61+
kubectl get secret single-node-admin -o jsonpath='{.data.username}' | base64 --decode
7662

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. To setup the access for default App Servers for 8000, 8001 and 8002, uncomment the appServer seciton in marklogicgroup.yaml.
85-
```
86-
appServers:
87-
- name: "app-service"
88-
port: 8000
89-
path: "/console"
90-
- name: "admin"
91-
port: 8001
92-
path: "/adminUI"
93-
- name: "manage"
94-
port: 8002
95-
path: "/manage"
96-
```
97-
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 appServer section:
98-
```
99-
- name: my-app-1
100-
port: 8010
101-
targetPort: 8010
102-
```
103-
#### Access HA Proxy
104-
The HAProxy can be accessed from a service with the name of marklogic-haproxy.
63+
kubectl get secret single-node-admin -o jsonpath='{.data.password}' | base64 --decode
10564

106-
#### External access
107-
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:
108-
```
109-
haproxy:
110-
service:
111-
type: LoadBalancer
112-
```
65+
kubectl get secret single-node-admin -o jsonpath='{.data.wallet-password}' | base64 --decode
66+
```
11367

114-
> [!WARNING]
115-
> 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.
68+
Please note that if configurations are provided for both the cluster and the group, the values specified for the cluster will take precedence and be applied.
69+
For additional manifests to deploy a MarkLogic cluster inside a Kubernetes cluster, see [Operator manifest](https://docs.progress.com/bundle/marklogic-server-on-kubernetes/operator/Operator-manifest.html) in the documentation.
11670

117-
## Deployment with TLS Enabled
118-
The MarkLogic Kubernetes Operator supports installing MarkLogic with HTTPS enabled on the default app servers. The default app servers are App-Services (8000), Admin (8001), and Manage (8002)
119-
### Choose the type of certificate
120-
Two types of certificates are supported: standard certificates and temporary certificates.
121-
* Temporary Certificates - A temporary certificate is ideal for development purposes. When using a temporary certificate for MarkLogic App Servers, a signed certificate does not need to be supplied. The certificate will be generated automatically.
122-
* Standard Certificates - A standard certificate is issued by a trusted Certificate Authority (CA) for a specific domain (host name for MarkLogic server). A standard certificate is strongly recommended for production environments. Support is provided for both named certificates and wildcard certificates.
123-
+ Named Certificate - Each host must possess a designated certificate with a matching common name (CN).
124-
+ Wildcard Certificate - A single wildcard certificate can be used for all hosts within a cluster.
71+
## Clean Up
12572

126-
### Configure a MarkLogic cluster with a temporary certificate
127-
To configure a temporary certificate, simply add the following option to CR yaml file:
128-
```
129-
tls:
130-
enableOnDefaultAppServers: true
73+
#### Cleaning up MarkLogic Cluster
74+
Use these steps to delete MarkLogic cluster and other resources created from the manifests used in the above [step](#install-marklogic-cluster).
75+
```sh
76+
kubectl delete -f quick_start.yaml
13177
```
13278

133-
### Configure a MarkLogic cluster with a standard certificate
134-
To configure a MarkLogic cluster with a standard certificate, follow these steps:
135-
1. Obtain a certificate with a common name matching the hostname of the MarkLogic host. The certificate must be signed by a trusted Certificate Authority (CA). Either a publicly rooted CA or a private CA can be used. This example uses a private CA and a 2-node cluster.
136-
2. Use this script to generate a self-signed CA certificate with openSSL. The script will create ca-private-key.pem as the CA key and cacert.pem as the private CA certificate:
137-
```
138-
# Generate private key for CA
139-
openssl genrsa -out ca-private-key.pem 2048
140-
141-
# Generate the self-signed CA certificate
142-
openssl req -new -x509 -days 3650 -key ca-private-key.pem -out cacert.pem
143-
```
144-
3. Use the script below to generate a private key and CSR for the marklogic-0 pod. After running the script, tls.key is generated as a private key and a host certificate for the marklogic-0 pod.
145-
>Note: The filename for the private key must be tls.key and the filename for host certificate must be tls.crt.
146-
* If the release name is "marklogic", then the host name for the marklogic-0 pod will be "marklogic-0.marklogic.default.svc.cluster.local".
147-
* The host name for the marklogic-1 pod will be "marklogic-1.marklogic.default.svc.cluster.local".
148-
```
149-
# Create private key
150-
openssl genpkey -algorithm RSA -out tls.key
151-
152-
# Create CSR for marklogic-0
153-
# Use marklogic-0.marklogic.default.svc.cluster.local as Common Name(CN) for CSR
154-
openssl req -new -key tls.key -out tls.csr
155-
156-
# Sign CSR with private CA
157-
openssl x509 -req -CA cacert.pem -CAkey ca-private-key.pem -in tls.csr -out tls.crt -days 365
158-
```
159-
4. Use this script below to generate secrets for the host certificate and the CA certificate. Repeat these steps to generate the certificate for the marklogic-1 host and create the secret marklogic-1-cert. After running the script, secretes are created for marklogic-0 and marklogic-1. One secret is also created for the private CA certificate.
160-
```
161-
# Generate Secret for marklogic-0 host certificate
162-
kubectl create secret generic marklogic-0-cert --from-file=tls.crt --from-file=tls.key
163-
164-
# Generate Secret for private CA certificate
165-
kubectl create secret generic ca-cert --from-file=cacert.pem
166-
```
167-
1. Once the certificate is created within Kubernetes secrets, add the following section to the CR yaml file and follow the instructions outlined in Install the Operator.
168-
```
169-
tls:
170-
enableOnDefaultAppServers: true
171-
certSecretNames:
172-
- "marklogic-0-cert"
173-
- "marklogic-1-cert"
174-
caSecretName: "ca-cert"
79+
#### Deleting Helm chart
80+
Use these steps to delete MarkLogic Operator Helm chart.
81+
```sh
82+
helm delete marklogic-operator-kubernetes
17583
```
17684

177-
178-
17985
## Known Issues and Limitations
18086

181-
1. The latest released version of fluent/fluent-bit:3.2.5 has known high and critical security vulnerabilities. If you decide to enable the log collection feature, choose and deploy the fluent-bit or an alternate image with no vulnerabilities as per your requirements.
182-
2. Known Issues and Limitations for the MarkLogic Server Docker image can be viewed using the link: https://github.com/marklogic/marklogic-docker?tab=readme-ov-file#Known-Issues-and-Limitations.
87+
1. The latest released version of fluent/fluent-bit:3.2.5 has high and critical security vulnerabilities. If you decide to enable the log collection feature, choose and deploy the fluent-bit or an alternate image with no vulnerabilities as per your requirements.
88+
2. Known Issues and Limitations for the MarkLogic Server Docker image can be viewed using the link: https://github.com/marklogic/marklogic-docker?tab=readme-ov-file#Known-Issues-and-Limitations.
89+
3. If you're updating the group name configuration, ensure that you delete the pod to apply the changes, as we are using the OnDelete upgrade strategy.

config/samples/quick_start.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: database.marklogic.com/v1alpha1
2+
kind: MarklogicCluster
3+
metadata:
4+
labels:
5+
app.kubernetes.io/name: marklogiccluster
6+
app.kubernetes.io/instance: marklogiccluster-sample
7+
app.kubernetes.io/part-of: marklogic-kubernetes-operator
8+
app.kubernetes.io/managed-by: kustomize
9+
app.kubernetes.io/created-by: marklogic-kubernetes-operator
10+
name: single-node
11+
namespace: dev-env
12+
spec:
13+
image: "progressofficial/marklogic-db:11.3.0-ubi-rootless"
14+
## It is recommended to use Kubernetes secrets to store the admin credentials
15+
## If you do not provide the secret with admin credentials, the operator will generate a secret for you containing admin credentials
16+
# auth:
17+
# secretName: marklogic-admin-secret
18+
# adminUsername: admin
19+
# adminPassword: admin
20+
markLogicGroups:
21+
- replicas: 1
22+
name: node
23+
groupConfig:
24+
name: node
25+
enableXdqpSsl: true
26+
storage:
27+
size: 10Gi
28+
resources:
29+
requests:
30+
memory: "4Gi"
31+
cpu: 2000m
32+
limits:
33+
memory: "4Gi"
34+
cpu: 2000m
35+
isBootstrap: true
36+
37+

0 commit comments

Comments
 (0)