Review the New Project
Let's review some of the generated project files:
Pulumi.yamldefines the project.Pulumi.dev.yamlcontains configuration values for the stack we initialized.
index.tsis the Pulumi program that defines our stack resources. Let's examine it.
typescript
import * as k8s from "@pulumi/kubernetes";
const appLabels = { app: "nginx" };
const deployment = new k8s.apps.v1.Deployment("nginx", {
spec: {
selector: { matchLabels: appLabels },
replicas: 1,
template: {
metadata: { labels: appLabels },
spec: { containers: [{ name: "nginx", image: "nginx" }] }
}
}
});
export const name = deployment.metadata.name;This Pulumi program creates an NGINX deployment and exports the name of the deployment.
Next, we'll deploy the stack.