Package @pulumi/kubernetes
This page documents the language specification for the kubernetes package. If you're looking for help working with the inputs, outputs, or functions of kubernetes resources in a Pulumi program, please see the resource documentation for examples and API reference.
The Kubernetes provider package offers support for all Kubernetes resources and their properties. Resources are exposed as types from modules based on Kubernetes API groups such as ‘apps’, ‘core’, ‘rbac’, and ‘storage’, among many others. Additionally, support for deploying Helm charts (‘helm’) and YAML files (‘yaml’) is available in this package. Using this package allows you to programmatically declare instances of any Kubernetes resources and any supported resource version using infrastructure as code, which Pulumi then uses to drive the Kubernetes API.
If this is your first time using this package, these two resources may be helpful:
- Kubernetes Getting Started Guide: Get up and running quickly.
- Kubernetes Pulumi Setup Documentation: How to configure Pulumi for use with your Kubernetes cluster.
Use the navigation below to see detailed documentation for each of the supported Kubernetes resources.
var kubernetes = require("@pulumi/kubernetes");
import * as kubernetes from "@pulumi/kubernetes";Modules
- admissionregistration
- apiextensions
- apiregistration
- apps
- auditregistration
- authentication
- authorization
- autoscaling
- batch
- certificates
- coordination
- core
- discovery
- events
- extensions
- flowcontrol
- helm
- meta
- networking
- node
- policy
- rbac
- scheduling
- settings
- storage
- types
- yaml
Resources
Others
Resources
Resource Provider
class Provider extends ProviderResourceThe provider type for the kubernetes package.
constructor
new Provider(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions)Create a Provider resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is ProviderReturns true if the given object is an instance of Provider. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
method register
static register(provider: ProviderResource | undefined): Promise<string | undefined>property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Others
function getEnv
getEnv(vars: string[]): string | undefinedfunction getEnvBoolean
getEnvBoolean(vars: string[]): boolean | undefinedfunction getEnvNumber
getEnvNumber(vars: string[]): number | undefinedfunction getVersion
getVersion(): stringinterface ProviderArgs
interface ProviderArgsThe set of arguments for constructing a Provider resource.
property cluster
cluster?: pulumi.Input<string>;If present, the name of the kubeconfig cluster to use.
property context
context?: pulumi.Input<string>;If present, the name of the kubeconfig context to use.
property enableDryRun
enableDryRun?: pulumi.Input<boolean>;BETA FEATURE - If present and set to true, enable server-side diff calculations. This feature is in developer preview, and is disabled by default.
This config can be specified in the following ways, using this precedence:
1. This enableDryRun parameter.
2. The PULUMI_K8S_ENABLE_DRY_RUN environment variable.
property kubeconfig
kubeconfig?: pulumi.Input<string>;The contents of a kubeconfig file. If this is set, this config will be used instead of $KUBECONFIG.
property namespace
namespace?: pulumi.Input<string>;If present, the default namespace to use. This flag is ignored for cluster-scoped resources.
A namespace can be specified in multiple places, and the precedence is as follows:
1. .metadata.namespace set on the resource.
2. This namespace parameter.
3. namespace set for the active context in the kubeconfig.
property renderYamlToDirectory
renderYamlToDirectory?: pulumi.Input<string>;BETA FEATURE - If present, render resource manifests to this directory. In this mode, resources will not be created on a Kubernetes cluster, but the rendered manifests will be kept in sync with changes to the Pulumi program. This feature is in developer preview, and is disabled by default.
Note that some computed Outputs such as status fields will not be populated since the resources are not created on a Kubernetes cluster. These Output values will remain undefined, and may result in an error if they are referenced by other resources. Also note that any secret values used in these resources will be rendered in plaintext to the resulting YAML.
property suppressDeprecationWarnings
suppressDeprecationWarnings?: pulumi.Input<boolean>;If present and set to true, suppress apiVersion deprecation warnings from the CLI.
This config can be specified in the following ways, using this precedence:
1. This suppressDeprecationWarnings parameter.
2. The PULUMI_K8S_SUPPRESS_DEPRECATION_WARNINGS environment variable.