Documentation ¶
Index ¶
- Variables
- func CheckVersionInfo(version *model.VersionInfo) bool
- func NewListWatchPodFromClient(c cache.Getter) *cache.ListWatch
- func Replicas(n int) []byte
- type CacheManager
- type DeploymentBuild
- type K8sServiceBuild
- func (k *K8sServiceBuild) Build() ([]*v1.Service, error)
- func (k *K8sServiceBuild) BuildOnPort(p int, isOut bool) (*v1.Service, error)
- func (k *K8sServiceBuild) CreateUpstreamPluginMappingPort(ports []*model.TenantServicesPort, ...) ([]*model.TenantServicesPort, map[int32]int, error)
- func (k *K8sServiceBuild) CreateUpstreamPluginMappingService(services []*v1.Service, pp map[int32]int) ([]*v1.Service, error)
- func (k *K8sServiceBuild) GetTenantID() string
- type Manager
- type PodCacheManager
- type PodStatus
- type PodTemplateSpecBuild
- func (p *PodTemplateSpecBuild) Build() (*v1.PodTemplateSpec, error)
- func (p *PodTemplateSpecBuild) CreateUpstreamPluginMappingPort(ports []*model.TenantServicesPort, ...) ([]*model.TenantServicesPort, error)
- func (p *PodTemplateSpecBuild) GetService() *model.TenantServices
- func (p *PodTemplateSpecBuild) GetTenant() *model.Tenants
- type ReplicationControllerBuild
- type StatefulSetBuild
Constants ¶
This section is empty.
Variables ¶
var ErrNotDeploy = errors.New("not deploy")
ErrNotDeploy 未部署错误
var ErrTimeOut = errors.New("time out")
ErrTimeOut 超时
var Replicas0 = []byte(`{"spec":{"replicas":0}}`)
Replicas0 petch replicas to 0
Functions ¶
func CheckVersionInfo ¶
func CheckVersionInfo(version *model.VersionInfo) bool
CheckVersionInfo CheckVersionInfo
func NewListWatchPodFromClient ¶
NewListWatchPodFromClient creates a new ListWatch from the specified client, resource, namespace and field selector.
Types ¶
type CacheManager ¶
type CacheManager struct {
// contains filtered or unexported fields
}
CacheManager cache管理器
type DeploymentBuild ¶
type DeploymentBuild struct {
// contains filtered or unexported fields
}
DeploymentBuild DeploymentBuild
func DeploymentBuilder ¶
func DeploymentBuilder(serviceID string, logger event.Logger, nodeAPI string) (*DeploymentBuild, error)
DeploymentBuilder DeploymentBuilder
func (*DeploymentBuild) Build ¶
func (s *DeploymentBuild) Build() (*v1beta1.Deployment, error)
Build 构建
type K8sServiceBuild ¶
type K8sServiceBuild struct {
// contains filtered or unexported fields
}
K8sServiceBuild K8sServiceBuild
func K8sServiceBuilder ¶
func K8sServiceBuilder(serviceID, replicationType string, logger event.Logger) (*K8sServiceBuild, error)
K8sServiceBuilder 构建应用对应的k8s service
func (*K8sServiceBuild) Build ¶
func (k *K8sServiceBuild) Build() ([]*v1.Service, error)
Build 构建应用的所有端口服务
func (*K8sServiceBuild) BuildOnPort ¶
BuildOnPort 指定端口创建Service
func (*K8sServiceBuild) CreateUpstreamPluginMappingPort ¶
func (k *K8sServiceBuild) CreateUpstreamPluginMappingPort( ports []*model.TenantServicesPort, pluginPorts []*model.TenantServicesStreamPluginPort, ) ( []*model.TenantServicesPort, map[int32]int, error)
CreateUpstreamPluginMappingPort 检查是否存在upstream插件,接管入口网络
func (*K8sServiceBuild) CreateUpstreamPluginMappingService ¶
func (k *K8sServiceBuild) CreateUpstreamPluginMappingService(services []*v1.Service, pp map[int32]int) ( []*v1.Service, error)
CreateUpstreamPluginMappingService 增加service plugin mapport 标签
func (*K8sServiceBuild) GetTenantID ¶
func (k *K8sServiceBuild) GetTenantID() string
GetTenantID 获取租户ID
type Manager ¶
type Manager interface { StartStatefulSet(serviceID string, logger event.Logger) (*v1beta1.StatefulSet, error) StopStatefulSet(serviceID string, logger event.Logger) error //TODO: 实现滚动升级,目前无滚动升级,采用重启操作 RollingUpgradeStatefulSet(serviceID string, logger event.Logger) (*v1beta1.StatefulSet, error) StartReplicationController(serviceID string, logger event.Logger) (*v1.ReplicationController, error) StopReplicationController(serviceID string, logger event.Logger) error RollingUpgradeReplicationController(serviceID string, stopChan chan struct{}, logger event.Logger) (*v1.ReplicationController, error) StartDeployment(serviceID string, logger event.Logger) (*v1beta1.Deployment, error) StopDeployment(serviceID string, logger event.Logger) error //TODO: RollingUpgradeDeployment(serviceID string, logger event.Logger) (*v1beta1.Deployment, error) HorizontalScaling(serviceID string, oldReplicas int32, logger event.Logger) error StartService(serviceID string, logger event.Logger, ReplicationID, ReplicationType string) error UpdateService(serviceID string, logger event.Logger, ReplicationID, ReplicationType string) error StopService(serviceID string, logger event.Logger) error //StartServiceByPort(serviceID string, port int, isOut bool, logger event.Logger) error StopServiceByPort(serviceID string, port int, isOut bool, logger event.Logger) error SyncData() Stop() }
Manager kubeapi
func NewManager ¶
NewManager 创建manager
type PodCacheManager ¶
type PodCacheManager struct {
// contains filtered or unexported fields
}
PodCacheManager pod缓存
func NewPodCacheManager ¶
func NewPodCacheManager(kubeclient *kubernetes.Clientset) *PodCacheManager
NewPodCacheManager 创建pod缓存器
func (*PodCacheManager) RemoveWatch ¶
func (c *PodCacheManager) RemoveWatch(w *cacheWatch)
RemoveWatch 移除watch
type PodStatus ¶
type PodStatus struct { PodName string PodScheduled string PodScheduledError int Initialized string Ready string // contains filtered or unexported fields }
PodStatus pod状态
type PodTemplateSpecBuild ¶
type PodTemplateSpecBuild struct { NodeAPI string // contains filtered or unexported fields }
PodTemplateSpecBuild pod build
func PodTemplateSpecBuilder ¶
func PodTemplateSpecBuilder(serviceID string, logger event.Logger, nodeAPI string) (*PodTemplateSpecBuild, error)
PodTemplateSpecBuilder pod builder
func (*PodTemplateSpecBuild) Build ¶
func (p *PodTemplateSpecBuild) Build() (*v1.PodTemplateSpec, error)
Build 通过service 构建pod template
func (*PodTemplateSpecBuild) CreateUpstreamPluginMappingPort ¶
func (p *PodTemplateSpecBuild) CreateUpstreamPluginMappingPort( ports []*model.TenantServicesPort, pluginPorts []*model.TenantServicesStreamPluginPort, ) ( []*model.TenantServicesPort, error)
CreateUpstreamPluginMappingPort 检查是否存在upstream插件,接管入口网络
func (*PodTemplateSpecBuild) GetService ¶
func (p *PodTemplateSpecBuild) GetService() *model.TenantServices
GetService get service
func (*PodTemplateSpecBuild) GetTenant ¶
func (p *PodTemplateSpecBuild) GetTenant() *model.Tenants
GetTenant get tenant
type ReplicationControllerBuild ¶
type ReplicationControllerBuild struct {
// contains filtered or unexported fields
}
ReplicationControllerBuild ReplicationControllerBuild
func ReplicationControllerBuilder ¶
func ReplicationControllerBuilder(serviceID string, logger event.Logger, nodeAPI string) (*ReplicationControllerBuild, error)
ReplicationControllerBuilder ReplicationControllerBuilder
func (*ReplicationControllerBuild) Build ¶
func (s *ReplicationControllerBuild) Build() (*v1.ReplicationController, error)
Build 构建
func (*ReplicationControllerBuild) GetTenant ¶
func (s *ReplicationControllerBuild) GetTenant() string
GetTenant 获取租户id
type StatefulSetBuild ¶
type StatefulSetBuild struct {
// contains filtered or unexported fields
}
StatefulSetBuild StatefulSetBuild
func StatefulSetBuilder ¶
func StatefulSetBuilder(serviceID string, logger event.Logger, nodeAPI string) (*StatefulSetBuild, error)
StatefulSetBuilder StatefulSetBuilder
func (*StatefulSetBuild) Build ¶
func (s *StatefulSetBuild) Build() (*v1beta1.StatefulSet, error)
Build 构建