Skip to content

Commit

Permalink
chore: add surrealdb via garden.io
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Ruck <[email protected]>
  • Loading branch information
Manuel Ruck committed Aug 17, 2024
1 parent 66aa79a commit b5ef909
Show file tree
Hide file tree
Showing 4 changed files with 48,424 additions and 0 deletions.
53 changes: 53 additions & 0 deletions infra/surrealdb/garden.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
kind: Run
name: surrealdb-sleep-init
type: exec
spec:
command:
- sh
- -c
- |
until kubectl get pods basic-tidb-0 > /dev/null 2>&1; do
echo "Waiting for pod basic-tidb-0 to be created..."
sleep 5
done
kubectl wait --for=condition=PodScheduled pod/basic-tidb-0
dependencies:
- deploy.tidb-cluster
---
kind: Run
name: surrealdb-sleep-run
type: exec
spec:
command: ['kubectl', 'wait', '--for=condition=Ready', 'pod/basic-tidb-0']
dependencies:
- run.surrealdb-sleep-init
---
kind: Deploy
type: helm
name: surrealdb
dependencies:
- run.surrealdb-sleep-run

spec:
chart:
repo: https://helm.surrealdb.com
name: surrealdb
version: 'v0.3.3'
values:
surrealdb:
path: tikv://basic-pd:2379
auth: false
image:
tag: 'v1.5.0'
ingress:
enabled: true
hosts:
- host: surrealdb.${var.hostname}
paths:
- path: /
pathType: Prefix
portForwards:
- name: surrealdb
resource: Service/surrealdb
targetPort: 8000
localPort: 8080
31 changes: 31 additions & 0 deletions infra/tidb/garden.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
kind: Deploy
name: tidb-crds
type: kubernetes

spec:
files:
- ./manifests/tidb-crds.yaml
---
kind: Deploy
type: helm
name: tidb-operator
dependencies:
- deploy.tidb-crds
spec:
chart:
repo: https://charts.pingcap.org/
name: tidb-operator
version: 'v1.5.3'
values:
scheduler:
create: false
---
kind: Deploy
name: tidb-cluster
type: kubernetes

dependencies:
- deploy.tidb-operator
spec:
files:
- ./manifests/tidb-cluster.yaml
54 changes: 54 additions & 0 deletions infra/tidb/manifests/tidb-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# IT IS NOT SUITABLE FOR PRODUCTION USE.
# This YAML describes a basic TiDB cluster with minimum resource requirements,
# which should be able to run in any Kubernetes cluster with storage support.
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
spec:
version: v7.5.1
timezone: UTC
pvReclaimPolicy: Retain
enableDynamicConfiguration: true
configUpdateStrategy: RollingUpdate
discovery: {}
helper:
image: alpine:3.16.0
pd:
baseImage: pingcap/pd
maxFailoverCount: 0
replicas: 1
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used
# storageClassName: local-storage
requests:
storage: '1Gi'
config: {}
tikv:
baseImage: pingcap/tikv
maxFailoverCount: 0
# If only 1 TiKV is deployed, the TiKV region leader
# cannot be transferred during upgrade, so we have
# to configure a short timeout
evictLeaderTimeout: 1m
replicas: 1
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used
# storageClassName: local-storage
requests:
storage: '1Gi'
config:
storage:
# In basic examples, we set this to avoid using too much storage.
reserve-space: '0MB'
rocksdb:
# In basic examples, we set this to avoid the following error in some Kubernetes clusters:
# "the maximum number of open file descriptors is too small, got 1024, expect greater or equal to 82920"
max-open-files: 256
raftdb:
max-open-files: 256
tidb:
baseImage: pingcap/tidb
maxFailoverCount: 0
replicas: 1
service:
type: ClusterIP
config: {}
Loading

0 comments on commit b5ef909

Please sign in to comment.