Skip to content

Commit 40f8edb

Browse files
Nikita-Levuskinasmyasnikovblinkov
authored
add kind to quickstart (#10254)
Co-authored-by: Aleksey Myasnikov <asmyasnikov@ydb.tech> Co-authored-by: Ivan Blinkov <ivan@ydb.tech>
1 parent d634970 commit 40f8edb

File tree

2 files changed

+140
-0
lines changed

2 files changed

+140
-0
lines changed

ydb/docs/en/core/quickstart.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,50 @@ Normally, {{ ydb-short-name }} stores data on multiple SSD/NVMe or HDD raw disk
135135
136136
10. To continue, get access to port 8765 from outside Kubernetes using `kubectl port-forward database-minikube-sample-0 8765`.
137137
138+
- Kind
139+
140+
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.
141+
142+
2. Install [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/).
143+
144+
3. Clone the repository with [{{ ydb-short-name }} Kubernetes Operator](https://github.com/ydb-platform/ydb-kubernetes-operator):
145+
146+
```bash
147+
git clone https://github.com/ydb-platform/ydb-kubernetes-operator && cd ydb-kubernetes-operator
148+
```
149+
150+
4. Create a Kind cluster and wait until it is ready:
151+
152+
```bash
153+
kind create cluster --config=samples/kind/kind-config.yaml --wait 5m
154+
```
155+
156+
5. Install the {{ ydb-short-name }} controller in the cluster:
157+
158+
```bash
159+
helm upgrade --install ydb-operator deploy/ydb-operator --set metrics.enabled=false
160+
```
161+
162+
6. Apply the manifest for creating a storage:
163+
164+
```bash
165+
kubectl apply -f samples/kind/storage.yaml
166+
```
167+
168+
7. Wait for `kubectl get storages.ydb.tech` to become `Ready`.
169+
170+
8. Apply the manifest for creating a database:
171+
172+
```bash
173+
kubectl apply -f samples/kind/database.yaml
174+
```
175+
176+
9. Wait for `kubectl get databases.ydb.tech` to become `Ready`.
177+
178+
10. 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-kind-sample` DNS name on port 2135.
179+
180+
11. To continue, get access to port 8765 from outside Kubernetes using `kubectl port-forward database-kind-sample-0 8765`.
181+
138182
{% endlist %}
139183
140184
@@ -289,6 +333,32 @@ Stop the local {{ ydb-short-name }} cluster after you have finished experimentin
289333
helm delete ydb-operator
290334
```
291335

336+
- Kind
337+
338+
To delete the {{ ydb-short-name }} database, it is enough to delete the Database resource associated with it:
339+
340+
```bash
341+
kubectl delete database.ydb.tech database-kind-sample
342+
```
343+
344+
To delete the {{ ydb-short-name }} cluster, execute the following commands (all data will be lost):
345+
346+
```bash
347+
kubectl delete storage.ydb.tech storage-kind-sample
348+
```
349+
350+
To remove the {{ ydb-short-name }} controller from the Kubernetes cluster, delete the release created by Helm:
351+
352+
```bash
353+
helm delete ydb-operator
354+
```
355+
356+
To delete `kind` cluster, run the following command:
357+
358+
```bash
359+
kind delete cluster
360+
```
361+
292362
{% endlist %}
293363

294364
## Done! What's next?

ydb/docs/ru/core/quickstart.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,50 @@
134134

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

137+
- Kind
138+
139+
1. Установите интерфейс командной строки Kubernetes [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) и менеджер пакетов [Helm 3](https://helm.sh/docs/intro/install/).
140+
141+
2. Установите [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/).
142+
143+
3. Склонируйте репозиторий с [{{ ydb-short-name }} Kubernetes Operator](https://github.com/ydb-platform/ydb-kubernetes-operator):
144+
145+
```bash
146+
git clone https://github.com/ydb-platform/ydb-kubernetes-operator && cd ydb-kubernetes-operator
147+
```
148+
149+
4. Создайте Kind кластер и дождитесь его готовности:
150+
151+
```bash
152+
kind create cluster --config=samples/kind/kind-config.yaml --wait 5m
153+
```
154+
155+
5. Установите на кластер контроллер {{ ydb-short-name }}:
156+
157+
```bash
158+
helm upgrade --install ydb-operator deploy/ydb-operator --set metrics.enabled=false
159+
```
160+
161+
6. Примените манифест для создания хранилища данных {{ ydb-short-name }}:
162+
163+
```bash
164+
kubectl apply -f samples/kind/storage.yaml
165+
```
166+
167+
7. Подождите, пока `kubectl get storages.ydb.tech` станет `Ready`.
168+
169+
8. Примените манифест для создания базы данных:
170+
171+
```bash
172+
kubectl apply -f samples/kind/database.yaml
173+
```
174+
175+
9. Подождите, пока `kubectl get databases.ydb.tech` станет `Ready`.
176+
177+
10. После обработки манифеста создаётся объект StatefulSet, описывающий набор динамических узлов. Созданная база данных будет доступна изнутри кластера Kubernetes по DNS-имени `database-kind-sample` на портах 2135 и 8765.
178+
179+
11. Получите доступ к порту 8765 снаружи Kubernetes через `kubectl port-forward database-kind-sample-0 8765` для продолжения.
180+
137181
{% endlist %}
138182

139183

@@ -289,6 +333,32 @@ FLATTEN LIST BY keys AS key
289333
helm delete ydb-operator
290334
```
291335

336+
- Kind
337+
338+
Чтобы удалить базу данных {{ ydb-short-name }}, достаточно удалить сопоставленный с ней ресурс Database:
339+
340+
```bash
341+
kubectl delete database.ydb.tech database-kind-sample
342+
```
343+
344+
Чтобы удалить кластер {{ ydb-short-name }}, выполните следующие команды (все данные будут потеряны):
345+
346+
```bash
347+
kubectl delete storage.ydb.tech storage-kind-sample
348+
```
349+
350+
Чтобы удалить контроллер {{ ydb-short-name }} из кластера Kubernetes, удалите релиз, созданный Helm:
351+
352+
```bash
353+
helm delete ydb-operator
354+
```
355+
356+
Чтобы удалить кластер Kind целиком, выполните следующую команду:
357+
358+
```bash
359+
kind delete cluster
360+
```
361+
292362
{% endlist %}
293363

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

0 commit comments

Comments
 (0)