Skip to content

Commit

Permalink
Add custom pod template doc
Browse files Browse the repository at this point in the history
Signed-off-by: pritamdas99 <[email protected]>
  • Loading branch information
pritamdas99 authored and raihankhan committed Nov 28, 2024
1 parent 046b946 commit 5a6c0c0
Show file tree
Hide file tree
Showing 24 changed files with 944 additions and 20 deletions.
21 changes: 21 additions & 0 deletions docs/examples/solr/configuration/sl-custom-nodeselector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: kubedb.com/v1alpha2
kind: Solr
metadata:
name: solr-custom-nodeselector
namespace: demo
spec:
version: 9.6.1
replicas: 2
podTemplate:
spec:
nodeSelector:
topology.gke.io/zone: us-central1-b
zookeeperRef:
name: zoo
namespace: demo
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
68 changes: 68 additions & 0 deletions docs/examples/solr/configuration/sl-custom-podtemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: kubedb.com/v1alpha2
kind: Solr
metadata:
name: solr-misc-config
namespace: demo
spec:
version: "9.6.1"
zookeeperRef:
name: zoo
namespace: demo
topology:
data:
replicas: 1
podTemplate:
spec:
containers:
- name: "solr"
resources:
requests:
cpu: "900m"
limits:
cpu: "900m"
memory: "2.5Gi"
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
overseer:
replicas: 1
podTemplate:
spec:
containers:
- name: "solr"
resources:
requests:
cpu: "900m"
limits:
cpu: "900m"
memory: "2.5Gi"
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
coordinator:
replicas: 1
podTemplate:
spec:
containers:
- name: "solr"
resources:
requests:
cpu: "900m"
limits:
cpu: "900m"
memory: "2.5Gi"
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
28 changes: 28 additions & 0 deletions docs/examples/solr/configuration/solr-with-tolerations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: kubedb.com/v1alpha2
kind: Solr
metadata:
name: solr-with-toleration
namespace: demo
spec:
version: 9.6.1
replicas: 2
podTemplate:
spec:
tolerations:
- key: "key1"
operator: "Equal"
value: "node7"
effect: "NoSchedule"
- key: "key1"
operator: "Equal"
value: "node8"
effect: "NoSchedule"
zookeeperRef:
name: zoo
namespace: demo
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
17 changes: 17 additions & 0 deletions docs/examples/solr/configuration/solr-without-toleration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: Solr
metadata:
name: solr-without-toleration
namespace: demo
spec:
version: 9.6.1
replicas: 2
zookeeperRef:
name: zoo
namespace: demo
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
115 changes: 115 additions & 0 deletions docs/guides/solr/concepts/solr.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,121 @@ type: Opaque

Secrets provided by users are not managed by KubeDB, and therefore, won't be modified or garbage collected by the KubeDB operator (version 0.13.0 and higher).

### spec.topology

`spec.topology` is an `optional` field that provides a way to configure different types of nodes for the Solr cluster. This field enables you to specify how many nodes you want to act as `overseer`, `data`, `coordinator` or other node roles for Elasticsearch. You can also specify how much storage and resources to allocate for each type of node independently.

Currently supported node types are -
- **data**: Data nodes hold the shards that contain the documents you have indexed. Data nodes handle data related operations like CRUD, search, and aggregations
- **overseer**: Overseer nodes can execute shard distributions, composed of one or more overseer processors
- **coordinator**: The coordinator node can act as if it has replicas of all collections in the cluster when a query is performed.

```yaml
topology:
data:
replicas: 3
podTemplate:
spec:
containers:
- name: "solr"
resources:
requests:
cpu: "900m"
limits:
cpu: "900m"
memory: "2.5Gi"
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
suffix: data
overseer:
replicas: 3
podTemplate:
spec:
containers:
- name: "solr"
resources:
requests:
cpu: "900m"
limits:
cpu: "900m"
memory: "2.5Gi"
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
suffix: overseer
coordinator:
replicas: 2
podTemplate:
spec:
containers:
- name: "solr"
resources:
requests:
cpu: "900m"
limits:
cpu: "900m"
memory: "2.5Gi"
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
suffix: coordinator
```

The `spec.topology` contains the following fields:

- `topology.overseer`:
- `replicas` (`: "1"`) - is an `optional` field to specify the number of nodes (ie. pods ) that act as the `overseer` nodes. Defaults to `1`.
- `suffix` (`: "overseer"`) - is an `optional` field that is added as the suffix of the overseer PetSet name. Defaults to `overseer`.
- `storage` is a `required` field that specifies how much storage to claim for each of the `overseer` nodes.
- `resources` (`: "cpu: 900m, memory: 2Gi" `) - is an `optional` field that specifies how much computational resources to request or to limit for each of the `overseer` nodes.

- `topology.data`:
- `replicas` (`: "1"`) - is an `optional` field to specify the number of nodes (ie. pods ) that act as the `data` nodes. Defaults to `1`.
- `suffix` (`: "data"`) - is an `optional` field that is added as the suffix of the data PetSet name. Defaults to `data`.
- `storage` is a `required` field that specifies how much storage to claim for each of the `data` nodes.
- `resources` (` cpu: 900m, memory: 2Gi `) - is an `optional` field that specifies which amount of computational resources to request or to limit for each of the `data` nodes.

- `topology.coordinator`:
- `replicas` (`: "1"`) - is an `optional` field to specify the number of nodes (ie. pods ) that act as the `coordinator` nodes. Defaults to `1`.
- `suffix` (`: "coordinator"`) - is an `optional` field that is added as the suffix of the data PetSet name. Defaults to `coordinator`.
- `storage` is a `required` field that specifies how much storage to claim for each of the `coordinator` nodes.
- `resources` (` cpu: 900m, memory: 2Gi `) - is an `optional` field that specifies which amount of computational resources to request or to limit for each of the `data` nodes.

> Note: Any two types of nodes can't have the same `suffix`.

If you specify `spec.topology` field then you **do not need** to specify the following fields in Elasticsearch CRD.

- `spec.replicas`
- `spec.storage`
- `spec.podTemplate.spec.resources`

If you do not specify `spec.topology` field, the Elasticsearch Cluster runs in combined mode.

> Combined Mode: all nodes of the Elasticsearch cluster will work as `overseer`, `data` and `coordinator` nodes simultaneously.

### spec.replicas

`spec.replicas` is an `optional` field that can be used if `spec.topology` is not specified. This field specifies the number of nodes (ie. pods) in the Elasticsearch cluster. The default value of this field is `1`.

```yaml
spec:
replicas: 3
```



### spec.zookeeperRef

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/solr/concepts/solropsrequests.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: AppBinding CRD
menu:
docs_{{ .version }}:
identifier: sl-solropsrequest-solr
name: AppBinding
name: SolrOpsRequest
parent: sl-concepts-solr
weight: 40
menu_name: docs_{{ .version }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Solr Custom Configuration
title: Custom Configuration With Config Files
menu:
docs_{{ .version }}:
identifier: sl-custom-config-solr
name: Solr Custom Configuration
identifier: sl-custom-config-file
name: Config Files
parent: sl-custom-config
weight: 30
menu_name: docs_{{ .version }}
Expand Down
Loading

0 comments on commit 5a6c0c0

Please sign in to comment.