console/deployment/services/docs.ts
2022-12-28 20:22:54 +01:00

34 lines
766 B
TypeScript

import * as k8s from '@pulumi/kubernetes';
import { ServiceDeployment } from '../utils/service-deployment';
export type Docs = ReturnType<typeof deployDocs>;
export function deployDocs({
release,
image,
rootDns,
imagePullSecret,
}: {
release: string;
image: string;
rootDns: string;
imagePullSecret: k8s.core.v1.Secret;
}) {
const deployment = new ServiceDeployment('docs', {
image,
imagePullSecret,
readinessProbe: '/api/health',
livenessProbe: '/api/health',
env: [
{ name: 'RELEASE', value: release },
{ name: 'DEPLOYED_DNS', value: rootDns },
{ name: 'NODE_ENV', value: 'production' },
],
port: 3000,
}).deploy();
return {
...deployment,
endpoint: `https://docs.${rootDns}/`,
};
}