Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Solr Quickstart #639

Merged
merged 23 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ Guides to show you how to perform tasks with KubeDB:
- [Kafka](/docs/guides/kafka/README.md). Shows how to manage Kafka using KubeDB.
- [ZooKeeper](/docs/guides/zookeeper/README.md). Shows how to manage ZooKeeper using KubeDB.
- [SingleStore](/docs/guides/singlestore/README.md). Shows how to manage SingleStore using KubeDB.
- [Solr](/docs/guides/solr/README.md). Shows how to manage Solr using KubeDB.
53 changes: 53 additions & 0 deletions docs/guides/solr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Solr
menu:
docs_{{ .version }}:
identifier: sl-readme-solr
name: Solr
parent: sl-solr-guides
weight: 10
menu_name: docs_{{ .version }}
section_menu_id: guides
url: /docs/{{ .version }}/guides/solr/
aliases:
- /docs/{{ .version }}/guides/solr/README/
---

> New to KubeDB? Please start [here](/docs/README.md).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a overview block like this -

Overview

SingleStore, a distributed SQL database for real-time analytics, transactional workloads, and operational applications. With its in-memory processing and scalable architecture, SingleStore enables organizations to achieve high-performance and low-latency data processing across diverse data sets, making it ideal for modern data-intensive applications and analytical workflows.

### Overview

Solr is an open-source, Java-based, information retrieval library with support for limited relational, graph, statistical, data analysis or storage related use cases. Solr is designed to drive powerful document retrieval or analytical applications involving unstructured data, semi-structured data or a mix of unstructured and structured data. Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world's largest internet sites.

## Supported Solr Features
| Features | Availability |
|--------------------------------------|:------------:|
| Clustering | ✓ |
| Customized Docker Image | ✓ |
| Authentication & Autorization | ✓ |
| Reconfigurable Health Checker | ✓ |
| Custom Configuration | ✓ |
| Grafana Dashboards | ✓ |
| Externally manageable Auth Secret | ✓ |
| Persistent Volume | ✓ |
| Monitoring with Prometheus & Grafana | ✓ |
| Builtin Prometheus Discovery | ✓ |
| Alert Dashboard | ✓ |
| Using Prometheus operator | ✓ |
| Dashboard ( Solr UI ) | ✓ |

## Life Cycle of a Solr Object

<p align="center">
  <img alt="lifecycle" src="/docs/guides/solr/quickstart/overview/images/Lifecycle-of-a-solr-instance.png">
</p>

## User Guide

- [Quickstart Solr](/docs/guides/solr/quickstart/overview/index.md) with KubeDB Operator.
- Detail Concept of [Solr Object](/docs/guides/solr/concepts/solr.md).


## Next Steps

- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
10 changes: 10 additions & 0 deletions docs/guides/solr/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Solr
menu:
docs_{{ .version }}:
identifier: sl-solr-guides
name: Solr
parent: guides
weight: 10
menu_name: docs_{{ .version }}
---
10 changes: 10 additions & 0 deletions docs/guides/solr/concepts/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Solr Concepts
menu:
docs_{{ .version }}:
identifier: sl-concepts-solr
name: Concepts
parent: sl-solr-guides
weight: 14
menu_name: docs_{{ .version }}
---
140 changes: 140 additions & 0 deletions docs/guides/solr/concepts/appbinding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
title: AppBinding CRD
menu:
docs_{{ .version }}:
identifier: sl-appbinding-solr
name: AppBinding
parent: sl-concepts-solr
weight: 30
menu_name: docs_{{ .version }}
section_menu_id: guides
---

> New to KubeDB? Please start [here](/docs/README.md).

# AppBinding

## What is AppBinding

