Skip to content

Instantly share code, notes, and snippets.

@ankyit
Created March 11, 2020 08:56
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 ankyit/61786a3b6ebcd3081e6df21a3b04b3ae to your computer and use it in GitHub Desktop.
Save ankyit/61786a3b6ebcd3081e6df21a3b04b3ae to your computer and use it in GitHub Desktop.
Pulumi - Kubernetes
import * as k8s from "@pulumi/kubernetes";
import * as kx from "@pulumi/kubernetesx";
const clusterSvcsNamespace = new k8s.core.v1.Namespace("pulumi",undefined, undefined)
export const clusterSvcsNamespaceName = clusterSvcsNamespace.metadata.name;
const appLabels = { app: "nginx" };
const deployment = new k8s.apps.v1.Deployment("nginx", {
metadata: {namespace: clusterSvcsNamespaceName},
spec: {
selector: { matchLabels: appLabels },
replicas: 1,
template: {
metadata: { labels: appLabels },
spec: { containers: [{ name: "nginx", image: "nginx" }] }
}
}
});
export const name = deployment.metadata.name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment