Skip to content

Commit 0ac8d3a

Browse files
committed
feat(helm): allow using config of a router from a file
When config gets large it's easier to manage it as an external file: - lint with external tools - get proper syntax support in editors - share the same config across multiple instances of a router
1 parent 7efff15 commit 0ac8d3a

File tree

10 files changed

+25
-3
lines changed

10 files changed

+25
-3
lines changed

helm/cosmo/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,5 @@ This is the official Helm Chart for WunderGraph Cosmo - The Full Lifecycle Graph
246246
| router.prometheus.port | int | `8088` | The port where metrics are exposed. Default is port 8088. |
247247
| router.terminationGracePeriodSeconds | int | `60` | |
248248

249+
----------------------------------------------
250+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

helm/cosmo/charts/cdn/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ WunderGraph Cosmo CDN
5353
| volumeMounts | list | `[]` | |
5454
| volumes | list | `[]` | |
5555

56+
----------------------------------------------
57+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

helm/cosmo/charts/controlplane/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,5 @@ WunderGraph Cosmo Controlplane
121121
| volumeMounts | list | `[]` | |
122122
| volumes | list | `[]` | |
123123

124+
----------------------------------------------
125+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

helm/cosmo/charts/graphqlmetrics/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ WunderGraph Cosmo GraphQL Metrics Collector
5757
| terminationGracePeriodSeconds | int | `10` | Sets the [termination grace period](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution) for Deployment pods |
5858
| tolerations | list | `[]` | |
5959

60+
----------------------------------------------
61+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

helm/cosmo/charts/otelcollector/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ WunderGraph Cosmo Open Telemetry Collector.
5656
| terminationGracePeriodSeconds | int | `10` | Sets the [termination grace period](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution) for Deployment pods |
5757
| tolerations | list | `[]` | |
5858

59+
----------------------------------------------
60+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

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: 4 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 |
@@ -78,3 +79,5 @@ This is the official Helm Chart for the WunderGraph Cosmo Router.
7879
| terminationGracePeriodSeconds | int | `30` | Sets the [termination grace period](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution) for Deployment pods |
7980
| tolerations | list | `[]` | |
8081

82+
----------------------------------------------
83+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

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)

helm/cosmo/charts/studio/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ WunderGraph Cosmo Studio.
4747
| terminationGracePeriodSeconds | int | `5` | Sets the [termination grace period](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution) for Deployment pods |
4848
| tolerations | list | `[]` | |
4949

50+
----------------------------------------------
51+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

0 commit comments

Comments
 (0)