v2

package
v4.18.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 66 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsListKind

func IsListKind(apiVersion, kind string) bool

func RegisterResource

func RegisterResource(ctx *pulumi.Context, apiVersion, kind, name string, props pulumi.Input,
	opts ...pulumi.ResourceOption) (pulumi.CustomResource, error)

Types

type ConfigFile

type ConfigFile struct {
	pulumi.ResourceState

	// Resources created by the ConfigFile.
	Resources pulumi.ArrayOutput `pulumi:"resources"`
}

ConfigFile creates a set of Kubernetes resources from a remote or on-disk Kubernetes YAML file. (If you have in-memory YAML a ConfigGroup may be more appropriate.)

## Dependency ordering Sometimes resources must be applied in a specific order. For example, a namespace resource must be created before any namespaced resources, or a Custom Resource Definition (CRD) must be pre-installed.

Pulumi uses heuristics to determine which order to apply and delete objects within the ConfigFile. Pulumi also waits for each object to be fully reconciled, unless `skipAwait` is enabled.

### Explicit Dependency Ordering Pulumi supports the `config.kubernetes.io/depends-on` annotation to declare an explicit dependency on a given resource. The annotation accepts a list of resource references, delimited by commas.

Note that references to resources outside the ConfigFile aren't supported.

**Resource reference**

A resource reference is a string that uniquely identifies a resource.

It consists of the group, kind, name, and optionally the namespace, delimited by forward slashes.

| Resource Scope | Format | | :--------------- | :--------------------------------------------- | | namespace-scoped | `<group>/namespaces/<namespace>/<kind>/<name>` | | cluster-scoped | `<group>/<kind>/<name>` |

For resources in the “core” group, the empty string is used instead (for example: `/namespaces/test/Pod/pod-a`).

### Ordering across ConfigFiles The `dependsOn` resource option creates a list of explicit dependencies between Pulumi resources. Use it on another resource to make it dependent on the ConfigFile and to wait for the resources within the group to be deployed.

A best practice is to deploy each application using its own ConfigFile, especially when that application installs custom resource definitions.

## Example Usage ### Local File ```go package main

