Created
March 11, 2020 08:56
-
-
Save ankyit/61786a3b6ebcd3081e6df21a3b04b3ae to your computer and use it in GitHub Desktop.
Pulumi - Kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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