{"id":5380,"library":"pulumi-kubernetes","title":"Pulumi Kubernetes Provider","description":"pulumi-kubernetes is a Pulumi package for creating and managing Kubernetes resources using Python, allowing Infrastructure as Code deployments. It is currently at version 4.28.0 and follows a regular release cadence, often aligning with new Kubernetes API versions and Pulumi core updates.","status":"active","version":"4.28.0","language":"en","source_language":"en","source_url":"https://github.com/pulumi/pulumi-kubernetes","tags":["pulumi","kubernetes","iac","cloud","infrastructure-as-code","orchestration"],"install":[{"cmd":"pip install pulumi-kubernetes","lang":"bash","label":"Install Pulumi Kubernetes"}],"dependencies":[{"reason":"The core Pulumi SDK is required to define and deploy resources.","package":"pulumi"}],"imports":[{"symbol":"Provider","correct":"from pulumi_kubernetes import Provider"},{"symbol":"Deployment","correct":"from pulumi_kubernetes.apps.v1 import Deployment"},{"symbol":"Namespace","correct":"from pulumi_kubernetes.core.v1 import Namespace"},{"symbol":"Service","correct":"from pulumi_kubernetes.core.v1 import Service"},{"symbol":"Chart","correct":"from pulumi_kubernetes.helm.v3 import Chart"},{"symbol":"Resource","correct":"from pulumi_kubernetes.yaml import ConfigFile, ConfigGroup"}],"quickstart":{"code":"import pulumi\nimport pulumi_kubernetes as kubernetes\n\n# Create a Kubernetes Namespace\nmy_namespace = kubernetes.core.v1.Namespace(\n    \"my-namespace\",\n    metadata={\n        \"name\": \"test-ns-from-pulumi\",\n        \"labels\": {\"environment\": \"dev\"}\n    }\n)\n\n# Export the name of the namespace\npulumi.export(\"namespace_name\", my_namespace.metadata[\"name\"])\n\n# To run: \n# 1. Ensure KUBECONFIG is set or your ~/.kube/config is configured.\n# 2. pulumi new python --dir my-k8s-project\n# 3. cd my-k8s-project\n# 4. pip install pulumi-kubernetes\n# 5. Replace __main__.py content with this code.\n# 6. pulumi up","lang":"python","description":"This quickstart demonstrates how to create a basic Kubernetes Namespace resource using the Pulumi Kubernetes provider. It sets up a new namespace and exports its name. Ensure your kubeconfig is correctly set up for Pulumi to access your Kubernetes cluster."},"warnings":[{"fix":"Review existing `pulumi.com/waitFor` annotations and update JSONPath expressions to be RFC9535 compliant, especially for complex conditions.","message":"The `pulumi.com/waitFor` annotation's JSONPath parser was updated to an RFC9535-compliant standard in v4.24.0. Users relying on specific, non-compliant JSONPath expressions for resource waiting might experience changes in behavior or failures.","severity":"breaking","affected_versions":">=4.24.0"},{"fix":"Be aware of the `alwaysRender` option's implications when rendering YAML. Use it only when idempotent generation and showing diffs on every update is explicitly desired. For most cases, rely on Pulumi's default diffing.","message":"Enabling both `alwaysRender` and `renderYAMLtoDirectory` in the provider configuration (v4.26.0) can lead to every `pulumi up` showing diffs for YAML manifests, even if the underlying resources haven't logically changed. This opt-in behavior can increase noise during updates.","severity":"gotcha","affected_versions":">=4.26.0"},{"fix":"Regularly check the Pulumi Kubernetes documentation for API changes and deprecations. Test upgrades in a staging environment before deploying to production. Pin provider version if strict schema stability is required.","message":"The provider frequently updates its underlying Kubernetes schemas and client libraries (e.g., to v1.33.0 in v4.23.0). This can introduce changes in resource specifications, deprecations of older API versions, or new required fields. Ensure your resource definitions are compatible with the target Kubernetes API server version.","severity":"gotcha","affected_versions":"All versions, especially with major K8s schema updates"},{"fix":"Upgrade to the latest provider version to benefit from race condition fixes. If experiencing issues with resource readiness or deletion, verify the provider version and consult release notes for relevant fixes.","message":"The provider has addressed multiple race conditions related to resource awaiting and deletion (e.g., StatefulSet rollout, Deleted condition in v4.26.0, v4.22.1, v4.22.0). This indicates that resource readiness and cleanup might behave unexpectedly or be unreliable in older versions, potentially leading to 'stuck' updates or resources.","severity":"gotcha","affected_versions":"<4.26.0"},{"fix":"Always refer to the official Pulumi Kubernetes API documentation for the exact behavior and accepted values of Helm chart parameters. Ensure provider version is updated to resolve known issues.","message":"Helm resource fields, such as `valueYamlFiles` (fixed in v4.22.2 for panic on nil) or `plainHttp` (added in v4.24.0 to `v4.Chart`), can have specific behaviors or edge cases. Misconfiguration or reliance on older versions might lead to unexpected errors or deployment failures.","severity":"gotcha","affected_versions":"<4.24.0 for `plainHttp`, <4.22.2 for `valueYamlFiles` panic"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}