narrow-monitor-83965
10/30/2023, 7:48 PM├── Dockerfile
├── index.js
├── package.json
├── package-lock.json
├── pulumi
│ ├── index.js
│ ├── nginx
│ ├── node_modules
│ ├── package.json
│ ├── package-lock.json
│ ├── Pulumi.dev.yaml
│ └── Pulumi.yaml
└── scripts
├── pulumi-preview.sh
├── run-pulumi.sh
└── setup.sh
little-cartoon-10569
10/30/2023, 8:07 PMnarrow-monitor-83965
10/30/2023, 8:09 PMconst image = docker.getRegistryImage({
name: `simoncarr/sandpit-api:${pulumi.getStack()}`,
})
const deployment = new k8s.apps.v1.Deployment("sandpit-api", {
metadata: { name: "sandpit-api", namespace: "sandpit"},
spec: {
selector: { matchLabels: { app: "sandpit-api" } },
replicas: 2,
template: {
metadata: { labels:
{
app: "sandpit-api",
imgid: image.then(image => image.sha256Digest.split(":")[1].substring(0,12))
}
},
spec: {
containers: [{
name: "sandpit-api",
image: `simoncarr/sandpit-api:${pulumi.getStack()}`,
imagePullPolicy: "Always",
ports: [{ containerPort: 3000 }],
resources: { requests: { cpu: "100m", memory: "100Mi" } }
}]
}
}
}
}, {
dependsOn: [namespace]
})
salmon-account-74572
11/01/2023, 8:40 PM