Skip to content

Commit

Permalink
[castai-db-optimizer] support for default routing (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamg authored Feb 5, 2025
1 parent 37611a4 commit 3fcbb67
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/castai-db-optimizer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: castai-db-optimizer
description: CAST AI database cache deployment.
type: application
version: 0.7.1
version: 0.8.0
4 changes: 3 additions & 1 deletion charts/castai-db-optimizer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# castai-db-optimizer

![Version: 0.7.1](https://img.shields.io/badge/Version-0.7.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

CAST AI database cache deployment.

Expand Down Expand Up @@ -42,6 +42,8 @@ CAST AI database cache deployment.
| resources.queryProcessor.cpu | string | `"2"` | |
| resources.queryProcessor.memory | string | `"1Gi"` | |
| tolerations | object | `{}` | Pod toleration rules. Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ |
| upstreamPostgresHostname | string | `""` | Hostname of the upstream Postgres instance. |
| upstreamPostgresPort | int | `5432` | Port of the upstream Postgres instance. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
2 changes: 2 additions & 0 deletions charts/castai-db-optimizer/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cacheGroupID: "123"
apiKey: "456"

upstreamPostgresHostname: random.hostname

resources:
proxy:
ephemeralStorage: 5Mi
Expand Down
2 changes: 1 addition & 1 deletion charts/castai-db-optimizer/templates/_versions.tpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{- define "defaultProxyVersion" -}}4.52.3{{- end -}}
{{- define "defaultProxyVersion" -}}4.53.0{{- end -}}
{{- define "defaultQueryProcessorVersion" -}}v0.5.0-rc.1{{- end -}}
25 changes: 20 additions & 5 deletions charts/castai-db-optimizer/templates/envoy_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ data:
"@type": type.googleapis.com/castai.filters.router.v1.RouterConfig
tcp_proxy_config:
stat_prefix: proxy_egress
cluster: dummy
cluster: postgres_upstream
idle_timeout: 0s
transport_socket:
name: envoy.transport_sockets.starttls
Expand Down Expand Up @@ -106,17 +106,32 @@ data:
int_value: 2 # number of failed probes
state: STATE_PREBIND
clusters:
- name: dummy
- name: postgres_upstream
type: LOGICAL_DNS
dns_lookup_family: ALL
connect_timeout: 1s
load_assignment:
cluster_name: dummy
cluster_name: postgres_upstream
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 1234
address: {{ required "upstreamPostgresHostname must be provided" .Values.upstreamPostgresHostname }}
port_value: {{ .Values.upstreamPostgresPort | default 5432 }}
transport_socket:
name: envoy.transport_sockets.start_tls
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.starttls.v3.UpstreamStartTlsConfig
tls_socket_config:
sni: {{ required "upstreamPostgresHostname must be provided" .Values.upstreamPostgresHostname }}
common_tls_context:
tls_params:
tls_maximum_protocol_version: TLSv1_3
upstream_config:
name: castai.upstream.pool
typed_config:
"@type": type.googleapis.com/castai.upstream.v1.CastaiConnectionPoolProto
- name: {{ .Values.apiURL }}
type: LOGICAL_DNS
Expand Down
6 changes: 5 additions & 1 deletion charts/castai-db-optimizer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ resources:
cpu: "2"
memory: "1Gi"

# -- Hostname of the upstream Postgres instance.
upstreamPostgresHostname: ""
# -- Port of the upstream Postgres instance.
upstreamPostgresPort: 5432

proxy:
# -- Default proxy log level.
logLevel: "filter:info"
Expand All @@ -52,7 +57,6 @@ proxy:
# -- Default drain time in seconds.
drainTimeSeconds: 60


queryProcessor:
# -- Default query-processor log level.
logLevel: "warn"
Expand Down

0 comments on commit 3fcbb67

Please sign in to comment.