import (

yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yamlv2.NewConfigFile(ctx, "example", &yamlv2.ConfigFileArgs{
			File: pulumi.String("manifest.yaml"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` {% /examples %}}

func NewConfigFile

func NewConfigFile(ctx *pulumi.Context,
	name string, args *ConfigFileArgs, opts ...pulumi.ResourceOption) (*ConfigFile, error)

NewConfigFile registers a new resource with the given unique name, arguments, and options.

func (*ConfigFile) ElementType

func (*ConfigFile) ElementType() reflect.Type

func (*ConfigFile) ToConfigFileOutput

func (i *ConfigFile) ToConfigFileOutput() ConfigFileOutput

func (*ConfigFile) ToConfigFileOutputWithContext

func (i *ConfigFile) ToConfigFileOutputWithContext(ctx context.Context) ConfigFileOutput

type ConfigFileArgs

type ConfigFileArgs struct {
	// Path or URL to a Kubernetes manifest file. File must exist.
	File pulumi.StringInput
	// A prefix for the auto-generated resource names. Defaults to the name of the ConfigFile. Example: A resource created with resourcePrefix="foo" would produce a resource named "foo-resourceName".
	ResourcePrefix pulumi.StringPtrInput
	// Indicates that child resources should skip the await logic.
	SkipAwait pulumi.BoolPtrInput
}

The set of arguments for constructing a ConfigFile resource.

func (ConfigFileArgs) ElementType

func (ConfigFileArgs) ElementType() reflect.Type

type ConfigFileArray

type ConfigFileArray []ConfigFileInput

func (ConfigFileArray) ElementType

func (ConfigFileArray) ElementType() reflect.Type

func (ConfigFileArray) ToConfigFileArrayOutput

func (i ConfigFileArray) ToConfigFileArrayOutput() ConfigFileArrayOutput

func (ConfigFileArray) ToConfigFileArrayOutputWithContext

func (i ConfigFileArray) ToConfigFileArrayOutputWithContext(ctx context.Context) ConfigFileArrayOutput

type ConfigFileArrayInput

type ConfigFileArrayInput interface {
	pulumi.Input

	ToConfigFileArrayOutput() ConfigFileArrayOutput
	ToConfigFileArrayOutputWithContext(context.Context) ConfigFileArrayOutput
}

ConfigFileArrayInput is an input type that accepts ConfigFileArray and ConfigFileArrayOutput values. You can construct a concrete instance of `ConfigFileArrayInput` via:

ConfigFileArray{ ConfigFileArgs{...} }

type ConfigFileArrayOutput

type ConfigFileArrayOutput struct{ *pulumi.OutputState }

func (ConfigFileArrayOutput) ElementType

func (ConfigFileArrayOutput) ElementType() reflect.Type

func (ConfigFileArrayOutput) Index

func (ConfigFileArrayOutput) ToConfigFileArrayOutput

func (o ConfigFileArrayOutput) ToConfigFileArrayOutput() ConfigFileArrayOutput

func (ConfigFileArrayOutput) ToConfigFileArrayOutputWithContext

func (o ConfigFileArrayOutput) ToConfigFileArrayOutputWithContext(ctx context.Context) ConfigFileArrayOutput

type ConfigFileInput

type ConfigFileInput interface {
	pulumi.Input

	ToConfigFileOutput() ConfigFileOutput
	ToConfigFileOutputWithContext(ctx context.Context) ConfigFileOutput
}

type ConfigFileMap

type ConfigFileMap map[string]ConfigFileInput

func (ConfigFileMap) ElementType

func (ConfigFileMap) ElementType() reflect.Type

func (ConfigFileMap) ToConfigFileMapOutput

func (i ConfigFileMap) ToConfigFileMapOutput() ConfigFileMapOutput

func (ConfigFileMap) ToConfigFileMapOutputWithContext

func (i ConfigFileMap) ToConfigFileMapOutputWithContext(ctx context.Context) ConfigFileMapOutput

type ConfigFileMapInput

type ConfigFileMapInput interface {
	pulumi.Input

	ToConfigFileMapOutput() ConfigFileMapOutput
	ToConfigFileMapOutputWithContext(context.Context) ConfigFileMapOutput
}

ConfigFileMapInput is an input type that accepts ConfigFileMap and ConfigFileMapOutput values. You can construct a concrete instance of `ConfigFileMapInput` via:

ConfigFileMap{ "key": ConfigFileArgs{...} }

type ConfigFileMapOutput

type ConfigFileMapOutput struct{ *pulumi.OutputState }

func (ConfigFileMapOutput) ElementType

func (ConfigFileMapOutput) ElementType() reflect.Type

func (ConfigFileMapOutput) MapIndex

func (ConfigFileMapOutput) ToConfigFileMapOutput

func (o ConfigFileMapOutput) ToConfigFileMapOutput() ConfigFileMapOutput

func (ConfigFileMapOutput) ToConfigFileMapOutputWithContext

func (o ConfigFileMapOutput) ToConfigFileMapOutputWithContext(ctx context.Context) ConfigFileMapOutput

type ConfigFileOutput

type ConfigFileOutput struct{ *pulumi.OutputState }

func (ConfigFileOutput) ElementType

func (ConfigFileOutput) ElementType() reflect.Type

func (ConfigFileOutput) Resources

func (o ConfigFileOutput) Resources() pulumi.ArrayOutput

Resources created by the ConfigFile.

func (ConfigFileOutput) ToConfigFileOutput

func (o ConfigFileOutput) ToConfigFileOutput() ConfigFileOutput

func (ConfigFileOutput) ToConfigFileOutputWithContext

func (o ConfigFileOutput) ToConfigFileOutputWithContext(ctx context.Context) ConfigFileOutput

type ConfigGroup

type ConfigGroup struct {
	pulumi.ResourceState

	// Resources created by the ConfigGroup.
	Resources pulumi.ArrayOutput `pulumi:"resources"`
}

ConfigGroup creates a set of Kubernetes resources from Kubernetes YAML text. The YAML text may be supplied using any of the following methods:

1. Using a filename or a list of filenames: 2. Using a file pattern or a list of file patterns: 3. Using a literal string containing YAML, or a list of such strings: 4. Any combination of files, patterns, or YAML strings:

## Dependency ordering Sometimes resources must be applied in a specific order. For example, a namespace resource must be created before any namespaced resources, or a Custom Resource Definition (CRD) must be pre-installed.

Pulumi uses heuristics to determine which order to apply and delete objects within the ConfigGroup. Pulumi also waits for each object to be fully reconciled, unless `skipAwait` is enabled.

### Explicit Dependency Ordering Pulumi supports the `config.kubernetes.io/depends-on` annotation to declare an explicit dependency on a given resource. The annotation accepts a list of resource references, delimited by commas.

Note that references to resources outside the ConfigGroup aren't supported.

**Resource reference**

A resource reference is a string that uniquely identifies a resource.

It consists of the group, kind, name, and optionally the namespace, delimited by forward slashes.

| Resource Scope | Format | | :--------------- | :--------------------------------------------- | | namespace-scoped | `<group>/namespaces/<namespace>/<kind>/<name>` | | cluster-scoped | `<group>/<kind>/<name>` |

For resources in the “core” group, the empty string is used instead (for example: `/namespaces/test/Pod/pod-a`).

### Ordering across ConfigGroups The `dependsOn` resource option creates a list of explicit dependencies between Pulumi resources. Use it on another resource to make it dependent on the ConfigGroup and to wait for the resources within the group to be deployed.

A best practice is to deploy each application using its own ConfigGroup, especially when that application installs custom resource definitions.

## Example Usage ### Local File(s) ```go package main

import (

yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yamlv2.NewConfigGroup(ctx, "example", &yamlv2.ConfigGroupArgs{
			Files: pulumi.ToStringArray([]string{"manifest.yaml"}),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Local File Pattern ```go package main

import (

yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yamlv2.NewConfigGroup(ctx, "example", &yamlv2.ConfigGroupArgs{
			Files: pulumi.ToStringArray([]string{"./manifests/*.yaml"}),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` {{% /example %}} ### Literal YAML String ```go package main

import (

yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yamlv2.NewConfigGroup(ctx, "example", &yamlv2.ConfigGroupArgs{
			Yaml: pulumi.StringPtr(`

apiVersion: v1 kind: ConfigMap metadata:

name: my-map

`),

		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Literal Object ```go package main

import (

yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yamlv2.NewConfigGroup(ctx, "example", &yamlv2.ConfigGroupArgs{
			Objs: pulumi.Array{
				pulumi.Map{
					"apiVersion": pulumi.String("v1"),
					"kind":       pulumi.String("ConfigMap"),
					"metadata": pulumi.Map{
						"name": pulumi.String("my-map"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` {% /examples %}}

func NewConfigGroup

func NewConfigGroup(ctx *pulumi.Context,
	name string, args *ConfigGroupArgs, opts ...pulumi.ResourceOption) (*ConfigGroup, error)

NewConfigGroup registers a new resource with the given unique name, arguments, and options.

func (*ConfigGroup) ElementType

func (*ConfigGroup) ElementType() reflect.Type

func (*ConfigGroup) ToConfigGroupOutput

func (i *ConfigGroup) ToConfigGroupOutput() ConfigGroupOutput

func (*ConfigGroup) ToConfigGroupOutputWithContext

func (i *ConfigGroup) ToConfigGroupOutputWithContext(ctx context.Context) ConfigGroupOutput

type ConfigGroupArgs

type ConfigGroupArgs struct {
	// Set of paths and/or URLs to Kubernetes manifest files. Supports glob patterns.
	Files pulumi.StringArrayInput
	// Objects representing Kubernetes resource configurations.
	Objs pulumi.ArrayInput
	// A prefix for the auto-generated resource names. Defaults to the name of the ConfigGroup. Example: A resource created with resourcePrefix="foo" would produce a resource named "foo-resourceName".
	ResourcePrefix pulumi.StringPtrInput
	// Indicates that child resources should skip the await logic.
	SkipAwait pulumi.BoolPtrInput
	// A Kubernetes YAML manifest containing Kubernetes resource configuration(s).
	Yaml pulumi.StringPtrInput
}

The set of arguments for constructing a ConfigGroup resource.

func (ConfigGroupArgs) ElementType

func (ConfigGroupArgs) ElementType() reflect.Type

type ConfigGroupArray

type ConfigGroupArray []ConfigGroupInput

func (ConfigGroupArray) ElementType

func (ConfigGroupArray) ElementType() reflect.Type

func (ConfigGroupArray) ToConfigGroupArrayOutput

func (i ConfigGroupArray) ToConfigGroupArrayOutput() ConfigGroupArrayOutput

func (ConfigGroupArray) ToConfigGroupArrayOutputWithContext

func (i ConfigGroupArray) ToConfigGroupArrayOutputWithContext(ctx context.Context) ConfigGroupArrayOutput

type ConfigGroupArrayInput

type ConfigGroupArrayInput interface {
	pulumi.Input

	ToConfigGroupArrayOutput() ConfigGroupArrayOutput
	ToConfigGroupArrayOutputWithContext(context.Context) ConfigGroupArrayOutput
}

ConfigGroupArrayInput is an input type that accepts ConfigGroupArray and ConfigGroupArrayOutput values. You can construct a concrete instance of `ConfigGroupArrayInput` via:

ConfigGroupArray{ ConfigGroupArgs{...} }

type ConfigGroupArrayOutput

type ConfigGroupArrayOutput struct{ *pulumi.OutputState }

func (ConfigGroupArrayOutput) ElementType

func (ConfigGroupArrayOutput) ElementType() reflect.Type

func (ConfigGroupArrayOutput) Index

func (ConfigGroupArrayOutput) ToConfigGroupArrayOutput

func (o ConfigGroupArrayOutput) ToConfigGroupArrayOutput() ConfigGroupArrayOutput

func (ConfigGroupArrayOutput) ToConfigGroupArrayOutputWithContext

func (o ConfigGroupArrayOutput) ToConfigGroupArrayOutputWithContext(ctx context.Context) ConfigGroupArrayOutput

type ConfigGroupInput

type ConfigGroupInput interface {
	pulumi.Input

	ToConfigGroupOutput() ConfigGroupOutput
	ToConfigGroupOutputWithContext(ctx context.Context) ConfigGroupOutput
}

type ConfigGroupMap

type ConfigGroupMap map[string]ConfigGroupInput

func (ConfigGroupMap) ElementType

func (ConfigGroupMap) ElementType() reflect.Type

func (ConfigGroupMap) ToConfigGroupMapOutput

func (i ConfigGroupMap) ToConfigGroupMapOutput() ConfigGroupMapOutput

func (ConfigGroupMap) ToConfigGroupMapOutputWithContext

func (i ConfigGroupMap) ToConfigGroupMapOutputWithContext(ctx context.Context) ConfigGroupMapOutput

type ConfigGroupMapInput

type ConfigGroupMapInput interface {
	pulumi.Input

	ToConfigGroupMapOutput() ConfigGroupMapOutput
	ToConfigGroupMapOutputWithContext(context.Context) ConfigGroupMapOutput
}

ConfigGroupMapInput is an input type that accepts ConfigGroupMap and ConfigGroupMapOutput values. You can construct a concrete instance of `ConfigGroupMapInput` via:

ConfigGroupMap{ "key": ConfigGroupArgs{...} }

type ConfigGroupMapOutput

type ConfigGroupMapOutput struct{ *pulumi.OutputState }

func (ConfigGroupMapOutput) ElementType

func (ConfigGroupMapOutput) ElementType() reflect.Type

func (ConfigGroupMapOutput) MapIndex

func (ConfigGroupMapOutput) ToConfigGroupMapOutput

func (o ConfigGroupMapOutput) ToConfigGroupMapOutput() ConfigGroupMapOutput

func (ConfigGroupMapOutput) ToConfigGroupMapOutputWithContext

func (o ConfigGroupMapOutput) ToConfigGroupMapOutputWithContext(ctx context.Context) ConfigGroupMapOutput

type ConfigGroupOutput

type ConfigGroupOutput struct{ *pulumi.OutputState }

func (ConfigGroupOutput) ElementType

func (ConfigGroupOutput) ElementType() reflect.Type

func (ConfigGroupOutput) Resources

func (o ConfigGroupOutput) Resources() pulumi.ArrayOutput

Resources created by the ConfigGroup.

func (ConfigGroupOutput) ToConfigGroupOutput

func (o ConfigGroupOutput) ToConfigGroupOutput() ConfigGroupOutput

func (ConfigGroupOutput) ToConfigGroupOutputWithContext

func (o ConfigGroupOutput) ToConfigGroupOutputWithContext(ctx context.Context) ConfigGroupOutput

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL