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.
yaml¶
pulumi_kubernetes.yaml.copy(x)¶Shallow copy operation on arbitrary Python objects.
See the module’s doc string for more info.
pulumi_kubernetes.yaml.getargspec(func)¶Get the names and default values of a function’s parameters.
A tuple of four things is returned: (args, varargs, keywords, defaults). ‘args’ is a list of the argument names, including keyword-only argument names. ‘varargs’ and ‘keywords’ are the names of the * and ** parameters or None. ‘defaults’ is an n-tuple of the default values of the last n parameters.
This function is deprecated, as it does not support annotations or keyword-only parameters and will raise ValueError if either is present on the supplied callable.
For a more structured introspection API, use inspect.signature() instead.
Alternatively, use getfullargspec() for an API with a similar namedtuple based interface, but full support for annotations and keyword-only parameters.
- class
pulumi_kubernetes.yaml.CustomResource(resource_name, api_version, kind, spec=None, metadata=None, opts=None, __name__=None, __opts__=None)¶ CustomResource represents an instance of a CustomResourceDefinition (CRD). For example, the CoreOS Prometheus operator exposes a CRD
monitoring.coreos.com/ServiceMonitor; to instantiate this as a Pulumi resource, one could callnew CustomResource, passing theServiceMonitorresource definition as an argument.- Parameters
resource_name (str) – Unique name used to register this resource with Pulumi.
api_version (str) – The API version of the apiExtensions.CustomResource we wish to select, as specified by the CustomResourceDefinition that defines it on the API server.
kind (str) – The kind of the apiextensions.CustomResource we wish to select, as specified by the CustomResourceDefinition that defines it on the API server.
spec (pulumi.Input[Any]) – Specification of the CustomResource.
metadata (Optional[pulumi.Input[Any]]) – Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
opts (Optional[pulumi.ResourceOptions]) – A bag of options that control this resource’s behavior.
- static
get(resource_name, api_version, kind, id, opts=None)¶ Get the state of an existing
CustomResourceresource, as identified byid. Typically this ID is of the form [namespace]/[name]; if [namespace] is omitted, then (per Kubernetes convention) the ID becomes default/[name].Pulumi will keep track of this resource using
resource_nameas the Pulumi ID.- Parameters
resource_name (str) – Unique name used to register this resource with Pulumi.
api_version (str) – The API version of the apiExtensions.CustomResource we wish to select, as specified by the CustomResourceDefinition that defines it on the API server.
kind (str) – The kind of the apiextensions.CustomResource we wish to select, as specified by the CustomResourceDefinition that defines it on the API server.
id (pulumi.Input[str]) – An ID for the Kubernetes resource to retrieve. Takes the form
/ or . opts (Optional[pulumi.ResourceOptions]) – A bag of options that control this resource’s behavior.
translate_output_property(prop: str) → str¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop: str) → str¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
pulumi_kubernetes.yaml.get_version()¶Returns the Semver-formatted version of the package containing this file.
- class
pulumi_kubernetes.yaml.ConfigFile(name, file_id, opts=None, transformations=None, resource_prefix=None)¶ ConfigFile creates a set of Kubernetes resources from a Kubernetes YAML file.
- Parameters
name (str) – A name for a resource.
file_id (str) – Path or a URL that uniquely identifies a file.
opts (Optional[pulumi.ResourceOptions]) – A bag of optional settings that control a resource’s behavior.
Optional[pulumi.ResourceOptions]]]] transformations (Optional[List[Tuple[Callable,) – A set of transformations to apply to Kubernetes resource definitions before registering with engine.
resource_prefix (Optional[str]) – An optional prefix for the auto-generated resource names. Example: A resource created with resource_prefix=”foo” would produce a resource named “foo-resourceName”.
resources: pulumi.Output[dict] = None¶Kubernetes resources contained in this ConfigFile.
translate_output_property(prop: str) → str¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop: str) → str¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
get_resource(group_version_kind, name, namespace=None) → pulumi.output.Output[pulumi.resource.CustomResource][pulumi.resource.CustomResource]¶get_resource returns a resource defined by a built-in Kubernetes group/version/kind and name. For example:
get_resource("apps/v1/Deployment", "nginx")- Parameters
group_version_kind (str) – Group/Version/Kind of the resource, e.g.,
apps/v1/Deploymentname (str) – Name of the resource to retrieve
namespace (str) – Optional namespace of the resource to retrieve