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 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 *cmd_args.UserHostConfig) *DeploymentConfig
- type ResourceConfig
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 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 ¶
func (c *DeploymentConfig) WithUserHost(uh *cmd_args.UserHostConfig) *DeploymentConfig
type ResourceConfig ¶
Click to show internal directories.
Click to hide internal directories.