pod_api

package
v1.2.43 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerRequestResourceRatio    = 0.5 // request = ratio * limit
	ContainerLimitDiskCacheDefaultGi = 8   // ephemeral 8 GiB
)

move it to yaml config

Variables

View Source
var (
	PodStateSyncingDone = make(chan struct{})
)

Functions

func GetImageURL

func GetImageURL(arti harbor_api.ArtifactURI) string

GetImageURL Example: harbor.local:8662/kubesphere-io-centos7/haproxy:2.9.6-alpine

func ListDeployments

func ListDeployments()

func ListNodes

func ListNodes()

func ListPods

func ListPods()

func NewContainer

func NewContainer(c *ContainerConfig) *corev1.Container

func NewDeployment

func NewDeployment(c *DeploymentConfig) error

func SyncPodListByNS

func SyncPodListByNS(
	dConf *DeploymentConfig,
	qDur time.Duration,
)

Types

type ContainerConfig

type ContainerConfig struct {
	Name            string
	Image           string
	Command         []string
	Args            string
	Ports           []corev1.ContainerPort
	Resource        *ResourceConfig
	SecurityContext *corev1.SecurityContext
	UserHost        *cmd_args.UserHostConfig
}

type DeploymentConfig

type DeploymentConfig struct {
	Namespace  string
	MetaName   string
	MetaLabels map[string]string

	SpecReplicas       int32
	SpecSelectorLabels map[string]string
	SpecTemplateLabels map[string]string
	SpecHostNetwork    bool

	Container *ContainerConfig
	// contains filtered or unexported fields
}

func (*DeploymentConfig) CancelCmdArgs

func (c *DeploymentConfig) CancelCmdArgs(ok bool) *DeploymentConfig

func (*DeploymentConfig) CancelUserHost

func (c *DeploymentConfig) CancelUserHost(ok bool) *DeploymentConfig

func (*DeploymentConfig) Create

func (c *DeploymentConfig) Create() error

func (*DeploymentConfig) Delete

func (c *DeploymentConfig) Delete() error

func (*DeploymentConfig) JSONMarshal

func (c *DeploymentConfig) JSONMarshal() string

func (*DeploymentConfig) List

func (c *DeploymentConfig) List() error

func (*DeploymentConfig) Restart

func (c *DeploymentConfig) Restart() error

func (*DeploymentConfig) SaveConfig

func (c *DeploymentConfig) SaveConfig() string

SaveConfig after SaveConfig, CallBack is nil

func (*DeploymentConfig) Stop

func (c *DeploymentConfig) Stop() (string, error)

func (*DeploymentConfig) Update

func (c *DeploymentConfig) Update() error

func (*DeploymentConfig) WithCmdArgs

func (c *DeploymentConfig) WithCmdArgs(cmd []string, args string) *DeploymentConfig

func (*DeploymentConfig) WithUserHost

type ResourceConfig

type ResourceConfig struct {
	CPU       float64 // VCPU Logical 					 	/Core
	GPU       float64 // VGPU 							 	/Core
	GMem      int64   // VGPU Self VMemory				 	/Byte
	Mem       int64   // VMemory 				  			/Byte
	DiskMount int64   // Volume (Minio Cluster s3fs) mount 	/Byte
	DiskCache int64   // Ephemeral mount 					/Byte

	BindGPU   bool
	BindMount bool
}

Jump to

Keyboard shortcuts

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