Skip to content

Commit dfea253

Browse files
feat(helm): allow using config of a router from a file (#1961)
1 parent 7efff15 commit dfea253

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

helm/cosmo/charts/router/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.12.0
18+
version: 0.13.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

helm/cosmo/charts/router/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# router
22

3-
![Version: 0.12.0](https://img.shields.io/badge/Version-0.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.197.1](https://img.shields.io/badge/AppVersion-0.197.1-informational?style=flat-square)
3+
![Version: 0.13.0](https://img.shields.io/badge/Version-0.13.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.197.1](https://img.shields.io/badge/AppVersion-0.197.1-informational?style=flat-square)
44

55
This is the official Helm Chart for the WunderGraph Cosmo Router.
66

@@ -15,6 +15,7 @@ This is the official Helm Chart for the WunderGraph Cosmo Router.
1515
| autoscaling.minReplicas | int | `1` | |
1616
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
1717
| commonConfiguration | string | `"version: \"1\"\nlog_level: \"info\""` | You can use this to provide the router configuration via yaml. Values here have precedence over the configurations section. For a full list of available configuration options, see https://cosmo-docs.wundergraph.com/router/configuration This value is processed with the helm `tpl` function allowing referencing of variables and inclusion of templates |
18+
| commonConfigurationPath | string | `""` | Path to a configuration file to embed. If set, this takes precedence over commonConfiguration. The file path is relative to the chart directory and will be processed with the helm `tpl` function. Example: "configs/router-config.yaml" |
1819
| commonLabels | object | `{}` | Add labels to all deployed resources |
1920
| configuration.cdnUrl | string | `""` | |
2021
| configuration.configPath | string | `""` | The path to the router config file. This does not refer to the execution config. See: https://cosmo-docs.wundergraph.com/router/configuration#config-file |

helm/cosmo/charts/router/templates/config-map.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ metadata:
1111
data:
1212
config.yaml: |-
1313
# User-supplied common configuration:
14-
{{- if .Values.commonConfiguration }}
14+
{{- if .Values.commonConfigurationPath }}
15+
{{- tpl (.Files.Get .Values.commonConfigurationPath) . | nindent 4 }}
16+
{{- else if .Values.commonConfiguration }}
1517
{{- tpl .Values.commonConfiguration . | nindent 4 }}
1618
{{- end }}
1719
logLevel: "{{ .Values.configuration.logLevel }}"

helm/cosmo/charts/router/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ commonConfiguration: |-
198198
version: "1"
199199
log_level: "info"
200200
201+
# -- Path to a configuration file to embed. If set, this takes precedence over commonConfiguration.
202+
# The file path is relative to the chart directory and will be processed with the helm `tpl` function.
203+
# Example: "configs/router-config.yaml"
204+
commonConfigurationPath: ""
205+
201206
# Use this section to pass the graphApiToken or to configure simple settings.
202207
configuration:
203208
# -- The router token is used to authenticate the router against the controlplane (required)

0 commit comments

Comments
 (0)