Fork me on GitHub

Kubernetes

The Kubernetes provider for Pulumi can be used to provision any of the resources specified by the Kubernetes API (e.g., v1.10. The Kubernetes provider uses the official Kubernetes Go client under the hood, and will automatically configure itself if a kubeconfig file file is present.

See the full API documentation for complete details of the available Kubernetes provider APIs.

Note: The Pulumi provider currently supports Kubernetes 1.5+. If you have a specific version requirement and are unsure of whether we currently support it, or are certain we don’t and need us to begin doing so, please contact us.

Setup

By default, Pulumi uses the same configuration as kubectl, so if you’re already connected to a cluster, Pulumi will “just work.” For more details, including this initial setup, please see the Kubernetes setup page.

Tutorials

The easiest way to start with AWS is to follow one of the tutorials:

There are additional examples available complete with step-by-step instructions. If you are new to Pulumi, it may be easiest to look at them in this order:

Example

import * as k8s from "@pulumi/kubernetes";

// Create an nginx pod
let nginxcontainer = new k8s.core.v1.Pod("nginx", {
    spec: {
        containers: [{
            image: "nginx:1.7.9", name: "nginx", ports: [{ containerPort: 80 }]
        }]
    }
});

You can find additional examples Kubernetes examples in the Pulumi examples repo.

Libraries

The following pacakges are available in pacakge managers:

  • JavaScript/TypeScript: https://www.npmjs.com/package/@pulumi/kubernetes

Support will eventually expand to Python and Go as well.