Skip to content

Commit

Permalink
Updated helm chart for added newSql backend services
Browse files Browse the repository at this point in the history
  • Loading branch information
Asam80 committed Dec 24, 2024
1 parent 41cd816 commit 4ae848c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
11 changes: 10 additions & 1 deletion charts/opentelemetry-demo/templates/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@
{{- $config := set . "observability" $.Values.observability }}
{{- $config := set . "defaultValues" $.Values.default }}

{{- if and $config.enabled (eq $name "productCatalogService") -}}
{{- $config := set $config "env" (list
(dict "name" "DB_HOST" "value" $.Values.postgresql.host)
(dict "name" "DB_PORT" "value" $.Values.postgresql.port)
(dict "name" "DB_USER" "value" $.Values.postgresql.username)
(dict "name" "DB_PASSWORD" "value" $.Values.postgresql.password)
(dict "name" "DB_NAME" "value" $.Values.postgresql.database)
) -}}
{{- end }}

{{- if $config.enabled -}}
{{- include "otel-demo.deployment" $config -}}
{{- include "otel-demo.service" $config -}}
{{- include "otel-demo.ingress" $config -}}
{{- include "otel-demo.configmap" $config -}}
{{ end }}

{{- end }}
34 changes: 34 additions & 0 deletions charts/opentelemetry-demo/values.schema.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


{
"$schema": "http://json-schema.org/schema#",
"type": "object",
Expand Down Expand Up @@ -47,6 +49,38 @@
},
"opensearch": {
"type": "object"
},
"postgresql": {
"type": "object",
"description": "Configuration for PostgreSQL integration",
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable or disable PostgreSQL"
},
"host": {
"type": "string",
"description": "PostgreSQL host"
},
"port": {
"type": "string",
"description": "PostgreSQL port"
},
"username": {
"type": "string",
"description": "PostgreSQL username"
},
"password": {
"type": "string",
"description": "PostgreSQL password"
},
"database": {
"type": "string",
"description": "PostgreSQL database name"
}
},
"required": ["enabled", "host", "port", "username", "password", "database"],
"additionalProperties": false
}
},
"required": [
Expand Down
18 changes: 18 additions & 0 deletions charts/opentelemetry-demo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

postgresql:
enabled: true
host: "postgres-db" # PostgreSQL service hostname
port: "5432" # Default PostgreSQL port
username: "postgres" # PostgreSQL username
password: "postgres" # PostgreSQL password
database: "product_catalog" # PostgreSQL database name

components:
## Demo Components are named objects (services) with several properties
# demoService:
Expand Down Expand Up @@ -497,6 +505,16 @@ components:
value: "8013"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://$(OTEL_COLLECTOR_NAME):4317
- name: DB_HOST
value: "postgres-db" # PostgreSQL service hostname
- name: DB_PORT
value: "5432" # PostgreSQL default port
- name: DB_USER
value: "postgres" # PostgreSQL username
- name: DB_PASSWORD
value: "postgres" # PostgreSQL password
- name: DB_NAME
value: "product_catalog" # PostgreSQL database name
resources:
limits:
memory: 20Mi
Expand Down

0 comments on commit 4ae848c

Please sign in to comment.