registry

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

Cloud Provider Registry

This package enables cloud providers to embed themselves into the Karpenter binary without bundling all cloud providers simultaneously. We use mutually exclusive go build tags to register the cloud provider into the import tree. The default implementation is a neutral "mock" cloud provider that implements no-op behavior.

Add your cloud provider in this directory:

// +build <YOUR_PROVIDER_NAME>
import (
	"github.com/aws/karpenter/pkg/cloudprovider/<YOUR_PROVIDER_NAME>"
)

func NewCloudProvider() cloudprovider.CloudProvider {
	return <YOUR_PROVIDER_NAME>.NewCloudProvider()
}

Build your customized binary

CLOUD_PROVIDER=<YOUR_PROVIDER_NAME> make apply

Add a negative flag to mock.go

// +build !<YOUR_PROVIDER_NAME>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterOrDie

func RegisterOrDie(ctx context.Context, cloudProvider cloudprovider.CloudProvider)

RegisterOrDie populates supported instance types, zones, operating systems, architectures, and validation logic. This operation should only be called once at startup time. Typically, this call is made by NewCloudProvider(), but must be called if the cloud provider is constructed manually (e.g. tests).

Types

This section is empty.

Jump to

Keyboard shortcuts

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