Skip to content

Commit

Permalink
feat(server): support dedicated database (#1728)
Browse files Browse the repository at this point in the history
* feat(server): support dedicated database

* chore(build): add default deploy manifest

* chore(server): cannot change database type when update bundle

* feat(server): add dedicated database specs to bundle

* fix(server): wait for app start for long time

* fix monitor metrics label

* change ddb capacity price unit

* filter ddb cpu/memory metrics labels

* chore: merge upstream main

* refactor(build): change mongodb to kb mongodb

* refactor dedicated database fields

* add assert and change db host

* fix miss limit ratio

* add kb-mongodb service monitor

* install jq first when deploy

* cannot reduce ddb capacity

* add default databaseCapacity

* add empty field fallback

* project request resources of ddb to empty

* fix request resources

* disabled ddb replicas change

* change deploy manifest sa

---------

Co-authored-by: maslow <[email protected]>
  • Loading branch information
0fatal and maslow authored Jan 3, 2024
1 parent 9236d65 commit cae101b
Show file tree
Hide file tree
Showing 64 changed files with 1,728 additions and 587 deletions.
2 changes: 2 additions & 0 deletions build/Kubefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ USER 65532:65532
COPY charts ./charts
# COPY manifests ./manifests
COPY registry ./registry
COPY deploy-manifest ./deploy-manifest
COPY start.sh ./start.sh
COPY prometheus-helm.yaml ./prometheus-helm.yaml
COPY mongodb.yaml ./mongodb.yaml

ENV DOMAIN=127.0.0.1.nip.io
ENV NAMESPACE=laf-system
Expand Down
2 changes: 2 additions & 0 deletions build/charts/laf-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ spec:
value: {{ .Values.default_region.tls.wildcard_certificate_secret_name | quote}}
- name: DEFAULT_REGION_PROMETHEUS_URL
value: {{ .Values.default_region.prometheus_url }}
- name: DEFAULT_REGION_DEPLOY_MANIFEST
value: {{ .Values.default_region.deploy_manifest }}
- name: SITE_NAME
value: {{ .Values.siteName | quote}}
{{- with .Values.nodeSelector }}
Expand Down
16 changes: 16 additions & 0 deletions build/charts/laf-server/templates/rumtime-exporter.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.default_region.runtime_exporter_secret }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -98,3 +99,18 @@ spec:
expr: max_over_time(sum by (appid) (laf_runtime_cpu_limit{container!=""})[1h:])
- record: laf:billing:memory
expr: max_over_time(sum by (appid) (laf_runtime_memory_limit{container!=""})[1h:])
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: kb-mongodb
spec:
endpoints:
- interval: 30s
path: /metrics
port: http-metrics
selector:
matchLabels:
app.kubernetes.io/name: mongodb
apps.kubeblocks.io/component-name: mongodb
{{- end }}
1 change: 1 addition & 0 deletions build/charts/laf-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ default_region:
runtime_exporter_secret: ""
# prometheus
prometheus_url: ""
deploy_manifest: ""
jwt:
secret: laf_server_abc123
expires_in: 7d
Expand Down
23 changes: 0 additions & 23 deletions build/charts/mongodb/.helmignore

This file was deleted.

24 changes: 0 additions & 24 deletions build/charts/mongodb/Chart.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions build/charts/mongodb/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions build/charts/mongodb/keyFile

This file was deleted.

13 changes: 0 additions & 13 deletions build/charts/mongodb/templates/NOTES.txt

This file was deleted.

62 changes: 0 additions & 62 deletions build/charts/mongodb/templates/_helpers.tpl

This file was deleted.

61 changes: 0 additions & 61 deletions build/charts/mongodb/templates/ingress.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions build/charts/mongodb/templates/secret.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions build/charts/mongodb/templates/service.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions build/charts/mongodb/templates/serviceaccount.yaml

This file was deleted.

Loading

0 comments on commit cae101b

Please sign in to comment.