Viewing docs for Kubernetes v4.35.0
published on Tuesday, Nov 24, 2026 by Pulumi
published on Tuesday, Nov 24, 2026 by Pulumi
Kubernetes
I want to use the Pulumi Kubernetes package (kubernetes) in my project.
## Provider details
- Package: kubernetes
- Version: v4.35.0
- Publisher: Pulumi
- Source: pulumi
- Repository: https://github.com/pulumi/pulumi-kubernetes
## Documentation
The Pulumi Cloud Registry API serves canonical, up-to-date docs for this package — including private packages and every published version. Send the "Accept: text/markdown" header for clean readable content, or "application/json" for structured data.
Start at the navigation tree, which cross-links to the readme, installation guide, and per-resource docs URL template:
- https://api.pulumi.com/api/registry/packages/pulumi/pulumi/kubernetes/versions/latest/nav
Returns a summary by default. The full tree can be hundreds of kB for large providers, so prefer targeted search: append "?q=<query>&depth=full" to filter by resource/function title or token (for example "?q=bucket&depth=full"). Only request the full nav without a query if you actually need to enumerate every resource.
Other endpoints:
- Overview and getting started: https://api.pulumi.com/api/registry/packages/pulumi/pulumi/kubernetes/versions/latest/readme
- Installation and configuration: https://api.pulumi.com/api/registry/packages/pulumi/pulumi/kubernetes/versions/latest/installation
- Per-resource/function docs: https://api.pulumi.com/api/registry/packages/pulumi/pulumi/kubernetes/versions/latest/docs/{token}?lang={lang}
Replace {token} with the percent-encoded token from the nav response (for example aws:s3/bucket:Bucket).
Replace {lang} with typescript, python, go, csharp, java, yaml, or hcl.
Fetch the installation endpoint above for the correct setup steps — install instructions vary between native providers, bridged Terraform providers, and component packages.
Help me get started using this provider. Show me a complete Pulumi program that provisions a common resource, including all necessary configuration and imports.
Viewing docs for Kubernetes v4.35.0
published on Tuesday, Nov 24, 2026 by Pulumi
published on Tuesday, Nov 24, 2026 by Pulumi
The Kubernetes provider for Pulumi manages any resource in the Kubernetes API, including custom resources, in a cluster you already have. It also deploys Helm charts and YAML manifests as Pulumi resources.
The provider connects to your cluster with the same kubeconfig kubectl uses. See Installation & Configuration for setup and provider options.
Example
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;
import pulumi
from pulumi_kubernetes.apps.v1 import Deployment
app_labels = {"app": "nginx"}
deployment = Deployment(
"nginx",
spec={
"selector": {"match_labels": app_labels},
"replicas": 1,
"template": {
"metadata": {"labels": app_labels},
"spec": {"containers": [{"name": "nginx", "image": "nginx"}]},
},
},
)
pulumi.export("name", deployment.metadata["name"])
package main
import (
appsv1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/apps/v1"
corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
appLabels := pulumi.StringMap{
"app": pulumi.String("nginx"),
}
deployment, err := appsv1.NewDeployment(ctx, "nginx", &appsv1.DeploymentArgs{
Spec: appsv1.DeploymentSpecArgs{
Selector: &metav1.LabelSelectorArgs{
MatchLabels: appLabels,
},
Replicas: pulumi.Int(1),
Template: &corev1.PodTemplateSpecArgs{
Metadata: &metav1.ObjectMetaArgs{
Labels: appLabels,
},
Spec: &corev1.PodSpecArgs{
Containers: corev1.ContainerArray{
corev1.ContainerArgs{
Name: pulumi.String("nginx"),
Image: pulumi.String("nginx"),
},
},
},
},
},
})
if err != nil {
return err
}
ctx.Export("name", deployment.Metadata.Name())
return nil
})
}
using System.Collections.Generic;
using Pulumi;
using Pulumi.Kubernetes.Types.Inputs.Apps.V1;
using Pulumi.Kubernetes.Types.Inputs.Core.V1;
using Pulumi.Kubernetes.Types.Inputs.Meta.V1;
return await Deployment.RunAsync(() =>
{
var appLabels = new InputMap<string>
{
{ "app", "nginx" },
};
var deployment = new Pulumi.Kubernetes.Apps.V1.Deployment("nginx", new DeploymentArgs
{
Spec = new DeploymentSpecArgs
{
Selector = new LabelSelectorArgs
{
MatchLabels = appLabels,
},
Replicas = 1,
Template = new PodTemplateSpecArgs
{
Metadata = new ObjectMetaArgs
{
Labels = appLabels,
},
Spec = new PodSpecArgs
{
Containers =
{
new ContainerArgs
{
Name = "nginx",
Image = "nginx",
},
},
},
},
},
});
return new Dictionary<string, object?>
{
["name"] = deployment.Metadata.Apply(m => m.Name),
};
});
import com.pulumi.Pulumi;
import com.pulumi.kubernetes.apps.v1.Deployment;
import com.pulumi.kubernetes.apps.v1.DeploymentArgs;
import com.pulumi.kubernetes.apps.v1.inputs.DeploymentSpecArgs;
import com.pulumi.kubernetes.core.v1.inputs.ContainerArgs;
import com.pulumi.kubernetes.core.v1.inputs.PodSpecArgs;
import com.pulumi.kubernetes.core.v1.inputs.PodTemplateSpecArgs;
import com.pulumi.kubernetes.meta.v1.inputs.LabelSelectorArgs;
import com.pulumi.kubernetes.meta.v1.inputs.ObjectMetaArgs;
import java.util.Map;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var labels = Map.of("app", "nginx");
var deployment = new Deployment("nginx", DeploymentArgs.builder()
.spec(DeploymentSpecArgs.builder()
.selector(LabelSelectorArgs.builder()
.matchLabels(labels)
.build())
.replicas(1)
.template(PodTemplateSpecArgs.builder()
.metadata(ObjectMetaArgs.builder()
.labels(labels)
.build())
.spec(PodSpecArgs.builder()
.containers(ContainerArgs.builder()
.name("nginx")
.image("nginx")
.build())
.build())
.build())
.build())
.build());
ctx.export("name", deployment.metadata().applyValue(m -> m.name().orElse("")));
});
}
}
variables:
appLabels:
app: nginx
resources:
nginx:
type: kubernetes:apps/v1:Deployment
properties:
spec:
selector:
matchLabels: ${appLabels}
replicas: 1
template:
metadata:
labels: ${appLabels}
spec:
containers:
- name: nginx
image: nginx
outputs:
name: ${nginx.metadata.name}
terraform {
required_providers {
kubernetes = {
source = "pulumi/kubernetes"
version = "4.34.3"
}
}
}
locals {
labels = { app = "nginx" }
}
resource "kubernetes_apps_v1_deployment" "nginx" {
spec = {
selector = { match_labels = local.labels }
replicas = 1
template = {
metadata = { labels = local.labels }
spec = {
containers = [{
name = "nginx"
image = "nginx"
}]
}
}
}
}
output "name" {
value = kubernetes_apps_v1_deployment.nginx.metadata.name
}
Create a cluster
The Kubernetes provider deploys to a running cluster. To create one with Pulumi, use your cloud’s package:
- Amazon EKS creates an EKS cluster and the AWS resources it needs in a single component.
- AWS, Azure Native, Google Cloud, and DigitalOcean provide the lower-level resources for EKS, AKS, GKE, and DigitalOcean Kubernetes.
The Kubernetes templates start a new project that creates a managed cluster on AWS, Azure, or Google Cloud. To deploy workloads to a cluster from the program that creates it, pass the cluster’s kubeconfig to an explicit provider.
Learn more
- Pulumi and Kubernetes lists everything Pulumi offers for Kubernetes, including ESC integrations and policy packs.
- Dev Center tutorials walk through complete scenarios, such as deploying Helm charts and managing resources with Server-Side Apply.
- The Pulumi Kubernetes Operator runs Pulumi stacks from inside a cluster, driven by
Stackcustom resources. - Migrating from Kubernetes YAML shows how to bring existing manifests and Helm charts into Pulumi.
Viewing docs for Kubernetes v4.35.0
published on Tuesday, Nov 24, 2026 by Pulumi
published on Tuesday, Nov 24, 2026 by Pulumi