Skip to content

Commit a315a4d

Browse files
committed
examples: add Tarantool Data Grid example
1 parent 77c195b commit a315a4d

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Tarantool Operator Examples
22

33
[KV storage](./kv) - distributed key value storage
4+
5+
[Tarantool Data Grid](./tarantool-data-grid) - run TDG on Kubernetes
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Tarantool Data Grid
2+
3+
This folder contains example on how to run [Tarantool Data Grid](https://www.tarantool.io/en/datagrid/)
4+
on Kubernetes.
5+
6+
## Requirements
7+
8+
To run this example you will need:
9+
10+
- [helm](https://helm.sh/docs/intro/install/)
11+
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
12+
- Tarantool Data Grid docker image
13+
14+
## Running example
15+
16+
1. Install Tarantool Helm repo:
17+
18+
```shell
19+
$ helm repo add tarantool https://tarantool.github.io/tarantool-operator
20+
```
21+
22+
2. Install Tarantool Kubernetes Operator:
23+
24+
```shell
25+
$ helm install --set namespace=tarantool tarantool-operator tarantool/tarantool-operator --namespace tarantool --create-namespace --version 0.0.6
26+
---
27+
NAME: tarantool-operator
28+
NAMESPACE: tarantool
29+
STATUS: deployed
30+
TEST SUITE: None
31+
```
32+
33+
wait for Operator to become Running:
34+
35+
```shell
36+
$ kubeclt -n tarantool get pods -w
37+
---
38+
NAME READY STATUS RESTARTS AGE
39+
tarantool-operator-xxx-yyy 1/1 Running 0 3s
40+
```
41+
42+
3. Get Tarantool Data Grid image:
43+
44+
- go to [tarantool.io](https://tarantool.io)
45+
46+
- authorize via "Sign In"
47+
48+
- then go to "Customer zone" > "tdg"
49+
50+
- download archive with docker image, this example tested on tdg-1.6.8-xxxxxxx.docker-image.tar.gz
51+
52+
- import image from archive:
53+
54+
```shell
55+
$ docker image load -i tdg-1.6.8-xxxxxxx.docker-image.tar.gz
56+
---
57+
Loaded image ID: sha256:b6206567xxxxxxxxxxxxxx
58+
```
59+
60+
- tag loaded image:
61+
62+
```shell
63+
$ docker tag b6206567xxxxxxxxxxxxxx tdg:1.6.8
64+
```
65+
66+
- make image available to k8s nodes:
67+
68+
- push image to your registry, so k8s will be able to download it
69+
70+
- manually upload image to each node
71+
72+
73+
74+
4. Take ```values.yaml``` from this folder, change `image.repository` and `image.tag` to point to tdg image and install it with helm:
75+
76+
```shell
77+
$ helm install -f values.yaml tdg-app tarantool/cartridge --namespace tarantool --version 0.0.6
78+
---
79+
NAME: tdg-app
80+
NAMESPACE: tarantool
81+
STATUS: deployed
82+
TEST SUITE: None
83+
```
84+
85+
Wait until pods up and cluster is ready.
86+
87+
5. Access TDG web ui:
88+
89+
```shell
90+
kubectl -n tarantool port-forward service/routers 8081:8081
91+
---
92+
Forwarding from 127.0.0.1:8081 -> 8081
93+
Forwarding from [::1]:8081 -> 8081
94+
...
95+
```
96+
97+
Now you should be able to navigate to 127.0.0.1:8081 with your browser and access tdg web ui.
98+
99+
Now you should have running Tarantool Data Grid cluster.
100+
101+
Proceed to our [TDG examples](https://github.com/tarantool/examples/tree/master/tdg) repository to start using cluster.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Название среды и название кластера.
2+
ClusterEnv: dev
3+
ClusterName: test-app
4+
5+
# Installation namespace
6+
namespace: tarantool
7+
8+
# Docker image to run
9+
image:
10+
repository: tdg
11+
tag: 1.6.8
12+
pullPolicy: IfNotPresent
13+
14+
# Cluster topology
15+
RoleConfig:
16+
- RoleName: routers # Tarantool replicaset name
17+
ReplicaCount: 1 # Number of replicas in each replicaset
18+
ReplicaSetCount: 1 # Number of replicasets for this role(s)
19+
DiskSize: 1Gi # Persistent Volume disk sze
20+
CPUallocation: 0.25 # Number of vCPUs to allocate to each container
21+
MemtxMemoryMB: 256 # MB of memory to be assigned to each container
22+
RolesToAssign: # Tarantool Cartridge roles to assign
23+
- account_manager
24+
- input_processor
25+
- connector
26+
- scheduler
27+
- task_runner
28+
- frontend
29+
- notifier
30+
- output_processor
31+
- storage
32+
- logger
33+
- sequence_generator
34+
- failover-coordinator

0 commit comments

Comments
 (0)