Skip to content

Instantly share code, notes, and snippets.

@hadoan
Created June 16, 2020 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hadoan/540e282f918109b7610297b3cf567967 to your computer and use it in GitHub Desktop.
Save hadoan/540e282f918109b7610297b3cf567967 to your computer and use it in GitHub Desktop.
import * as k8s from "@pulumi/kubernetes";
import { DeploymentConsts } from "../../common/consts";
import * as pulumi from "@pulumi/pulumi";
export class ApiDeployment {
config = new pulumi.Config();
configMap = DeploymentConsts.TMDB_API;
New() {
return new k8s.apps.v1.Deployment(DeploymentConsts.TMDB_API + "-deployment", {
metadata: { name: DeploymentConsts.TMDB_API },
spec: {
selector: { matchLabels: { app: DeploymentConsts.TMDB_API } },
replicas: 1,
template: {
metadata: { labels: { app: DeploymentConsts.TMDB_API } },
spec: {
containers: [
{
name: DeploymentConsts.TMDB_API,
image: `${DeploymentConsts.DOCKER_HUB_BASE_URL}${DeploymentConsts.TMDB_API}:latest`,
args: [
"dotnet",
"TmdbMovies.HttpApi.Host.dll"
],
volumeMounts: [
{
name: this.configMap + "-volume",
mountPath: "/etc/config"
}
],
imagePullPolicy: "Always"
}
],
volumes: [
{
name: this.configMap + "-volume",
configMap: { name: this.configMap }
}
]
}
}
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment