provisioner

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Action string
View Source
var AzureProps = &AzureProperties{}

Functions

func AddNodeRoleWorkerLabel added in v0.8.0

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 AzureProperties

type AzureProperties struct {
	SubscriptionID      string
	ClientID            string
	ResourceGroupName   string
	ClusterName         string
	Location            string
	SSHKeyID            string
	SubnetName          string
	VnetName            string
	SubnetID            string
	ImageID             string
	SshUserName         string
	ManagedIdentityName string
	IsCIManaged         bool
	CaaImage            string
	IsSelfManaged       bool

	InstanceSize string
	NodeName     string
	OsType       string

	ResourceGroupClient                *armresources.ResourceGroupsClient
	ManagedVnetClient                  *armnetwork.VirtualNetworksClient
	ManagedSubnetClient                *armnetwork.SubnetsClient
	ManagedAksClient                   *armcontainerservice.ManagedClustersClient
	ManagedVmClient                    *armcompute.VirtualMachinesClient
	FederatedIdentityCredentialsClient *armmsi.FederatedIdentityCredentialsClient
	// contains filtered or unexported fields
}

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

type KustomizeOverlay

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

func NewKustomizeOverlay

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

func (*KustomizeOverlay) AddToPatchesStrategicMerge added in v0.7.0

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 added in v0.6.0

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

Jump to

Keyboard shortcuts

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