fix probe api

This commit is contained in:
Nawaz Dhandala 2022-02-08 09:50:18 +00:00
parent 85a5e028d8
commit 94a057ab8a
6 changed files with 9 additions and 4 deletions

View File

@ -27,7 +27,7 @@ Expand the name of the chart.
{{ printf "http://%s-backend.%s.%s" $.Release.Name $.Release.Namespace "svc.cluster.local" }}
{{- end -}}
{{- define "oneuptime.fetchResourcesUrl" -}}
{{- define "oneuptime.probeApiUrl" -}}
{{ printf "http://%s-probe-api.%s.%s" $.Release.Name $.Release.Namespace "svc.cluster.local" }}
{{- end -}}

View File

@ -77,6 +77,8 @@ spec:
value: {{ $.Values.nodeEnv }}
- name: IS_TESTING
value: {{ $.Values.isTesting | quote }}
- name: DB_NAME
value: {{ $.Values.mongo.databaseName }}
ports:
- containerPort: {{ $.Values.host.fetchResourcesPort }}
hostPort: {{ $.Values.host.fetchResourcesPort }}

View File

@ -60,6 +60,8 @@ spec:
value: {{ $value.name }}
- name: PROBE_KEY
value: {{ $value.key }}
- name: PROBE_API_URL
value: {{ template "oneuptime.probeApiUrl" $ }}
{{- if $.Values.newRelic.probe.licenseKey }}
- name: NEW_RELIC_LICENSE_KEY
value: {{ $.Values.newRelic.probe.licenseKey }}

View File

@ -4,3 +4,4 @@ SLACK_ERROR_LOG_WEBHOOK=https://hooks.slack.com/services/T033XTX49/B01NA8QGYF3/6
SLACK_ERROR_LOG_CHANNEL=oneuptime-engineering
PORT=3400
REALTIME_URL=http://localhost:3300
DB_NAME=oneuptimedb

View File

@ -69,7 +69,7 @@ const client = getMongoClient();
})();
// attach the database to global object
global.db = client.db('oneuptimedb');
global.db = client.db(process.env.DB_NAME);
// Sentry: The request handler must be the first middleware on the app
app.use(Sentry.Handlers.requestHandler());

View File

@ -3,6 +3,6 @@ const packageJson = require('../package.json');
module.exports = {
clusterKey: process.env.CLUSTER_KEY,
fetchResourcesVersion: packageJson.version,
mongoUrl: process.env.MONGO_URL || 'mongodb://localhost:27017/oneuptimedb',
mongoUrl: process.env.MONGO_URL,
realtimeUrl: process.env['REALTIME_URL'],
};