k8s

package
v0.0.0-...-9ed255f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupUnknown   BackupState = "Unknown"
	BackupStarting              = "Starting"
	BackupRunning               = "Running"
	BackupFailed                = "Failed"
	BackupSucceeded             = "Succeeded"
)
View Source
const (
	ClusterStateUnknown ClusterState = "unknown"
	ClusterStateInit                 = "initializing"
	ClusterStateReady                = "ready"
	ClusterStateError                = "error"
)
View Source
const (
	DefaultBcpStorageName = "defaultS3Storage"
)

Variables

This section is empty.

Functions

func GenRandString

func GenRandString(ln int) string

GenRandString generates a k8s-name legitimate string of given length

func GetStringFromMap

func GetStringFromMap(input map[string]string) string

Types

type BackupState

type BackupState string

type BackupStorageS3Spec

type BackupStorageS3Spec struct {
	Bucket            string `json:"bucket"`
	CredentialsSecret string `json:"credentialsSecret"`
	Region            string `json:"region,omitempty"`
	EndpointURL       string `json:"endpointUrl,omitempty"`
}

type BackupStorageSpec

type BackupStorageSpec struct {
	Type   BackupStorageType   `json:"type"`
	S3     BackupStorageS3Spec `json:"s3,omitempty"`
	Volume *VolumeSpec         `json:"volume,omitempty"`
}

type BackupStorageType

type BackupStorageType string
const (
	BackupStorageFilesystem BackupStorageType = "filesystem"
	BackupStorageS3         BackupStorageType = "s3"
)

type BundleObject

type BundleObject struct {
	Kind string
	Name string
	Data string
}

type ClusterState

type ClusterState string

type Cmd

type Cmd struct {
	Namespace string
	// contains filtered or unexported fields
}

func New

func New(environment string) (*Cmd, error)

func (Cmd) Annotate

func (p Cmd) Annotate(resource, clusterName, annotName, instance string) error

func (Cmd) CreateCluster

func (p Cmd) CreateCluster(typ, operatorVersion, clusterName, cr string, bundle []BundleObject) error

func (Cmd) CreateSecret

func (p Cmd) CreateSecret(name string, data map[string][]byte) error

CreateSecret creates k8s secret object with the given name and data

func (Cmd) DeleteCluster

func (p Cmd) DeleteCluster(typ, operatorName, appName string, delPVC bool) error

func (Cmd) GetObject

func (p Cmd) GetObject(typ, name string) ([]byte, error)

func (Cmd) GetObjects

func (p Cmd) GetObjects(typ string) ([]byte, error)

func (Cmd) GetPlatformType

func (p Cmd) GetPlatformType() PlatformType

GetPlatformType is for determine and return platform type

func (Cmd) GetSecrets

func (p Cmd) GetSecrets(appName string) (map[string][]byte, error)

func (Cmd) GetServiceBrokerInstances

func (p Cmd) GetServiceBrokerInstances(typ string) ([]byte, error)

func (Cmd) Instances

func (p Cmd) Instances(typ string) ([]string, error)

func (Cmd) IsObjExists

func (p Cmd) IsObjExists(typ, name string) (bool, error)

func (Cmd) S3Storage

func (p Cmd) S3Storage(appName string, c S3StorageConfig) (*BackupStorageSpec, error)

func (Cmd) Upgrade

func (p Cmd) Upgrade(typ string, clusterName, cr string) error

type Deploy

type Deploy interface {
	OperatorType() string
	// contains filtered or unexported methods
}

type ErrAlreadyExists

type ErrAlreadyExists struct {
	Typ     string
	Cluster string
}

func (ErrAlreadyExists) Error

func (e ErrAlreadyExists) Error() string

type ErrCmdRun

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

func (ErrCmdRun) Error

func (e ErrCmdRun) Error() string

type ErrNoS3Options

type ErrNoS3Options string

func (ErrNoS3Options) Error

func (e ErrNoS3Options) Error() string

type Msg

type Msg interface {
	String() string
}

type Objects

type Objects struct {
	Bundle []BundleObject
}

type PlatformType

type PlatformType string
const (
	PlatformKubernetes PlatformType = "kubernetes"
	PlatformMinikube   PlatformType = "minikube"
	PlatformOpenshift  PlatformType = "openshift"
	PlatformMinishift  PlatformType = "minishift"
)

type S3StorageConfig

type S3StorageConfig struct {
	EndpointURL       string
	Bucket            string
	Region            string
	CredentialsSecret string
	KeyID             string
	Key               string
	SkipStorage       bool
}

type VolumeSpec

type VolumeSpec struct {
	// EmptyDir to use as data volume for mysql. EmptyDir represents a temporary
	// directory that shares a pod's lifetime.
	// +optional
	EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`

	// HostPath to use as data volume for mysql. HostPath represents a
	// pre-existing file or directory on the host machine that is directly
	// exposed to the container.
	// +optional
	HostPath *corev1.HostPathVolumeSource `json:"hostPath,omitempty"`

	// PersistentVolumeClaim to specify PVC spec for the volume for mysql data.
	// It has the highest level of precedence, followed by HostPath and
	// EmptyDir. And represents the PVC specification.
	// +optional
	PersistentVolumeClaim *corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaim,omitempty"`
}

Jump to

Keyboard shortcuts

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