Skip to content

Commit

Permalink
Fixed Review stuffs
Browse files Browse the repository at this point in the history
Signed-off-by: ashraful <[email protected]>
  • Loading branch information
AshrafulHaqueToni committed May 6, 2024
1 parent 8300668 commit a8f9dd7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
28 changes: 15 additions & 13 deletions docs/guides/singlestore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ SingleStore, a distributed SQL database for real-time analytics, transactional w

## Supported SingleStore Features

| Features | Availability |
|---------------------------------------------------------|:------------:|
| Clustering | &#10003; |
| Authentication & Authorization | &#10003; |
| Features | Availability |
|------------------------------------------------------|:------------:|
| Clustering | &#10003; |
| Authentication & Authorization | &#10003; |
| Initialize using Script (\*.sql, \*sql.gz and/or \*.sh) | &#10003; |
| Custom Configuration | &#10003; |
| TLS | &#10003; |
| Monitoring with Prometheus & Grafana | &#10003; |
| Builtin Prometheus Discovery | &#10003; |
| Using Prometheus operator | &#10003; |
| Externally manageable Auth Secret | &#10003; |
| Reconfigurable Health Checker | &#10003; |
| Persistent volume | &#10003; |
| SingleStore Studio (UI) | &#10003; |
|Backup/Recovery: Instant, Scheduled ( KubeStash ) | &#10003; |
| Custom Configuration | &#10003; |
|Initializing from Snapshot ( KubeStash ) | &#10003; |
| TLS: Add ( Cert Manager ) | &#10003; |
| Monitoring with Prometheus & Grafana | &#10003; |
| Builtin Prometheus Discovery | &#10003; |
| Using Prometheus operator | &#10003; |
| Externally manageable Auth Secret | &#10003; |
| Reconfigurable Health Checker | &#10003; |
| Persistent volume | &#10003; |
| SingleStore Studio (UI) | &#10003; |


## Supported SingleStore Versions
Expand Down
26 changes: 16 additions & 10 deletions docs/guides/singlestore/quickstart/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ This tutorial will show you how to use KubeDB to run a SingleStore database.

- At first, you need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using [kind](https://kind.sigs.k8s.io/docs/user/quick-start/).

- Now, install KubeDB cli on your workstation and KubeDB operator in your cluster following the steps [here](/docs/setup/README.md).

- Now, install KubeDB cli on your workstation and KubeDB operator in your cluster following the steps [here](/docs/setup/README.md) and make sure install with helm command including `--set global.featureGates.Singlestore=true` to ensure SingleStore crd.
- [StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/) is required to run KubeDB. Check the available StorageClass in cluster.

```bash
Expand All @@ -45,7 +44,7 @@ This tutorial will show you how to use KubeDB to run a SingleStore database.

## Find Available SingleStoreVersion

When you have installed KubeDB, it has created `SinglestoreVersion` crd for all supported SingleStore versions. Check it by using the following command,
When you have installed KubeDB, it has created `SinglestoreVersion` crd for all supported SingleStore versions. Check it by using the `kubectl get singlestoreversions or sdbv` command.

```bash
$ kubectl get singlestoreversions
Expand All @@ -56,7 +55,7 @@ NAME VERSION DB_IMAGE
```
## Create SingleStore License Secret

We need SingleStore License to create SingleStore Database. So, we will pass the license by a secret.
We need SingleStore License to create SingleStore Database. So, Ensure that you have acquired a license and then simply pass the license by secret.

```bash
$ kubectl create secret generic -n demo license-secret \
Expand Down Expand Up @@ -122,6 +121,13 @@ spec:
name: license-secret
storageType: Durable
terminationPolicy: WipeOut
serviceTemplates:
- alias: primary
spec:
type: LoadBalancer
ports:
- name: http
port: 9999
```
```bash
Expand All @@ -137,12 +143,12 @@ Here,
- `spec.topology.aggregator.storage` or `spec.topology.leaf.storage` specifies the StorageClass of PVC dynamically allocated to store data for this database. This storage spec will be passed to the StatefulSet created by KubeDB operator to run database pods. You can specify any StorageClass available in your cluster with appropriate resource requests.
- `spec.terminationPolicy` gives flexibility whether to `nullify`(reject) the delete operation of `Singlestore` crd or which resources KubeDB should keep or delete when you delete `Singlestore` crd. If admission webhook is enabled, It prevents users from deleting the database as long as the `spec.terminationPolicy` is set to `DoNotTerminate`. Learn details of all `TerminationPolicy` [here](/docs/guides/mysql/concepts/database/index.md#specterminationpolicy)

> Note: spec.storage section is used to create PVC for database pod. It will create PVC with storage size specified instorage.resources.requests field. Don't specify limits here. PVC does not get resized automatically.
> Note: `spec.storage` section is used to create PVC for database pod. It will create PVC with storage size specified in `storage.resources.requests` field. Don't specify limits here. PVC does not get resized automatically.
KubeDB operator watches for `Singlestore` objects using Kubernetes api. When a `Singlestore` object is created, KubeDB operator will create new StatefulSet and Service with the matching SingleStore object name. KubeDB operator will also create a governing service for StatefulSets, if one is not already present.

```bash
$ kubectl get petsetset -n demo
$ kubectl get petset -n demo
NAME READY AGE
sdb-quickstart-leaf 2/2 33s
sdb-quickstart-aggregator 1/1 37s
Expand All @@ -157,9 +163,9 @@ pvc-4f45c51b-47d4-4254-8275-782bf3588667 10Gi RWO Delete
pvc-75057e3d-e1d7-4770-905b-6049f2edbcde 1Gi RWO Delete Bound demo/data-sdb-quickstart-master-aggregator-0 standard <unset> 91s
pvc-769e68f4-80a9-4e3e-b2bc-e974534b9dee 10Gi RWO Delete Bound demo/data-sdb-quickstart-leaf-1 standard <unset> 80s
$ kubectl get service -n demo
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
sdb-quickstart ClusterIP 10.96.6.30 <none> 3306/TCP 112s
sdb-quickstart-pods ClusterIP None <none> 3306/TCP 112s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
sdb-quickstart ClusterIP 10.96.6.30 <none> 3306/TCP,8081/TCP 112s
sdb-quickstart-pods ClusterIP None <none> 3306/TCP 112s
```

KubeDB operator sets the `status.phase` to `Running` once the database is successfully created. Run the following command to see the modified Singlestore object:
Expand Down Expand Up @@ -383,7 +389,7 @@ $ kubectl exec -it -n demo sdb-quickstart-aggregator-0 -- bash
```
You can also connect with database management tools like [singlestore-studio](https://docs.singlestore.com/db/v8.5/reference/singlestore-tools-reference/singlestore-studio/)

Just you need to port-forward on 8081 port
Just you need to `port-forward` on `8081` port. Also, you can do it through external ip.

```bash
$ kubectl port-forward -n demo service/sdb-quickstart 8081
Expand Down

0 comments on commit a8f9dd7

Please sign in to comment.