provisioner

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const PodWaitTimeout = time.Second * 30

Waiting timeout for bringing up the pod

Variables

View Source
var Action string
View Source
var NewInstallOverlayFunctions = make(map[string]NewInstallOverlayFunc)
View Source
var NewProvisionerFunctions = make(map[string]NewProvisionerFunc)

Functions

func AddNodeRoleWorkerLabel

func AddNodeRoleWorkerLabel(ctx context.Context, clusterName string, cfg *envconf.Config) error

Adds the worker label to all workers nodes in a given cluster

func AllPodsRunning

func AllPodsRunning(ctx context.Context, cfg *envconf.Config, namespace string) error

TODO: convert this into a klient/wait/conditions

func BuildKustomizeOverlayAsYaml

func BuildKustomizeOverlayAsYaml(overlayDir string) ([]byte, error)

BuildAsYaml only build the overlay directory and returns the manifest as the YAML representation.

func GetDaemonSetOwnedPods

func GetDaemonSetOwnedPods(ctx context.Context, cfg *envconf.Config, daemonset *appsv1.DaemonSet) (*corev1.PodList, error)

Returns a list of running Pods owned by a DaemonSet

Types

type CloudAPIAdaptor

type CloudAPIAdaptor struct {
	// contains filtered or unexported fields
}

func NewCloudAPIAdaptor

func NewCloudAPIAdaptor(provider string, installDir string) (*CloudAPIAdaptor, error)

func (*CloudAPIAdaptor) Delete

func (p *CloudAPIAdaptor) Delete(ctx context.Context, cfg *envconf.Config) error

Deletes the peer pods installation including the controller manager.

func (*CloudAPIAdaptor) Deploy

func (p *CloudAPIAdaptor) Deploy(ctx context.Context, cfg *envconf.Config, props map[string]string) error

Deploy installs Peer Pods on the cluster.

func (*CloudAPIAdaptor) DoKustomize

func (p *CloudAPIAdaptor) DoKustomize(ctx context.Context, cfg *envconf.Config)

type CloudProvisioner

type CloudProvisioner interface {
	CreateCluster(ctx context.Context, cfg *envconf.Config) error
	CreateVPC(ctx context.Context, cfg *envconf.Config) error
	DeleteCluster(ctx context.Context, cfg *envconf.Config) error
	DeleteVPC(ctx context.Context, cfg *envconf.Config) error
	GetProperties(ctx context.Context, cfg *envconf.Config) map[string]string
	UploadPodvm(imagePath string, ctx context.Context, cfg *envconf.Config) error
}

CloudProvisioner defines operations to provision the environment on cloud providers.

func GetCloudProvisioner

func GetCloudProvisioner(provider string, propertiesFile string) (CloudProvisioner, error)

GetCloudProvisioner returns a CloudProvisioner implementation

type InstallOverlay

type InstallOverlay interface {
	// Apply applies the overlay. Equivalent to the `kubectl apply -k` command
	Apply(ctx context.Context, cfg *envconf.Config) error
	// Delete deletes the overlay. Equivalent to the `kubectl delete -k` command
	Delete(ctx context.Context, cfg *envconf.Config) error
	// Edit changes overlay files
	Edit(ctx context.Context, cfg *envconf.Config, properties map[string]string) error
}

InstallOverlay defines common operations to an install overlay (install/overlays/*)

func GetInstallOverlay

func GetInstallOverlay(provider string, installDir string) (InstallOverlay, error)

GetInstallOverlay returns the InstallOverlay implementation for the provider

func NewBaseKbsInstallOverlay

func NewBaseKbsInstallOverlay(installDir string) (InstallOverlay, error)

func NewKbsInstallOverlay

func NewKbsInstallOverlay(installDir string) (InstallOverlay, error)

type KbsInstallOverlay

type KbsInstallOverlay struct {
	// contains filtered or unexported fields
}

KbsInstallOverlay implements the InstallOverlay interface

func (*KbsInstallOverlay) Apply

func (lio *KbsInstallOverlay) Apply(ctx context.Context, cfg *envconf.Config) error

func (*KbsInstallOverlay) Delete

func (lio *KbsInstallOverlay) Delete(ctx context.Context, cfg *envconf.Config) error

func (*KbsInstallOverlay) Edit

func (lio *KbsInstallOverlay) Edit(ctx context.Context, cfg *envconf.Config, props map[string]string) error

type KeyBrokerService

type KeyBrokerService struct {
	// contains filtered or unexported fields
}

func NewKeyBrokerService

func NewKeyBrokerService(clusterName string) (*KeyBrokerService, error)

func (*KeyBrokerService) Delete

func (p *KeyBrokerService) Delete(ctx context.Context, cfg *envconf.Config) error

func (*KeyBrokerService) Deploy

func (p *KeyBrokerService) Deploy(ctx context.Context, cfg *envconf.Config, props map[string]string) error

func (*KeyBrokerService) GetKbsPodIP

func (p *KeyBrokerService) GetKbsPodIP(ctx context.Context, cfg *envconf.Config) (string, error)

type KustomizeOverlay

type KustomizeOverlay struct {
	ConfigDir string // path to the overlay directory
	Yaml      []byte // Resources built in YAML
}

func NewKustomizeOverlay

func NewKustomizeOverlay(dir string) (*KustomizeOverlay, error)

func (*KustomizeOverlay) AddToPatchesStrategicMerge

func (kh *KustomizeOverlay) AddToPatchesStrategicMerge(fileName string) error

func (*KustomizeOverlay) Apply

func (kh *KustomizeOverlay) Apply(ctx context.Context, cfg *envconf.Config) error

Apply builds the configuration directory and deploy the resulted manifest.

func (*KustomizeOverlay) Delete

func (kh *KustomizeOverlay) Delete(ctx context.Context, cfg *envconf.Config) error

Delete builds the overlay directory and delete the resulted resources.

func (*KustomizeOverlay) SetKustomizeConfigMapGeneratorLiteral

func (kh *KustomizeOverlay) SetKustomizeConfigMapGeneratorLiteral(cmgName string, key string, value string) (err error)

SetKustomizeConfigMapGeneratorLiteral updates the kustomization YAML by setting `value` to `key` on the `cmgName` ConfigMapGenerator literals. If `key` does not exist then a new entry is added.

func (*KustomizeOverlay) SetKustomizeImage

func (kh *KustomizeOverlay) SetKustomizeImage(imageName string, key string, value string) (err error)

SetKustomizeImage updates the kustomization YAML by setting `value` to `key` on the `Image`. If `key` does not exist then a new entry is added.

func (*KustomizeOverlay) SetKustomizeSecretGeneratorFile

func (kh *KustomizeOverlay) SetKustomizeSecretGeneratorFile(sgName string, file string) (err error)

SetKustomizeSecretGeneratorFile updates the kustomization YAML by adding the `file` on the `sgName` SecretGenerator files.

func (*KustomizeOverlay) SetKustomizeSecretGeneratorLiteral

func (kh *KustomizeOverlay) SetKustomizeSecretGeneratorLiteral(secretName string, key string, value string) (err error)

SetKustomizeSecretGeneratorLiteral updates the kustomization YAML by setting `value` to `key` on the `secretName` SecretGenerator literals. If `key` does not exist then a new entry is added.

func (*KustomizeOverlay) YamlReload

func (kh *KustomizeOverlay) YamlReload() error

type NewInstallOverlayFunc

type NewInstallOverlayFunc func(installDir, provider string) (InstallOverlay, error)

type NewProvisionerFunc

type NewProvisionerFunc func(properties map[string]string) (CloudProvisioner, error)

type PatchLabel

type PatchLabel struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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