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

docs: update router containerization and deployment content #3943

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0755ced
WIP: add router helm and k8s deployment content from dogfooding
shorgi Sep 29, 2023
985f837
WIP: add common config
shorgi Oct 2, 2023
f4a8efe
Update docs/source/containerization/kubernetes.mdx
shorgi Oct 3, 2023
16658be
Update docs/source/containerization/kubernetes.mdx
shorgi Oct 3, 2023
b2e933f
Update docs/source/containerization/kubernetes.mdx
shorgi Oct 3, 2023
2e5f6e7
Update docs/source/containerization/kubernetes.mdx
shorgi Oct 3, 2023
d56c58c
Merge branch 'dev' into eh/docs/k8s-deployment
shorgi Oct 3, 2023
4ec2938
Refine content, from basic deployment to customizing for metrics, Rha…
shorgi Oct 3, 2023
b58d150
copyedits
shorgi Oct 4, 2023
b753d51
Merge branch 'dev' into eh/docs/k8s-deployment
shorgi Oct 4, 2023
4b86642
copyedit and update from review comment
shorgi Oct 4, 2023
6ecc695
Reorganize content in overview and docker. Add k8s overview flowchart.
shorgi Oct 5, 2023
f26b257
Merge branch 'dev' into eh/docs/k8s-deployment
shorgi Oct 5, 2023
9622755
Add changeset
shorgi Oct 5, 2023
1fcf343
Change to (shared) typical coprocessor config example
shorgi Oct 5, 2023
82ff698
copyedit to address review comments
shorgi Oct 5, 2023
5f3e271
Copyedit and address review comments
shorgi Oct 5, 2023
d72bd2d
Apply suggestions from code review
shorgi Oct 6, 2023
fb16ac6
Apply suggestions from code review
shorgi Oct 6, 2023
6ddf6fb
address review comments
shorgi Oct 6, 2023
bc7351d
address review comments
shorgi Oct 6, 2023
a8eedbf
Merge branch 'dev' into eh/docs/k8s-deployment
shorgi Oct 6, 2023
5a089ef
address review comment
shorgi Oct 9, 2023
2cfd211
address review comments
shorgi Oct 9, 2023
062f418
Apply suggestions from code review
shorgi Oct 9, 2023
cf44811
Merge branch 'dev' into eh/docs/k8s-deployment
shorgi Oct 9, 2023
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
5 changes: 5 additions & 0 deletions .changesets/docs_eh_docs_k8s_deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Updated documentation for deploying router ([PR #3943](https://github.com/apollographql/router/pull/3943))

Updated documentation for containerized router deployments, with guides and examples for [deploying on Kubernetes](https://www.apollographql.com/docs/router/containerization/kubernetes) and [running on Docker](https://www.apollographql.com/docs/router/containerization/docker).

By [@shorgi](https://github.com/shorgi) in https://github.com/apollographql/router/pull/3943
47 changes: 47 additions & 0 deletions docs/shared/coproc-typical-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
```yaml title="router.yaml"
coprocessor:
url: http://127.0.0.1:8081 # Required. Replace with the URL of your coprocessor's HTTP endpoint.
timeout: 2s # The timeout for all coprocessor requests. Defaults to 1 second (1s)
router: # This coprocessor hooks into the `RouterService`
request: # By including this key, the `RouterService` sends a coprocessor request whenever it first receives a client request.
headers: true # These boolean properties indicate which request data to include in the coprocessor request. All are optional and false by default.
body: false
context: false
sdl: false
path: false
method: false
response: # By including this key, the `RouterService` sends a coprocessor request whenever it's about to send response data to a client (including incremental data via @defer).
headers: true
body: false
context: false
sdl: false
status_code: false
supergraph: # This coprocessor hooks into the `SupergraphService`
request: # By including this key, the `SupergraphService` sends a coprocessor request whenever it first receives a client request.
headers: true # These boolean properties indicate which request data to include in the coprocessor request. All are optional and false by default.
body: false
context: false
sdl: false
method: false
response: # By including this key, the `SupergraphService` sends a coprocessor request whenever it's about to send response data to a client (including incremental data via @defer).
headers: true
body: false
context: false
sdl: false
status_code: false
subgraph:
all:
request: # By including this key, the `SubgraphService` sends a coprocessor request whenever it is about to make a request to a subgraph.
headers: true # These boolean properties indicate which request data to include in the coprocessor request. All are optional and false by default.
body: false
context: false
uri: false
method: false
service_name: false
response: # By including this key, the `SubgraphService` sends a coprocessor request whenever receives a subgraph response.
headers: true
body: false
context: false
service_name: false
status_code: false
```
238 changes: 238 additions & 0 deletions docs/shared/helm-show-router-output.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
```yaml
Pulled: ghcr.io/apollographql/helm-charts/router:1.31.0
Digest: sha256:26fbe98268456935cac5b51d44257bf96c02ee919fde8d47a06602ce2cda66a3
# Default values for router.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

# -- See https://www.apollographql.com/docs/router/configuration/overview/#yaml-config-file for yaml structure
router:
configuration:
supergraph:
listen: 0.0.0.0:80
health_check:
listen: 0.0.0.0:8088
telemetry:
metrics:
prometheus:
enabled: false
listen: 0.0.0.0:9090
path: "/metrics"

args:
- --hot-reload

managedFederation:
# -- If using managed federation, the graph API key to identify router to Studio
apiKey:
# -- If using managed federation, use existing Secret which stores the graph API key instead of creating a new one.
shorgi marked this conversation as resolved.
Show resolved Hide resolved
# If set along `managedFederation.apiKey`, a secret with the graph API key will be created using this parameter as name
existingSecret:
# -- 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:
# - name: APOLLO_ROUTER_SUPERGRAPH_PATH
# value: /etc/apollo/supergraph.yaml
# - name: APOLLO_ROUTER_LOG
# value: debug
#
extraEnvVars: []
extraEnvVarsCM: ''
extraEnvVarsSecret: ''

# An array of extra VolumeMounts
# Example:
# extraVolumeMounts:
# - name: rhai-volume
# mountPath: /dist/rhai
# readonly: true
extraVolumeMounts: []

# An array of extra Volumes
# Example:
# extraVolumes:
# - name: rhai-volume
# configMap:
# name: rhai-config
#
extraVolumes: []

image:
repository: ghcr.io/apollographql/router
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

containerPorts:
# -- If you override the port in `router.configuration.server.listen` then make sure to match the listen port here
http: 80
# -- For exposing the metrics port when running a serviceMonitor for example
metrics: 9090
# -- For exposing the health check endpoint
health: 8088

# -- An array of extra containers to include in the router pod
# Example:
# extraContainers:
# - name: coprocessor
# image: acme/coprocessor:1.0
# ports:
# - containerPort: 4001
extraContainers: []

# -- An array of init containers to include in the router pod
# Example:
# initContainers:
# - name: init-myservice
# image: busybox:1.28
# command: ["sh"]
initContainers: []

# -- A map of extra labels to apply to the resources created by this chart
# Example:
# extraLabels:
# label_one_name: "label_one_value"
# label_two_name: "label_two_value"
extraLabels: {}

lifecycle: {}
# preStop:
# exec:
# command:
# - /bin/bash
# - -c
# - sleep 10

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 80
annotations: {}

serviceMonitor:
enabled: false

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

# set to true to enable istio's virtualservice
virtualservice:
enabled: false
# namespace: ""
# gatewayName: ""
# http:
# main:
# # set enabled to true to add
# # the default matcher of `exact: "/" or prefix: "/graphql"`
# # with the <$fullName>.<.Release.Namespace>.svc.cluster.local destination
# enabled: true
# # use additionals to provide your custom virtualservice rules
# additionals: []
# - name: "default-nginx-routes"
# match:
# - uri:
# prefix: "/foo"
# rewrite:
# uri: /
# route:
# - destination:
# host: my.custom.backend.svc.cluster.local
# port:
# number: 80

# set to true and provide configuration details if you want to make external https calls through istio's virtualservice
serviceentry:
enabled: false
# hosts:
# a list of external hosts you want to be able to make https calls to
# - api.example.com

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}

# -- Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for Deployment pods
podDisruptionBudget: {}

# -- Set to existing PriorityClass name to control pod preemption by the scheduler
priorityClassName: ""

# -- Sets the [termination grace period](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution) for Deployment pods
terminationGracePeriodSeconds: 30

probes:
# -- Configure readiness probe
readiness:
initialDelaySeconds: 0
# -- Configure liveness probe
liveness:
initialDelaySeconds: 0
```
Loading