Router

The following instructions help you install the Router Chart on Kubernetes.

Chart Repository: oci://ghcr.io/wundergraph/cosmo/helm-charts/router

ArtifactHub: https://artifacthub.io/packages/helm/cosmo-router/router

Source: Repository

Helm releases are currently not part of any release automation. We update them as recent as possible in the repository above. Please reach out to us if you need something else.

Install the Router

Install the router through our official OCI chart. Note that Helm 3.8 or later is required.

Create the following file to not bother with cli flags.

values.yaml
configuration:
  # -- The router token is used to authenticate the router against the controlplane (required)
  graphApiToken: "replace-me"

After that you can install the chart with the release name router. You can use the command also to upgrade a release e.g. after a configuration update.

helm upgrade --install router oci://ghcr.io/wundergraph/cosmo/helm-charts/router \
    --version 0.0.1 \
    --values ./values.yaml

Use a custom Router config

Managing environment variables can be tedious. We also support providing a custom router configuration. To do so, you only need to create one and specify its name in the chart values. The config must exist in the same namespace as the router.

router-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: router-config
  # Must be same as the router
  namespace: default
data:
  # key is important
  config.yaml: |
    log_level: debug

Now, specify the configuration name in the existingConfigmap of the chart values. Keep in mind that secrets should be passed as Kubernetes Secrets. Use extraEnvVars or extraEnvVarsSecret to pass additional ones.

values.yaml
existingConfigmap: "router-config"

Inline router configuration

Instead of creating a separate configmap, you can also inline the configuration values as part of the router chart values. This is handy but should not be used for secrets. Secrets should be passed in the configuration section or through a custom secret map.

# Use this section to pass the graphApiToken or to configure simple settings.
# -- 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
commonConfiguration: |-
  version: "1"
  log_level: "info"

Install with a static Router Execution Config

If you follow the default instructions the execution config is polled from the controlplane. Sometimes this is not desired e.g. when you have a strict CI/CD workflow or SLA requirements. The following instructions, shows you how to deploy a Router with a static router execution config.

1. Download the latest valid execution config

wgc router fetch <graph-name> -n <namespace> -o router.json

2. Set the file content on the helm value

helm upgrade router oci://ghcr.io/wundergraph/cosmo/helm-charts/router \
    --version 0.0.1 \
    --set-file configuration.executionConfig=./router.json
    --values ./values.yaml

Install the router with a static execution config is a legitimate way to deploy the schema but requires automation to update the router continuously.

Last updated