k8s

package
v0.0.0-...-4f30a30 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceTypeDeployment .
	ResourceTypeDeployment = "deployment"
	// ResourceTypeStatefulSet .
	ResourceTypeStatefulSet = "stateful set"
	// ResourceTypeReplicaSet .
	ResourceTypeReplicaSet = "replica set"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client struct

func NewClient

func NewClient() (*Client, error)

NewClient .

func (*Client) FindResourceByName

func (c *Client) FindResourceByName(resourceType string, resourceName string) (*CommonResourceInfo, error)

FindResourceByName . Finds resource by name Returns k8s resource specs (name could be different from the one specified by the user)

func (*Client) GetClusterSize

func (c *Client) GetClusterSize() (int, error)

GetClusterSize .

func (*Client) ScaleResource

func (c *Client) ScaleResource(resourceType string, resourceName string, replicas int32) error

ScaleResource .

func (*Client) ValidateResourceType

func (c *Client) ValidateResourceType(resourceType string) (string, error)

ValidateResourceType . Validates resource type Normalize it for Kubernetes

type CommonResourceInfo

type CommonResourceInfo struct {
	Name     string
	Replicas int32
}

CommonResourceInfo - we use this type to combine specs of different resources

Jump to

Keyboard shortcuts

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