diff --git a/.changesets/feat_helm_existingsecretkeyrefkey.md b/.changesets/feat_helm_existingsecretkeyrefkey.md new file mode 100644 index 0000000000..fb7f979568 --- /dev/null +++ b/.changesets/feat_helm_existingsecretkeyrefkey.md @@ -0,0 +1,9 @@ +### Provide support to control of the key name used to retrieve the secret used for APOLLO_KEY ([Issue #5661](https://github.com/apollographql/router/issues/5661)) + +The Router Helm chart currently is hardcoded to use managedFederationApiKey as the key name to use to retrieve the value +out of the referenced secretkey. Some kubernetes customers require the use of a secretStore / externalSecret, +and may be required to use a specific key name when obtaining secrets from these sources. + +This change provides the user the ability to control the name of the key to use in retrieving that value. + +By [Jon Christiansen](https://github.com/theJC) in https://github.com/apollographql/router/pull/5662 diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index 6a09cf521b..e21fff823e 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -76,7 +76,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "router.managedFederation.apiSecretName" . }} - key: managedFederationApiKey + key: {{ (.Values.managedFederation.existingSecretKeyRefKey | default "managedFederationApiKey") }} optional: true {{- end }} {{- if not (empty .Values.managedFederation.graphRef) }} diff --git a/helm/chart/router/templates/secret.yaml b/helm/chart/router/templates/secret.yaml index a5a921f716..70e1b44a1b 100644 --- a/helm/chart/router/templates/secret.yaml +++ b/helm/chart/router/templates/secret.yaml @@ -9,5 +9,5 @@ metadata: {{- include "apollographql.templatizeExtraLabels" . | trim | nindent 4 }} {{- end }} data: - managedFederationApiKey: {{ default "MISSING" .Values.managedFederation.apiKey | b64enc | quote }} + {{ (.Values.managedFederation.existingSecretKeyRefKey | default "managedFederationApiKey") }}: {{ default "MISSING" .Values.managedFederation.apiKey | b64enc | quote }} {{- end }} diff --git a/helm/chart/router/values.yaml b/helm/chart/router/values.yaml index 3e67a224f1..b90f46dc66 100644 --- a/helm/chart/router/values.yaml +++ b/helm/chart/router/values.yaml @@ -21,6 +21,9 @@ managedFederation: # -- If using managed federation, use existing Secret which stores the graph API key instead of creating a new one. # 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 name of the key within the existing Secret which stores the graph API key. + # If set along `managedFederation.apiKey`, a secret with the graph API key will be created using this parameter as key, defaults to using a key of `managedFederationApiKey` + existingSecretKeyRefKey: # -- If using managed federation, the variant of which graph to use graphRef: ""