k8sclient

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package k8sclient provides client for kubernetes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name string
}

Cluster contains common information related to cluster.

type ClusterKind

type ClusterKind string

ClusterKind is a kind of a cluster.

type ClusterState

type ClusterState int32

ClusterState represents XtraDB cluster CR state.

const (
	// ClusterStateInvalid represents unknown state.
	ClusterStateInvalid ClusterState = 0
	// ClusterStateChanging represents a cluster being changed (initializing).
	ClusterStateChanging ClusterState = 1
	// ClusterStateReady represents a cluster without pending changes (ready).
	ClusterStateReady ClusterState = 2
	// ClusterStateFailed represents a failed cluster (error).
	ClusterStateFailed ClusterState = 3
	// ClusterStateDeleting represents a cluster which are in deleting state (deleting).
	ClusterStateDeleting ClusterState = 4
)

type ComputeResources added in v0.1.2

type ComputeResources struct {
	CPUM        int32
	MemoryBytes int64
}

ComputeResources represents container computer resources requests or limits.

type K8Client

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

K8Client is a client for Kubernetes.

func NewK8Client

func NewK8Client(ctx context.Context, kubeconfig string) (*K8Client, error)

NewK8Client returns new K8Client object.

func (*K8Client) Cleanup

func (c *K8Client) Cleanup() error

Cleanup removes temporary files created by that object.

func (*K8Client) CreateXtraDBCluster

func (c *K8Client) CreateXtraDBCluster(ctx context.Context, params *XtraDBParams) error

CreateXtraDBCluster creates Percona XtraDB cluster with provided parameters.

func (*K8Client) DeleteXtraDBCluster

func (c *K8Client) DeleteXtraDBCluster(ctx context.Context, name string) error

DeleteXtraDBCluster deletes Percona XtraDB cluster with provided name.

func (*K8Client) ListXtraDBClusters

func (c *K8Client) ListXtraDBClusters(ctx context.Context) ([]XtraDBCluster, error)

ListXtraDBClusters returns list of Percona XtraDB clusters and their statuses.

func (*K8Client) UpdateXtraDBCluster

func (c *K8Client) UpdateXtraDBCluster(ctx context.Context, params *XtraDBParams) error

UpdateXtraDBCluster changes size of provided Percona XtraDB cluster.

type PXC added in v0.1.2

type PXC struct {
	ComputeResources *ComputeResources
}

PXC contains information related to PXC containers in Percona XtraDB cluster.

type ProxySQL added in v0.1.2

type ProxySQL struct {
	ComputeResources *ComputeResources
}

ProxySQL contains information related to ProxySQL containers in Percona XtraDB cluster.

type XtraDBCluster

type XtraDBCluster struct {
	Name     string
	Size     int32
	State    ClusterState
	PXC      *PXC
	ProxySQL *ProxySQL
}

XtraDBCluster contains information related to xtradb cluster.

type XtraDBParams

type XtraDBParams struct {
	Name     string
	Size     int32
	PXC      *PXC
	ProxySQL *ProxySQL
}

XtraDBParams contains all parameters required to create or update Percona XtraDB cluster.

Directories

Path Synopsis
Package kubectl provides kubectl CLI wrapper.
Package kubectl provides kubectl CLI wrapper.

Jump to

Keyboard shortcuts

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