Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a supergraph configmap option to the helm chart #2119

Merged
merged 3 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,38 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/
# [x.x.x] (unreleased) - 2022-mm-dd
## ❗ BREAKING ❗
## 🚀 Features

### Add a supergraph configmap option to the helm chart ([PR #2119](https://github.com/apollographql/router/pull/2119))

Adds the capability to create a configmap containing your supergraph schema. Here's an example of how you could make use of this from your values.yaml and with the `helm` install command.

```yaml
extraEnvVars:
- name: APOLLO_ROUTER_SUPERGRAPH_PATH
value: /data/supergraph-schema.graphql

extraVolumeMounts:
- name: supergraph-schema
mountPath: /data
readOnly: true

extraVolumes:
- name: supergraph-schema
configMap:
name: "{{ .Release.Name }}-supergraph"
items:
- key: supergraph-schema.graphql
path: supergraph-schema.graphql
```

With that values.yaml content, and with your supergraph schema in a file name supergraph-schema.graphql, you can execute:

```
helm upgrade --install --create-namespace --namespace router-test --set-file supergraphFile=supergraph-schema.graphql router-test oci://ghcr.io/apollographql/helm-charts/router --version 1.0.0-rc.9 --values values.yaml
```

By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2119

## 🐛 Fixes
## 🛠 Maintenance
## 📚 Documentation
12 changes: 12 additions & 0 deletions helm/chart/router/templates/supergraph-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.supergraphFile }}
{{- $routerFullName := include "router.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $routerFullName }}-supergraph
labels:
{{- include "router.labels" . | nindent 4 }}
data:
supergraph-schema.graphql: |-
{{ .Values.supergraphFile | indent 4 }}
{{- end }}
4 changes: 4 additions & 0 deletions helm/chart/router/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ managedFederation:
# -- If using managed federation, the variant of which graph to use
graphRef: ""

# This should not be specified in values.yaml. It's much simpler to use --set-file from helm command line.
# e.g.: helm ... --set-file supergraphFile="location of your supergraph file"
supergraphFile:

# An array of extra environmental variables
# Example:
# extraEnvVars:
Expand Down