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

YDBDOCS-653: restore minikube quickstart instructions #4528

Merged
merged 1 commit into from
May 15, 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
64 changes: 61 additions & 3 deletions ydb/docs/en/core/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Normally, {{ ydb-short-name }} stores data on multiple SSD/NVMe or HDD raw disk
```

This will download and unpack the archive containing the `ydbd` executable, libraries, configuration files, and scripts needed to start and stop the local cluster.

The script is executed entirely with the current user privileges (notice the lack of `sudo`). Therefore, it can't do much on the system. You can check which exactly commands it runs by opening the same URL in your browser.

3. Start the cluster in one of the following storage modes:
Expand Down Expand Up @@ -97,6 +97,44 @@ Normally, {{ ydb-short-name }} stores data on multiple SSD/NVMe or HDD raw disk

The `YDB_USE_IN_MEMORY_PDISKS` setting makes all data volatile, stored only in RAM. Currently, data persistence by turning it off is supported only on x86_64 processors.

- Minikube

1. Install the Kubernetes CLI [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [Helm 3](https://helm.sh/docs/intro/install/) package manager.

2. Install and run [Minikube](https://kubernetes.io/ru/docs/tasks/tools/install-minikube/).

3. Clone the repository with [{{ ydb-short-name }} Kubernetes Operator](https://github.com/ydb-platform/ydb-kubernetes-operator):

```bash
git clone https://github.com/ydb-platform/ydb-kubernetes-operator && cd ydb-kubernetes-operator
```

4. Install the {{ ydb-short-name }} controller in the cluster:

```bash
helm upgrade --install ydb-operator deploy/ydb-operator --set metrics.enabled=false
```

5. Apply the manifest for creating a {{ ydb-short-name }} cluster:

```bash
kubectl apply -f samples/minikube/storage.yaml
```

6. Wait for `kubectl get storages.ydb.tech` to become `Ready`.

7. Apply the manifest for creating a database:

```bash
kubectl apply -f samples/minikube/database.yaml
```

8. Wait for `kubectl get databases.ydb.tech` to become `Ready`.

9. After processing the manifest, a StatefulSet object that describes a set of dynamic nodes is created. The created database will be accessible from inside the Kubernetes cluster by the `database-minikube-sample` DNS name on port 2135.

10. To continue, get access to port 8765 from outside Kubernetes using `kubectl port-forward database-minikube-sample-0 8765`.

{% endlist %}


Expand Down Expand Up @@ -217,6 +255,8 @@ Stop the local {{ ydb-short-name }} cluster after you have finished experimentin
~/ydbd/stop.sh
```

Optionally, you can then clean up your filesystem by removing your working directory with the `rm -rf ~/ydbd` command. All data inside the local {{ ydb-short-name }} cluster will be lost.

- Docker

To stop the Docker container with the local cluster, run the following command:
Expand All @@ -225,9 +265,27 @@ Stop the local {{ ydb-short-name }} cluster after you have finished experimentin
docker kill ydb-local
```

{% endlist %}
Optionally, you can then clean up your filesystem by removing your working directory with the `rm -rf ~/ydbd` command. All data inside the local {{ ydb-short-name }} cluster will be lost.

- Minikube

Optionally, you can then clean up your filesystem by removing your working directory with the `rm -rf ~/ydbd` command. All data inside the local {{ ydb-short-name }} cluster will be lost.
To delete the {{ ydb-short-name }} database, it is enough to delete the Database resource associated with it:

```bash
kubectl delete database.ydb.tech database-minikube-sample
```
To delete the {{ ydb-short-name }} cluster, execute the following commands (all data will be lost):

```bash
kubectl delete storage.ydb.tech storage-minikube-sample
```
To remove the {{ ydb-short-name }} controller from the Kubernetes cluster, delete the release created by Helm:

```bash
helm delete ydb-operator
```

{% endlist %}

## Done! What's next?

Expand Down
63 changes: 61 additions & 2 deletions ydb/docs/ru/core/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,44 @@

Настройка `YDB_USE_IN_MEMORY_PDISKS` делает все данные волатильными, хранящимися только в оперативной памяти. В настоящее время сохранение данных путем её отключения поддерживается только на x86_64 процессорах.

- Minikube

1. Установите интерфейс командной строки Kubernetes [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) и менеджер пакетов [Helm 3](https://helm.sh/docs/intro/install/).

2. Установите и запустите [Minikube](https://kubernetes.io/ru/docs/tasks/tools/install-minikube/).

3. Склонируйте репозиторий с [{{ ydb-short-name }} Kubernetes Operator](https://github.com/ydb-platform/ydb-kubernetes-operator):

```bash
git clone https://github.com/ydb-platform/ydb-kubernetes-operator && cd ydb-kubernetes-operator
```

4. Установите на кластер контроллер {{ ydb-short-name }}:

```bash
helm upgrade --install ydb-operator deploy/ydb-operator --set metrics.enabled=false
```

5. Примените манифест для создания кластера {{ ydb-short-name }}:

```bash
kubectl apply -f samples/minikube/storage.yaml
```

6. Подождите, пока `kubectl get storages.ydb.tech` станет `Ready`.

7. Примените манифест для создания базы данных:

```bash
kubectl apply -f samples/minikube/database.yaml
```

8. Подождите, пока `kubectl get databases.ydb.tech` станет `Ready`.

9. После обработки манифеста создаётся объект StatefulSet, описывающий набор динамических узлов. Созданная база данных будет доступна изнутри кластера Kubernetes по DNS-имени `database-minikube-sample` на портах 2135 и 8765.

10. Получите доступ к порту 8765 снаружи Kubernetes через `kubectl port-forward database-minikube-sample-0 8765` для продолжения.

{% endlist %}


Expand Down Expand Up @@ -217,6 +255,8 @@ FLATTEN LIST BY keys AS key
~/ydbd/stop.sh
```

При желании вы можете удалить вашу рабочую директорию с помощью команды `rm -rf ~/ydbd` для очистки файловой системы. Все данные внутри локального кластера {{ ydb-short-name }} будут потеряны.

- Docker

Чтобы остановить Docker контейнер с локальным кластером, выполните следующую команду:
Expand All @@ -225,9 +265,28 @@ FLATTEN LIST BY keys AS key
docker kill ydb-local
```

{% endlist %}
При желании вы можете удалить вашу рабочую директорию с помощью команды `rm -rf ~/ydbd` для очистки файловой системы. Все данные внутри локального кластера {{ ydb-short-name }} будут потеряны.

- Minikube

Чтобы удалить базу данных {{ ydb-short-name }}, достаточно удалить сопоставленный с ней ресурс Database:

При желании вы можете удалить вашу рабочую директорию с помощью команды `rm -rf ~/ydbd` для очистки файловой системы. Все данные внутри локального кластера {{ ydb-short-name }} будут потеряны.
```bash
kubectl delete database.ydb.tech database-minikube-sample
```

Чтобы удалить кластер{{ ydb-short-name }}, выполните следующие команды (все данные будут потеряны):

```bash
kubectl delete storage.ydb.tech storage-minikube-sample
```
Чтобы удалить контроллер {{ ydb-short-name }} из кластера Kubernetes, удалите релиз, созданный Helm:

```bash
helm delete ydb-operator
```

{% endlist %}

## Готово! Что дальше?

Expand Down
Loading