diff --git a/internal/services/backstage/packages/backend/src/index.ts b/internal/services/backstage/packages/backend/src/index.ts index aa4ddacdd20..15567e9b735 100644 --- a/internal/services/backstage/packages/backend/src/index.ts +++ b/internal/services/backstage/packages/backend/src/index.ts @@ -29,6 +29,7 @@ import proxy from './plugins/proxy'; import techdocs from './plugins/techdocs'; import search from './plugins/search'; import kubernetes from './plugins/kubernetes'; +import healthcheck from './plugins/healthcheck'; import todo from './plugins/todo'; import { PluginEnvironment } from './types'; import { ServerPermissionClient } from '@backstage/plugin-permission-node'; @@ -80,6 +81,7 @@ async function main() { }); const createEnv = makeCreateEnv(config); + const healthcheckEnv = useHotMemoize(module, () => createEnv('healthcheck')); const catalogEnv = useHotMemoize(module, () => createEnv('catalog')); const scaffolderEnv = useHotMemoize(module, () => createEnv('scaffolder')); const authEnv = useHotMemoize(module, () => createEnv('auth')); @@ -105,6 +107,7 @@ async function main() { const service = createServiceBuilder(module) .loadConfig(config) + .addRouter('', await healthcheck(healthcheckEnv)) .addRouter('/api', apiRouter) .addRouter('', await app(appEnv)); diff --git a/internal/services/backstage/packages/backend/src/plugins/healthcheck.ts b/internal/services/backstage/packages/backend/src/plugins/healthcheck.ts new file mode 100644 index 00000000000..3dd9a678275 --- /dev/null +++ b/internal/services/backstage/packages/backend/src/plugins/healthcheck.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { createStatusCheckRouter } from '@backstage/backend-common'; +import { PluginEnvironment } from '../types'; + +export default async function createRouter({ logger }: PluginEnvironment) { + return await createStatusCheckRouter({ logger, path: '/healthcheck' }); +} diff --git a/ops/Helm/backstage/values.yaml b/ops/Helm/backstage/values.yaml index eed96f902fe..db34fdd1b3c 100644 --- a/ops/Helm/backstage/values.yaml +++ b/ops/Helm/backstage/values.yaml @@ -77,7 +77,7 @@ deploy: image: repository: registry.gitlab.com/shortlink-org/shortlink/backstage - tag: 0.14.5 + tag: 0.14.5.1 # -- Global imagePullPolicy # Default: 'Always' if image tag is 'latest', else 'IfNotPresent' # Ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -89,7 +89,7 @@ deploy: initialDelaySeconds: 15 timeoutSeconds: 15 httpGet: - path: /backstage + path: /healthcheck port: 7007 # -- define a readiness probe that checks every 5 seconds, starting after 5 seconds @@ -97,7 +97,7 @@ deploy: initialDelaySeconds: 15 timeoutSeconds: 15 httpGet: - path: /backstage + path: /healthcheck port: 7007 securityContext: