From 8de5568b2840a2fb7f44bed0bbe1b49d361fccce Mon Sep 17 00:00:00 2001 From: iamvigneshwars Date: Thu, 14 Mar 2024 15:03:41 +0000 Subject: [PATCH 1/3] Apollo router - Initial setup --- charts/data-gateway/Chart.lock | 7 +++++-- charts/data-gateway/Chart.yaml | 6 +++++- charts/data-gateway/values.yaml | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/charts/data-gateway/Chart.lock b/charts/data-gateway/Chart.lock index 0698753..330acca 100644 --- a/charts/data-gateway/Chart.lock +++ b/charts/data-gateway/Chart.lock @@ -8,5 +8,8 @@ dependencies: - name: opentelemetry-collector repository: https://open-telemetry.github.io/opentelemetry-helm-charts version: 0.83.0 -digest: sha256:c64dbb83ab863fb6f4c83dd8fc4505508072fda7b83f3ae1d1ac96af4b3b0c5f -generated: "2024-03-14T11:22:20.559143777Z" +- name: router + repository: oci://ghcr.io/apollographql/helm-charts + version: 1.41.1 +digest: sha256:c33267c54daddb2c5ce7934886e0c734a1c2a04eb1c4360e8be0aacc191120c6 +generated: "2024-03-14T15:16:23.516231741Z" diff --git a/charts/data-gateway/Chart.yaml b/charts/data-gateway/Chart.yaml index 55c9c16..70d972b 100644 --- a/charts/data-gateway/Chart.yaml +++ b/charts/data-gateway/Chart.yaml @@ -3,7 +3,7 @@ name: data-gateway description: A GraphQL router deployment forming the Diamond Data Gateway type: application -version: 0.2.0 +version: 0.3.0 dependencies: - name: prometheus @@ -18,3 +18,7 @@ dependencies: repository: https://open-telemetry.github.io/opentelemetry-helm-charts version: 0.83.0 condition: opentelemetry-collector.enabled + - name: router + repository: oci://ghcr.io/apollographql/helm-charts + version: 1.41.1 + condition: apollo-router.enabled diff --git a/charts/data-gateway/values.yaml b/charts/data-gateway/values.yaml index 88f10eb..9375717 100644 --- a/charts/data-gateway/values.yaml +++ b/charts/data-gateway/values.yaml @@ -205,3 +205,25 @@ opentelemetry-collector: - batch exporters: - otlp/jaeger +router: + enabled: true + managedFederation: + graphRef: data-gateway@current + ingress: + enabled: true + hosts: + - host: data-gateway.diamond.ac.uk + paths: + - path: / + pathType: Prefix + router: + args: + - --hot-reload + - --dev + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 1 + memory: 128Mi From 2ca939ac1902a83441b3cee53404c2520d9c95bb Mon Sep 17 00:00:00 2001 From: iamvigneshwars Date: Thu, 14 Mar 2024 16:59:36 +0000 Subject: [PATCH 2/3] Setup api secrets and metrics --- charts/data-gateway/Chart.lock | 4 ++-- .../templates/graph-apikey-secret.yaml | 15 ++++++++++++ charts/data-gateway/values.yaml | 24 ++++++++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 charts/data-gateway/templates/graph-apikey-secret.yaml diff --git a/charts/data-gateway/Chart.lock b/charts/data-gateway/Chart.lock index 330acca..bdb3496 100644 --- a/charts/data-gateway/Chart.lock +++ b/charts/data-gateway/Chart.lock @@ -11,5 +11,5 @@ dependencies: - name: router repository: oci://ghcr.io/apollographql/helm-charts version: 1.41.1 -digest: sha256:c33267c54daddb2c5ce7934886e0c734a1c2a04eb1c4360e8be0aacc191120c6 -generated: "2024-03-14T15:16:23.516231741Z" +digest: sha256:05955c12f807a3dea366a4d9422c0a769e9c0ea8e35135c866f5a68335b62950 +generated: "2024-03-15T09:58:08.939820307Z" diff --git a/charts/data-gateway/templates/graph-apikey-secret.yaml b/charts/data-gateway/templates/graph-apikey-secret.yaml new file mode 100644 index 0000000..be41eba --- /dev/null +++ b/charts/data-gateway/templates/graph-apikey-secret.yaml @@ -0,0 +1,15 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + creationTimestamp: null + name: router-apikey + namespace: data-gateway +spec: + encryptedData: + managedFederationApiKey: AgAFF9OYxROjOaslDdnA+TUs+EWiXbAmAoqj3fZrqqqfFHu64LJIHs8UtF2WDfmh9GpU0kNaPo86xDO8hPPIyIEtlcvkmMIdzgt9AUhN9JsqpLqDXJZau9Oe91Y1R63sOIIZH2c3rFYzUhbmWeM32AYtWuxlLTZvjYI08l3Y5rY6vBcFhgO2mnLuHW0ajKPh/DTz3tEr7my3wQmG9cjrLzqITSWot04rMOjfj9Ky4t6RAxvReZx6u1oBlstHNfjzr2dWTsTyvBQhi1+hx7UlkqDwON1YbPkcXiqsRXpAzTrp7a0HyZbSlxrfsrguygzzCm3algIG1iu8OSc/M0YUEvZA37kc4USMh/LaUOSUgn5RbLtUdRpwMbTAc/hIQJpxW0aGYXKjEgZ0MSYYLWyAfyt/rcWaB0kjDWzJwAYNzsW1OBYA4G525xAUoWXm00CAwXLCdPn9tr1Fdj+1l7jypnbIq0wXcdlUJWcq+ec+ZJIxIQbVP2PY80eVCLuP9dw3llmyxotjlbHhnKipEFfJlifLCZErJMLsn7NBx8rol0dmcl8jczMvS4favxoxhzwXbeAydXtkQDQcygpHGMzYJ7lOWQ6igGLHxNNhYGMtVndC5/xv44to1rrXMp6pZVBbrtoL3TO9i5HZcqehNBNSNDB6103Siw0ZviR1BG6GOBDV7MZ2Lps0MthSEIq8pVGGQ2Z83RgBjZ7zjsovMgRPUc8d3+Kkb01q28GrBwPQvQ4/1IINe2BTgxGEY+jFCihUnwjA9w== + template: + metadata: + creationTimestamp: null + name: router-apikey + namespace: data-gateway + diff --git a/charts/data-gateway/values.yaml b/charts/data-gateway/values.yaml index 9375717..308b9ac 100644 --- a/charts/data-gateway/values.yaml +++ b/charts/data-gateway/values.yaml @@ -208,7 +208,8 @@ opentelemetry-collector: router: enabled: true managedFederation: - graphRef: data-gateway@current + existingSecret: router-apikey + graphRef: data-gateway-n63jcf@current ingress: enabled: true hosts: @@ -218,8 +219,25 @@ router: pathType: Prefix router: args: - - --hot-reload - - --dev + - --hot-reload + - --dev + configuration: + telemetry: + instrumentation: + spans: + mode: spec_compliant + exporters: + metrics: + otlp: + enabled: true + endpoint: '{{ .Release.Name }}-opentelemetry-collector:4317' + protocol: grpc + tracing: + otlp: + enabled: true + endpoint: '{{ .Release.Name }}-opentelemetry-collector:4317' + protocol: grpc + resources: requests: cpu: 100m From 8371bc196da68b7c34c58f5f811261057754e23e Mon Sep 17 00:00:00 2001 From: iamvigneshwars Date: Mon, 18 Mar 2024 15:19:56 +0000 Subject: [PATCH 3/3] Update router configuration --- .../data-gateway/templates/router-config.yaml | 7 +++ charts/data-gateway/values.yaml | 53 ++++++++++++------- 2 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 charts/data-gateway/templates/router-config.yaml diff --git a/charts/data-gateway/templates/router-config.yaml b/charts/data-gateway/templates/router-config.yaml new file mode 100644 index 0000000..18fb48d --- /dev/null +++ b/charts/data-gateway/templates/router-config.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: router-configuration +data: + configuration.yaml: | + {{- tpl (.Values.router.myconfiguration | toYaml) . | nindent 4 }} diff --git a/charts/data-gateway/values.yaml b/charts/data-gateway/values.yaml index 308b9ac..f4b82a0 100644 --- a/charts/data-gateway/values.yaml +++ b/charts/data-gateway/values.yaml @@ -205,6 +205,7 @@ opentelemetry-collector: - batch exporters: - otlp/jaeger + router: enabled: true managedFederation: @@ -217,27 +218,39 @@ router: paths: - path: / pathType: Prefix - router: - args: + extraVolumes: + - name: router-configuration + configMap: + name: router-configuration + args: - --hot-reload - - --dev - configuration: - telemetry: - instrumentation: - spans: - mode: spec_compliant - exporters: - metrics: - otlp: - enabled: true - endpoint: '{{ .Release.Name }}-opentelemetry-collector:4317' - protocol: grpc - tracing: - otlp: - enabled: true - endpoint: '{{ .Release.Name }}-opentelemetry-collector:4317' - protocol: grpc - + configuration: {} + myconfiguration: + supergraph: + listen: 0.0.0.0:4000 + health_check: + listen: 0.0.0.0:8088 + telemetry: + instrumentation: + spans: + mode: spec_compliant + exporters: + metrics: + common: + resource: + "service.name": "router" + otlp: + enabled: true + endpoint: '{{ .Release.Name }}-opentelemetry-collector:4317' + protocol: grpc + tracing: + common: + resource: + "service.name": "router" + otlp: + enabled: true + endpoint: '{{ .Release.Name }}-opentelemetry-collector:4317' + protocol: grpc resources: requests: cpu: 100m