An `AppBinding` is a Kubernetes `CustomResourceDefinition`(CRD) which points to an application using either its URL (usually for a non-Kubernetes resident service instance) or a Kubernetes service object (if self-hosted in a Kubernetes cluster), some optional parameters and a credential secret. To learn more about AppBinding and the problems it solves, please read this blog post: [The case for AppBinding](https://appscode.com/blog/post/the-case-for-appbinding).

If you deploy a database using [KubeDB](https://kubedb.com/docs/0.11.0/concepts/), `AppBinding` object will be created automatically for it. Otherwise, you have to create an `AppBinding` object manually pointing to your desired database.

KubeDB uses [Stash](https://appscode.com/products/stash/) to perform backup/recovery of databases. Stash needs to know how to connect with a target database and the credentials necessary to access it. This is done via an `AppBinding`.

## AppBinding CRD Specification

Like any official Kubernetes resource, an `AppBinding` has `TypeMeta`, `ObjectMeta` and `Spec` sections. However, unlike other Kubernetes resources, it does not have a `Status` section.

An `AppBinding` object created by `KubeDB` for Solr database is shown below,

```yaml
apiVersion: appcatalog.appscode.com/v1alpha1
kind: AppBinding
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"kubedb.com/v1alpha2","kind":"Solr","metadata":{"annotations":{},"name":"solr-dev","namespace":"dev"},"spec":{"monitor":{"agent":"prometheus.io/builtin"},"replicas":3,"solrModules":["s3-repository","gcs-repository","prometheus-exporter"],"storage":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}},"storageClassName":"linode-block-storage"},"terminationPolicy":"Delete","version":"9.4.1","zookeeperRef":{"name":"zoo-dev","namespace":"dev"}}}
creationTimestamp: "2024-05-06T11:25:38Z"
generation: 1
labels:
app.kubernetes.io/component: database
app.kubernetes.io/instance: solr-dev
app.kubernetes.io/managed-by: kubedb.com
app.kubernetes.io/name: solrs.kubedb.com
name: solr-dev
namespace: dev
ownerReferences:
- apiVersion: kubedb.com/v1alpha2
blockOwnerDeletion: true
controller: true
kind: Solr
name: solr-dev
uid: a7cff8ba-8ab8-4d6c-8808-322f14a9f63d
resourceVersion: "26297"
uid: ad59a514-6026-47a5-b433-9291dc2da001
spec:
appRef:
apiGroup: kubedb.com
kind: Solr
name: solr-dev
namespace: dev
clientConfig:
service:
name: solr-dev
port: 8983
scheme: http
secret:
name: solr-dev-admin-cred
type: kubedb.com/solr
version: 9.4.1
```

Here, we are going to describe the sections of an `AppBinding` crd.

### AppBinding `Spec`

An `AppBinding` object has the following fields in the `spec` section:

#### spec.type

`spec.type` is an optional field that indicates the type of the app that this `AppBinding` is pointing to. Stash uses this field to resolve the values of `TARGET_APP_TYPE`, `TARGET_APP_GROUP` and `TARGET_APP_RESOURCE` variables of [BackupBlueprint](https://appscode.com/products/stash/latest/concepts/crds/backupblueprint/) object.

This field follows the following format: `<app group>/<resource kind>`. The above AppBinding is pointing to a `solr` resource under `kubedb.com` group.

Here, the variables are parsed as follows:

| Variable | Usage |
| --------------------- |-------------------------------------------------------------------------------------------------------------------------------|
| `TARGET_APP_GROUP` | Represents the application group where the respective app belongs (i.e: `kubedb.com`). |
| `TARGET_APP_RESOURCE` | Represents the resource under that application group that this appbinding represents (i.e: `solr`). |
| `TARGET_APP_TYPE` | Represents the complete type of the application. It's simply `TARGET_APP_GROUP/TARGET_APP_RESOURCE` (i.e: `kubedb.com/solr`). |

#### spec.secret

`spec.secret` specifies the name of the secret which contains the credentials that are required to access the database. This secret must be in the same namespace as the `AppBinding`.

This secret must contain the following keys:

| Key | Usage |
| ---------- | ---------------------------------------------- |
| `username` | Username of the target database. |
| `password` | Password for the user specified by `username`. |



#### spec.appRef
appRef refers to the underlying application. It has 4 fields named `apiGroup`, `kind`, `name` & `namespace`.

#### spec.clientConfig

`spec.clientConfig` defines how to communicate with the target database. You can use either a URL or a Kubernetes service to connect with the database. You don't have to specify both of them.

You can configure following fields in `spec.clientConfig` section:

- **spec.clientConfig.url**

`spec.clientConfig.url` gives the location of the database, in standard URL form (i.e. `[scheme://]host:port/[path]`). This is particularly useful when the target database is running outside of the Kubernetes cluster. If your database is running inside the cluster, use `spec.clientConfig.service` section instead.

> Note that, attempting to use a user or basic auth (e.g. `user:password@host:port`) is not allowed. Stash will insert them automatically from the respective secret. Fragments ("#...") and query parameters ("?...") are not allowed either.

- **spec.clientConfig.service**

If you are running the database inside the Kubernetes cluster, you can use Kubernetes service to connect with the database. You have to specify the following fields in `spec.clientConfig.service` section if you manually create an `AppBinding` object.

- **name :** `name` indicates the name of the service that connects with the target database.
- **scheme :** `scheme` specifies the scheme (i.e. http, https) to use to connect with the database.
- **port :** `port` specifies the port where the target database is running.

- **spec.clientConfig.insecureSkipTLSVerify**

`spec.clientConfig.insecureSkipTLSVerify` is used to disable TLS certificate verification while connecting with the database. We strongly discourage to disable TLS verification during backup. You should provide the respective CA bundle through `spec.clientConfig.caBundle` field instead.

- **spec.clientConfig.caBundle**

`spec.clientConfig.caBundle` is a PEM encoded CA bundle which will be used to validate the serving certificate of the database.

## Next Steps

- Learn how to use KubeDB to manage various databases [here](/docs/guides/README.md).
- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
Loading
Loading