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

Conversation

garypen
Copy link
Contributor

@garypen garypen commented Nov 16, 2022

Here's an example of values.yaml that you could use to mount this to your container:

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

Note: This takes advantage of the fact that we tpl template the extraVolumes in the deployment template, so {{ .Release.Name }} will be templated into the release name at install. You don't have to do this, you could just hard-code it, but this is neater.

Here's an example command line:

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

NB: rc.9 doesn't exist, so the command is purely illustrative to show how this works.

Here's an example of values.yaml that you could use to mount this to
your container:

```
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

```

Note: This takes advantage of the fact that we `tpl` template the
extraVolumes in the deployment template, so {{ .Release.Name }} will be
templated into the release name at install. You don't have to do this,
you could just hard-code it, but this is neater.

Here's an example command line:

```
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
```

NB: rc.9 doesn't exist, so the command is purely illustrative to show
how this works.
@garypen garypen added this to the v1-NEXT milestone Nov 16, 2022
@garypen garypen self-assigned this Nov 16, 2022
@github-actions

This comment has been minimized.

@garypen garypen merged commit 519a52f into dev Nov 17, 2022
@garypen garypen deleted the garypen/helm-supergraph-cm branch November 17, 2022 10:26
goto-bus-stop pushed a commit that referenced this pull request Nov 29, 2022
Here's an example of values.yaml that you could use to mount this to
your container:

```
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

```

Note: This takes advantage of the fact that we `tpl` template the
extraVolumes in the deployment template, so {{ .Release.Name }} will be
templated into the release name at install. You don't have to do this,
you could just hard-code it, but this is neater.

Here's an example command line:

```
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
```

NB: rc.9 doesn't exist, so the command is purely illustrative to show
how this works.
@BrynCooke BrynCooke modified the milestones: v1.4.0, v1-NEXT, v1.5.0 Dec 2, 2022
@garypen garypen added this to the v1.5.0 milestone Dec 5, 2022
@BrynCooke BrynCooke modified the milestone: v1.5.0 Dec 5, 2022
@BrynCooke BrynCooke mentioned this pull request Dec 5, 2022
garypen added a commit that referenced this pull request Dec 12, 2022
Building off of @garypen's PR #2119, if the supergraphFile is set, add a
label to the pods with a hash of its contents. This will force new pods
to be spun up if the supergraphFile is changed so the new file will be
loaded.

Co-authored-by: Thomas O'Neill <toneill@new-innov.com>
Co-authored-by: Gary Pennington <gary@apollographql.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants