feat: adding extra apollo studio env vars to helm chart (#830)
* feat: adding extra apollo studio env vars to helm chart * made apollo read version from SPECKLE_SERVER_VERSION * moved from graph_ref to graph_id * changing up some values
This commit is contained in:
committed by
GitHub
parent
da9224a069
commit
86c63c29db
Vendored
+10
-1
@@ -9,7 +9,16 @@ const appRoot = __dirname
|
||||
|
||||
// Initializing env vars
|
||||
const dotenv = require('dotenv')
|
||||
const { isTestEnv } = require('./modules/core/helpers/envHelper')
|
||||
const {
|
||||
isTestEnv,
|
||||
isApolloMonitoringEnabled,
|
||||
getApolloServerVersion,
|
||||
getServerVersion
|
||||
} = require('./modules/core/helpers/envHelper')
|
||||
|
||||
if (isApolloMonitoringEnabled() && !getApolloServerVersion()) {
|
||||
process.env.APOLLO_SERVER_USER_VERSION = getServerVersion()
|
||||
}
|
||||
|
||||
// If running in test env, load .env.test first
|
||||
// (appRoot necessary, cause env files aren't loaded through require() calls)
|
||||
|
||||
@@ -10,4 +10,23 @@ function isProdEnv() {
|
||||
return process.env.NODE_ENV === 'production'
|
||||
}
|
||||
|
||||
module.exports = { isTestEnv, isDevEnv, isProdEnv }
|
||||
function getServerVersion() {
|
||||
return process.env.SPECKLE_SERVER_VERSION || 'dev'
|
||||
}
|
||||
|
||||
function isApolloMonitoringEnabled() {
|
||||
return [true, 'true'].includes(process.env.APOLLO_SCHEMA_REPORTING)
|
||||
}
|
||||
|
||||
function getApolloServerVersion() {
|
||||
return process.env.APOLLO_SERVER_USER_VERSION
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isTestEnv,
|
||||
isDevEnv,
|
||||
isProdEnv,
|
||||
getServerVersion,
|
||||
isApolloMonitoringEnabled,
|
||||
getApolloServerVersion
|
||||
}
|
||||
|
||||
@@ -225,10 +225,20 @@ spec:
|
||||
|
||||
# Monitoring - Apollo
|
||||
{{- if .Values.server.monitoring.apollo.enabled }}
|
||||
- name: APOLLO_GRAPH_REF
|
||||
value: {{ .Values.server.monitoring.apollo.graph_ref }}
|
||||
- name: APOLLO_GRAPH_ID
|
||||
value: {{ .Values.server.monitoring.apollo.graph_id }}
|
||||
- name: APOLLO_SCHEMA_REPORTING
|
||||
value: "true"
|
||||
- name: APOLLO_GRAPH_VARIANT
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: APOLLO_SERVER_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: APOLLO_SERVER_PLATFORM
|
||||
value: "kubernetes/deployment"
|
||||
- name: APOLLO_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
||||
@@ -59,7 +59,7 @@ server:
|
||||
monitoring:
|
||||
apollo:
|
||||
enabled: false
|
||||
graph_ref: ''
|
||||
graph_id: ''
|
||||
# key: secret -> `apollo_key`
|
||||
|
||||
# Sentry specific:
|
||||
|
||||
Reference in New Issue
Block a user