install

package
v0.4.21 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BackupPreviousErase erases previous backup
	BackupPreviousErase = iota
	// BackupPreviousMerge adds/merges new data to previous backup
	BackupPreviousMerge
	// BackupPreviousFail fails if a previous backup exists
	BackupPreviousFail
)
View Source
const (
	// TimeoutDefault is the default install timeout.
	TimeoutDefault = 30 * time.Second
)

Variables

This section is empty.

Functions

func Backup

func Backup(config *rest.Config, mode int) error

Backup saves all stacks to a new temporary CRD

func CRDCRD

func CRDCRD(config *rest.Config) error

CRDCRD installs the CRD component of CRD install

func CheckRequirements

func CheckRequirements(config *rest.Config) error

CheckRequirements fetches the server version and checks it is above the minimum required version.

func DeleteBackup

func DeleteBackup(config *rest.Config) error

DeleteBackup deletes the backup CRD

func Do

func Do(ctx context.Context, config *rest.Config, options ...InstallerOption) error

Do proceeds with installing

func DryRun

func DryRun(config *rest.Config) (map[string]error, error)

DryRun checks existing stacks for conversion errors or conflicts

func HasBackupCRD

func HasBackupCRD(config *rest.Config) (bool, error)

HasBackupCRD indicates if the backup crd is there

func IsErrImagePull

func IsErrImagePull(reason string) bool

IsErrImagePull checks if an error is an errImagePull

func IsRunning

func IsRunning(config *rest.Config) (bool, error)

IsRunning checks if the compose api server is available

func Restore

func Restore(baseConfig *rest.Config, impersonate bool) (map[string]error, error)

Restore copies stacks from backup to v1beta1 stacks.compose.docker.com

func Safe

func Safe(ctx context.Context, config *rest.Config, options SafeOptions) error

Safe installs the compose features securely

func Uninstall

func Uninstall(config *rest.Config, namespace string, keepCRD bool) error

Uninstall uninstalls the Compose feature.

func UninstallCRD

func UninstallCRD(config *rest.Config) error

UninstallCRD uninstalls the CustomResourceDefinition and preserves running stacks

func UninstallComposeAPIServer

func UninstallComposeAPIServer(config *rest.Config, namespace string) error

UninstallComposeAPIServer uninstalls compose in API server mode, preserving running stacks

func UninstallComposeCRD

func UninstallComposeCRD(config *rest.Config, namespace string) error

UninstallComposeCRD uninstalls compose in CRD mode, preserving running stacks

func Unsafe

func Unsafe(ctx context.Context, config *rest.Config, options UnsafeOptions) error

Unsafe installs the Compose features without High availability, and with insecure ETCD.

func Update

func Update(config *rest.Config, namespace, tag string, abortOnError bool) (map[string]error, error)

Update perform a full update operation, restoring the stacks

func WaitForUninstallCompletion

func WaitForUninstallCompletion(ctx context.Context, config *rest.Config, namespace string, skipCRD bool) error

WaitForUninstallCompletion waits for an unistall operation to complete

func WaitNPods

func WaitNPods(config *rest.Config, namespace string, count int, timeout time.Duration) error

WaitNPods waits for n pods to be up

Types

type EtcdOptions

type EtcdOptions struct {
	Servers         string
	ClientTLSBundle *TLSBundle
}

EtcdOptions holds install options related to ETCD

type InstallerOption

type InstallerOption func(*installer)

InstallerOption defines modifies the installer

func WithAPIServerImage

func WithAPIServerImage(image string) InstallerOption

WithAPIServerImage overrides API server image selection

func WithControllerImage

func WithControllerImage(image string) InstallerOption

WithControllerImage overrides controller image selection

func WithControllerOnly

func WithControllerOnly() InstallerOption

WithControllerOnly installs only the controller

func WithCustomStatusMatch

func WithCustomStatusMatch(match func(Status) bool) InstallerOption

WithCustomStatusMatch allows to provide additional predicates to check if the current install status matches the desired state

func WithExpiresOffset

func WithExpiresOffset(d time.Duration) InstallerOption

WithExpiresOffset specifies the duration offset to apply when checking if generated tls bundle has expired

func WithObjectFilter

func WithObjectFilter(filter RuntimeObjectFilter) InstallerOption

WithObjectFilter applies a RuntimeObjectFilter

func WithSafe

func WithSafe(o SafeOptions) InstallerOption

WithSafe initializes the installer with Safe options

func WithUnsafe

func WithUnsafe(o UnsafeOptions) InstallerOption

WithUnsafe initializes the installer with unsafe options

func WithoutController

func WithoutController() InstallerOption

WithoutController install components without the controller

type NetworkOptions

type NetworkOptions struct {
	ShouldUseHost   bool
	CustomTLSBundle *TLSBundle
	Port            int32
}

NetworkOptions holds install options related to networking

type OptionsCommon

type OptionsCommon struct {
	Namespace              string
	Tag                    string
	PullSecret             string
	ReconciliationInterval time.Duration
	DefaultServiceType     string
	APIServerAffinity      *corev1types.Affinity
	ControllerAffinity     *corev1types.Affinity
	HealthzCheckPort       int
	PullPolicy             corev1types.PullPolicy
}

OptionsCommon holds install options for the api extension

type RuntimeObjectFilter

type RuntimeObjectFilter func(runtime.Object) (bool, error)

RuntimeObjectFilter allows to modify or bypass completely a k8s object

type SafeOptions

type SafeOptions struct {
	OptionsCommon
	Etcd    EtcdOptions
	Network NetworkOptions
}

SafeOptions holds install options for the api extension

type Status

type Status struct {
	// True if there is a deployment with compose labels in the cluster
	IsInstalled bool
	// Tag of the installed components
	Tag string
	// Indicates if there is a legacy compose CRD in the system
	IsCrdPresent bool
	// Namespace in which components are deployed
	Namespace string
	// Image of the controller
	ControllerImage string
	// Image of the API service
	APIServiceImage string
	// Default service type for published services
	DefaultServiceType string
	// ControllerLabels contains all labels from Controller deployment
	ControllerLabels map[string]string
	// APIServiceLabels contains all labels from API service deployment
	APIServiceLabels map[string]string
	// APIServiceAnnotations contains annotations from the API service deployment
	APIServiceAnnotations map[string]string
}

Status reports current installation status details

func GetInstallStatus

func GetInstallStatus(config *rest.Config) (Status, error)

GetInstallStatus retrives the current installation status

type TLSBundle

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

TLSBundle is a bundle containing a CA, a public cert and private key, PEM encoded

func NewTLSBundle

func NewTLSBundle(ca, cert, key []byte) (*TLSBundle, error)

NewTLSBundle creates a TLS bundle

type UnsafeOptions

type UnsafeOptions struct {
	OptionsCommon
	Coverage bool
	Debug    bool
}

UnsafeOptions holds install options for the api extension

Jump to

Keyboard shortcuts

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