Documentation ¶
Index ¶
- Constants
- Variables
- func GetImageURL(arti harbor_api.ArtifactURI) string
- func ListDeployments()
- func ListNodes()
- func ListPods()
- func NewContainer(c *ContainerConfig) *corev1.Container
- func NewDeployment(c *DeploymentConfig) error
- func SyncPodListByNS(dConf *DeploymentConfig, qDur time.Duration)
- type CallBack
- type ContainerConfig
- type DeploymentConfig
- func (c *DeploymentConfig) CancelCmdArgs(ok bool) *DeploymentConfig
- func (c *DeploymentConfig) CancelUserHost(ok bool) *DeploymentConfig
- func (c *DeploymentConfig) Create() error
- func (c *DeploymentConfig) Delete() error
- func (c *DeploymentConfig) JSONMarshal() string
- func (c *DeploymentConfig) List() error
- func (c *DeploymentConfig) Restart() error
- func (c *DeploymentConfig) SaveConfig() string
- func (c *DeploymentConfig) Stop() (string, error)
- func (c *DeploymentConfig) Update() error
- func (c *DeploymentConfig) WithCmdArgs(cmd []string, args string) *DeploymentConfig
- func (c *DeploymentConfig) WithUserHost(uh UserHostConfig) *DeploymentConfig
- type ResourceConfig
- type UserHostConfig
Constants ¶
View Source
const (
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: 192.168.31.242:8662/kubesphere-io-centos7/haproxy:2.9.6-alpine
func ListDeployments ¶
func ListDeployments()
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 *UserHostConfig }
Container Config Declaration in Pod
type DeploymentConfig ¶
type DeploymentConfig struct { Namespace string MetaName string SpecReplicas int32 SpecSelectorLabels map[string]string SpecTemplateLabels map[string]string SpecHostNetwork bool Container *ContainerConfig // do after kube api CallBack *CallBack `json:"CallBack,omitempty"` // 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 ¶
func (c *DeploymentConfig) WithUserHost(uh UserHostConfig) *DeploymentConfig
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 }
Container Resource Declaration in Pod
type UserHostConfig ¶
User Host Declaration in Pod
Click to show internal directories.
Click to hide internal directories.