diff --git a/docs/guides/singlestore/README.md b/docs/guides/singlestore/README.md index 5359205e7d..c1f29a33dd 100644 --- a/docs/guides/singlestore/README.md +++ b/docs/guides/singlestore/README.md @@ -42,7 +42,6 @@ SingleStore, a distributed SQL database for real-time analytics, transactional w KubeDB supports the following SingleSore Versions. - `8.1.32` -- `8.5.7` - `8.5.30` - `8.7.10` diff --git a/docs/guides/singlestore/autoscaler/_index.md b/docs/guides/singlestore/autoscaler/_index.md index a1db3ad2bd..890618438e 100644 --- a/docs/guides/singlestore/autoscaler/_index.md +++ b/docs/guides/singlestore/autoscaler/_index.md @@ -5,6 +5,6 @@ menu: identifier: sdb-auto-scaling name: Autoscaling parent: guides-singlestore - weight: 47 + weight: 46 menu_name: docs_{{ .version }} --- diff --git a/docs/guides/singlestore/autoscaler/compute/cluster.md b/docs/guides/singlestore/autoscaler/compute/cluster.md index 6ba0ad152c..d9e2b6bb39 100644 --- a/docs/guides/singlestore/autoscaler/compute/cluster.md +++ b/docs/guides/singlestore/autoscaler/compute/cluster.md @@ -3,7 +3,7 @@ title: SingleStore Compute Autoscaling Overview menu: docs_{{ .version }}: identifier: sdb-auto-scaling-cluster - name: Cluster + name: SingleStore Compute parent: sdb-compute-auto-scaling weight: 20 menu_name: docs_{{ .version }} diff --git a/docs/guides/singlestore/autoscaler/storage/cluster.md b/docs/guides/singlestore/autoscaler/storage/cluster.md index 97bef46317..318406e8d6 100644 --- a/docs/guides/singlestore/autoscaler/storage/cluster.md +++ b/docs/guides/singlestore/autoscaler/storage/cluster.md @@ -3,7 +3,7 @@ title: SingleStore Cluster Autoscaling menu: docs_{{ .version }}: identifier: sdb-storage-auto-scaling-cluster - name: Cluster + name: SingleStore Storage parent: sdb-storage-auto-scaling weight: 20 menu_name: docs_{{ .version }} diff --git a/docs/guides/singlestore/backup/_index.md b/docs/guides/singlestore/backup/_index.md index f73e22e71c..60dfa7346c 100644 --- a/docs/guides/singlestore/backup/_index.md +++ b/docs/guides/singlestore/backup/_index.md @@ -5,6 +5,6 @@ menu: identifier: guides-sdb-backup name: Backup & Restore parent: guides-singlestore - weight: 70 + weight: 40 menu_name: docs_{{ .version }} --- diff --git a/docs/guides/singlestore/clustering/_index.md b/docs/guides/singlestore/clustering/_index.md index f41d5f02e1..58610731fd 100644 --- a/docs/guides/singlestore/clustering/_index.md +++ b/docs/guides/singlestore/clustering/_index.md @@ -5,6 +5,6 @@ menu: identifier: sdb-clustering name: Clustering parent: guides-singlestore - weight: 30 + weight: 25 menu_name: docs_{{ .version }} --- \ No newline at end of file diff --git a/docs/guides/singlestore/configuration/_index.md b/docs/guides/singlestore/configuration/_index.md index 23009f55b6..6580eb5067 100755 --- a/docs/guides/singlestore/configuration/_index.md +++ b/docs/guides/singlestore/configuration/_index.md @@ -5,6 +5,6 @@ menu: identifier: guides-sdb-configuration name: Custom Configuration parent: guides-singlestore - weight: 80 + weight: 30 menu_name: docs_{{ .version }} --- diff --git a/docs/guides/singlestore/configuration/podtemplating/index.md b/docs/guides/singlestore/configuration/podtemplating/index.md new file mode 100644 index 0000000000..fffafcdd7f --- /dev/null +++ b/docs/guides/singlestore/configuration/podtemplating/index.md @@ -0,0 +1,197 @@ +--- +title: Run SingleStore with Custom PodTemplate +menu: + docs_{{ .version }}: + identifier: guides-sdb-configuration-using-podtemplate + name: Customize PodTemplate + parent: guides-sdb-configuration + weight: 15 +menu_name: docs_{{ .version }} +section_menu_id: guides +--- + +> New to KubeDB? Please start [here](/docs/README.md). + +# Run SingleStore with Custom PodTemplate + +KubeDB supports providing custom configuration for SingleStore via [PodTemplate](/docs/guides/singlestore/concepts/singlestore.md#spec.topology). This tutorial will show you how to use KubeDB to run a SingleStore database with custom configuration using PodTemplate. + +## Before You Begin + +- 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). + +- To keep things isolated, this tutorial uses a separate namespace called `demo` throughout this tutorial. + + ```bash + $ kubectl create ns demo + namespace/demo created + ``` + +> Note: YAML files used in this tutorial are stored in [docs/guides/singlestore/configuration/podtemplating/yamls](https://github.com/kubedb/docs/tree/{{< param "info.version" >}}/docs/guides/singlestore/configuration/podtemplating/yamls) folder in GitHub repository [kubedb/docs](https://github.com/kubedb/docs). + +## Overview + +KubeDB allows providing a template for `leaf` and `aggregator` pod through `spec.topology.aggregator.podTemplate` and `spec.topology.leaf.podTemplate`. KubeDB operator will pass the information provided in `spec.topology.aggregator.podTemplate` and `spec.topology.leaf.podTemplate` to the `aggregator` and `leaf` PetSet created for SingleStore database. + +KubeDB accept following fields to set in `podTemplate:` + +- metadata: + - annotations (pod's annotation) +- controller: + - annotations (petset's annotation) +- spec: + - env + - resources + - initContainers + - imagePullSecrets + - nodeSelector + - affinity + - schedulerName + - tolerations + - priorityClassName + - priority + - securityContext + +Read about the fields in details in [PodTemplate concept](/docs/guides/mysql/concepts/database/index.md#specpodtemplate), + +## CRD Configuration + +Below is the YAML for the SingleStore created in this example. Here, [`spec.topology.aggregator/leaf.podTemplate.spec.args`](/docs/guides/mysql/concepts/database/index.md#specpodtemplatespecargs) provides extra arguments. + +```yaml +apiVersion: kubedb.com/v1alpha2 +kind: Singlestore +metadata: + name: sdb-misc-config + namespace: demo +spec: + version: "8.7.10" + topology: + aggregator: + replicas: 1 + podTemplate: + spec: + containers: + - name: singlestore + resources: + limits: + memory: "2Gi" + cpu: "600m" + requests: + memory: "2Gi" + cpu: "600m" + args: + - --character-set-server=utf8mb4 + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + leaf: + replicas: 2 + podTemplate: + spec: + containers: + - name: singlestore + resources: + limits: + memory: "2Gi" + cpu: "600m" + requests: + memory: "2Gi" + cpu: "600m" + args: + - --character-set-server=utf8mb4 + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + licenseSecret: + name: license-secret + storageType: Durable + deletionPolicy: WipeOut +``` + +```bash +$ kubectl create -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/singlestore/configuration/podtemplating/yamls/sdb-misc-config.yaml +singlestore.kubedb.com/sdb-misc-config created +``` + +Now, wait a few minutes. KubeDB operator will create necessary PVC, petset, services, secret etc. If everything goes well, we will see that a pod with the name `sdb-misc-config-aggregator-0` has been created. + +Check that the petset's pod is running + +```bash +$ kubectl get pod -n demo +NAME READY STATUS RESTARTS AGE +sdb-misc-config-aggregator-0 2/2 Running 0 4m51s +sdb-misc-config-leaf-0 2/2 Running 0 4m48s +sdb-misc-config-leaf-1 2/2 Running 0 4m30s +``` + +Now, we will check if the database has started with the custom configuration we have provided. + +```bash +$ kubectl exec -it -n demo sdb-misc-config-aggregator-0 -- bash +Defaulted container "singlestore" out of: singlestore, singlestore-coordinator, singlestore-init (init) +[memsql@sdb-misc-config-aggregator-0 /]$ memsql -uroot -p$ROOT_PASSWORD +singlestore-client: [Warning] Using a password on the command line interface can be insecure. +Welcome to the MySQL monitor. Commands end with ; or \g. +Your MySQL connection id is 311 +Server version: 5.7.32 SingleStoreDB source distribution (compatible; MySQL Enterprise & MySQL Commercial) + +Copyright (c) 2000, 2022, Oracle and/or its affiliates. + +Oracle is a registered trademark of Oracle Corporation and/or its +affiliates. Other names may be trademarks of their respective +owners. + +Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + +singlestore> SHOW VARIABLES LIKE 'char%'; ++--------------------------+------------------------------------------------------+ +| Variable_name | Value | ++--------------------------+------------------------------------------------------+ +| character_set_client | utf8mb4 | +| character_set_connection | utf8mb4 | +| character_set_database | utf8mb4 | +| character_set_filesystem | binary | +| character_set_results | utf8mb4 | +| character_set_server | utf8mb4 | +| character_set_system | utf8 | +| character_sets_dir | /opt/memsql-server-8.7.10-95e2357384/share/charsets/ | ++--------------------------+------------------------------------------------------+ +8 rows in set (0.00 sec) + +singlestore> exit +Bye + +``` + +Here we can see the character_set_server value is utf8mb4. + +## Cleaning up + +To cleanup the Kubernetes resources created by this tutorial, run: + +```bash +kubectl delete singlestore -n demo sdb-misc-config + +kubectl delete ns demo +``` + +If you would like to uninstall KubeDB operator, please follow the steps [here](/docs/setup/README.md). + +## Next Steps + +- [Quickstart SingleStore](/docs/guides/singlestore/quickstart/quickstart.md) with KubeDB Operator. +- Initialize [SingleStore with Script](/docs/guides/singlestore/initialization). +- Detail concepts of [SingleStore object](/docs/guides/singlestore/concepts/singlestore.md). +- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md). diff --git a/docs/guides/singlestore/configuration/podtemplating/yamls/sdb-misc-config.yaml b/docs/guides/singlestore/configuration/podtemplating/yamls/sdb-misc-config.yaml new file mode 100644 index 0000000000..afbe5678ca --- /dev/null +++ b/docs/guides/singlestore/configuration/podtemplating/yamls/sdb-misc-config.yaml @@ -0,0 +1,57 @@ +apiVersion: kubedb.com/v1alpha2 +kind: Singlestore +metadata: + name: sdb-misc-config + namespace: demo +spec: + version: "8.7.10" + topology: + aggregator: + replicas: 1 + podTemplate: + spec: + containers: + - name: singlestore + resources: + limits: + memory: "2Gi" + cpu: "600m" + requests: + memory: "2Gi" + cpu: "600m" + args: + - --character-set-server=utf8mb4 + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + leaf: + replicas: 2 + podTemplate: + spec: + containers: + - name: singlestore + resources: + limits: + memory: "2Gi" + cpu: "600m" + requests: + memory: "2Gi" + cpu: "600m" + args: + - --character-set-server=utf8mb4 + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + licenseSecret: + name: license-secret + storageType: Durable + deletionPolicy: WipeOut + diff --git a/docs/guides/singlestore/initialization/_index.md b/docs/guides/singlestore/initialization/_index.md index 4e2befffcf..6d2bb64fa7 100755 --- a/docs/guides/singlestore/initialization/_index.md +++ b/docs/guides/singlestore/initialization/_index.md @@ -5,6 +5,6 @@ menu: identifier: guides-sdb-initialization name: Initialization parent: guides-singlestore - weight: 80 + weight: 41 menu_name: docs_{{ .version }} --- diff --git a/docs/guides/singlestore/monitoring/_index.md b/docs/guides/singlestore/monitoring/_index.md index 3c9e800653..1053b439d3 100644 --- a/docs/guides/singlestore/monitoring/_index.md +++ b/docs/guides/singlestore/monitoring/_index.md @@ -5,6 +5,6 @@ menu: identifier: guides-sdb-monitoring name: Monitoring parent: guides-singlestore - weight: 120 + weight: 50 menu_name: docs_{{ .version }} --- diff --git a/docs/guides/singlestore/reconfigure/reconfigure-steps/index.md b/docs/guides/singlestore/reconfigure/reconfigure-steps/index.md index fa84c78598..dd1b01c344 100644 --- a/docs/guides/singlestore/reconfigure/reconfigure-steps/index.md +++ b/docs/guides/singlestore/reconfigure/reconfigure-steps/index.md @@ -3,7 +3,7 @@ title: Reconfigure SingleStore Configuration menu: docs_{{ .version }}: identifier: guides-sdb-reconfigure-reconfigure-steps - name: Cluster + name: Reconfigure OpsRequest parent: guides-sdb-reconfigure weight: 20 menu_name: docs_{{ .version }} diff --git a/docs/guides/singlestore/scaling/horizontal-scaling/cluster/index.md b/docs/guides/singlestore/scaling/horizontal-scaling/cluster/index.md index ce597a29b7..7b289a738e 100644 --- a/docs/guides/singlestore/scaling/horizontal-scaling/cluster/index.md +++ b/docs/guides/singlestore/scaling/horizontal-scaling/cluster/index.md @@ -3,7 +3,7 @@ title: Horizontal Scaling SingleStore menu: docs_{{ .version }}: identifier: guides-sdb-scaling-horizontal-cluster - name: Cluster + name: Horizontal Scaling OpsRequest parent: guides-sdb-scaling-horizontal weight: 20 menu_name: docs_{{ .version }} diff --git a/docs/guides/singlestore/scaling/vertical-scaling/cluster/index.md b/docs/guides/singlestore/scaling/vertical-scaling/cluster/index.md index fa5028c6bc..dab35d70ea 100644 --- a/docs/guides/singlestore/scaling/vertical-scaling/cluster/index.md +++ b/docs/guides/singlestore/scaling/vertical-scaling/cluster/index.md @@ -3,7 +3,7 @@ title: Vertical Scaling SingleStore Cluster menu: docs_{{ .version }}: identifier: guides-sdb-scaling-vertical-cluster - name: Cluster + name: Vertical Scaling OpsRequest parent: guides-sdb-scaling-vertical weight: 30 menu_name: docs_{{ .version }} diff --git a/docs/guides/singlestore/tls/_index.md b/docs/guides/singlestore/tls/_index.md index 2dfb14950f..9503da0132 100644 --- a/docs/guides/singlestore/tls/_index.md +++ b/docs/guides/singlestore/tls/_index.md @@ -5,6 +5,6 @@ menu: identifier: guides-sdb-tls name: TLS/SSL Encryption parent: guides-singlestore - weight: 110 + weight: 45 menu_name: docs_{{ .version }} --- diff --git a/docs/guides/singlestore/update-version/_index.md b/docs/guides/singlestore/update-version/_index.md index b7a557aded..cfa345ebab 100644 --- a/docs/guides/singlestore/update-version/_index.md +++ b/docs/guides/singlestore/update-version/_index.md @@ -5,6 +5,6 @@ menu: identifier: guides-sdb-updating name: UpdateVersion parent: guides-singlestore - weight: 45 + weight: 42 menu_name: docs_{{ .version }} --- diff --git a/docs/guides/singlestore/update-version/cluster/examples/sample-sdb.yaml b/docs/guides/singlestore/update-version/sdb update-version opsrequest/examples/sample-sdb.yaml similarity index 100% rename from docs/guides/singlestore/update-version/cluster/examples/sample-sdb.yaml rename to docs/guides/singlestore/update-version/sdb update-version opsrequest/examples/sample-sdb.yaml diff --git a/docs/guides/singlestore/update-version/cluster/examples/sdbops-update.yaml b/docs/guides/singlestore/update-version/sdb update-version opsrequest/examples/sdbops-update.yaml similarity index 100% rename from docs/guides/singlestore/update-version/cluster/examples/sdbops-update.yaml rename to docs/guides/singlestore/update-version/sdb update-version opsrequest/examples/sdbops-update.yaml diff --git a/docs/guides/singlestore/update-version/cluster/index.md b/docs/guides/singlestore/update-version/sdb update-version opsrequest/index.md similarity index 99% rename from docs/guides/singlestore/update-version/cluster/index.md rename to docs/guides/singlestore/update-version/sdb update-version opsrequest/index.md index 8e6c79577e..4593512230 100644 --- a/docs/guides/singlestore/update-version/cluster/index.md +++ b/docs/guides/singlestore/update-version/sdb update-version opsrequest/index.md @@ -3,7 +3,7 @@ title: Updating SingleStore Cluster menu: docs_{{ .version }}: identifier: guides-sdb-updating-cluster - name: Cluster + name: Update Version OpsRequest parent: guides-sdb-updating weight: 30 menu_name: docs_{{ .version }} diff --git a/docs/guides/singlestore/volume-expansion/volume-expansion/example/sample-sdb.yaml b/docs/guides/singlestore/volume-expansion/sdb volume-expansion opsrequest/example/sample-sdb.yaml similarity index 100% rename from docs/guides/singlestore/volume-expansion/volume-expansion/example/sample-sdb.yaml rename to docs/guides/singlestore/volume-expansion/sdb volume-expansion opsrequest/example/sample-sdb.yaml diff --git a/docs/guides/singlestore/volume-expansion/volume-expansion/example/sdb-offline-volume-expansion.yaml b/docs/guides/singlestore/volume-expansion/sdb volume-expansion opsrequest/example/sdb-offline-volume-expansion.yaml similarity index 100% rename from docs/guides/singlestore/volume-expansion/volume-expansion/example/sdb-offline-volume-expansion.yaml rename to docs/guides/singlestore/volume-expansion/sdb volume-expansion opsrequest/example/sdb-offline-volume-expansion.yaml diff --git a/docs/guides/singlestore/volume-expansion/volume-expansion/index.md b/docs/guides/singlestore/volume-expansion/sdb volume-expansion opsrequest/index.md similarity index 100% rename from docs/guides/singlestore/volume-expansion/volume-expansion/index.md rename to docs/guides/singlestore/volume-expansion/sdb volume-expansion opsrequest/index.md