entities

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentJob_Deploy_Master                  = "MASTER"
	AgentJob_Deploy_ETCD                    = "ETCD"
	AgentJob_Deploy_Minion                  = "Minion"
	AgentJob_Deploy_HA                      = "HA"
	AgentJob_Deploy_NetworkStack_KubeRouter = "Kube-Router"
	AgentJob_NOP                            = "NOP"
	AgentStatus_Registered                  = "New"
	AgentStatus_Running                     = "Running"
	AgentStatus_Provisioning                = "Provisioning"
	AgentStatus_Provision_Succeed           = "Provision Succeed"
	AgentStatus_Provision_Failed            = "Provision Failed"
	AgentReport_Provision                   = "Provision"
	AgentReport_Heartbeat                   = "Heartbeat"
	MaxAgentReportTimeoutSecs               = 30
)
View Source
const (
	AgentRole_Master               = "master"
	AgentRole_ETCD                 = "etcd"
	AgentRole_Minion               = "minion"
	AgentRole_HA                   = "ha"
	ClusterNew                     = "New"
	ClusterProvisioning            = "Provisiong"
	ClusterUncontrollable          = "Uncontrollable"
	ClusterReady                   = "Ready"
	ClusterDeleted                 = "ClusterDeleted"
	ClusterBlockedAgentRegistering = "ClusterBlockedAgentRegistering"

	ConditionConfirmed ConditionCheckedResult
	ConditionNotConfirmed
	ConditionInapplicable
	MasterSettings_PodCIDR               = "pod_ip_cidr"
	MasterSettings_ServiceCIDR           = "service_ip_cidr"
	MasterSettings_ServiceDNSDomain      = "service_dns_domain"
	MasterSettings_KubernetesVersion     = "k8s_version"
	MasterSettings_DockerRegistry        = "docker_registry"
	MasterSettings_DockerExtraGraphPath  = "docker_extra_graph_path"
	MasterSettings_MaxPodCountPerNode    = "max_pod_count"
	MasterSettings_ServiceDNSClusterIP   = "service_dns_cluster_ip"
	MasterSettings_ExpectedETCDNodeCount = "expected_etcd_node_count"
	MasterSettings_APIServerVIP          = "ha_settings"
	NetworkStack_Flannel                 = "flannel"
	NetworkStack_Calico                  = "calico"
	NetworkStack_KubeRouter              = "kuberouter"
	DNS_KubeDNS                          = "kubedns"
	DNS_CoreDNS                          = "coredns"
	EXT_DEPLOYMENT_PROMETHEUS            = "prometheus"
	EXT_DEPLOYMENT_ALTERMANAGER          = "altermanager"
	EXT_DEPLOYMENT_METRICSERVER          = "metric-server"
	EXT_DEPLOYMENT_TRAEFIK               = "traefik"

	AgentStatusFlag_Whatever AgentStatusFlag
	AgentStatusFlag_Running
	AgentStatusFlag_Provisioned
)
View Source
const (
	Succeed                          int = 0
	BizError                         int = 40000
	ParameterError                   int = 40001
	DeserializeError                 int = 40002
	UnsupportedError                 int = 40003
	AuthError                        int = 40004
	OperationFailed                  int = 40005
	ResourceHasBeingDeleted          int = 40006
	NotFound                         int = 40007
	InternalError                    int = 50000
	RESPONSEINFO                         = "HTTP_RESPONSE_INFO"
	DockerImageDownloadType_Registry     = "REGISTRY"
	DockerImageDownloadType_HTTP         = "HTTP"
)

Variables

View Source
var (
	HTTPDockerImageDownloadToken = ""
)

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ClusterId                      string    `json:"cluster_id"`
	MetadataId                     string    `json:"metadata_id"`
	Hostname                       string    `json:"hostname"`
	LastReportIP                   string    `json:"last_report_ip"`
	LastReportStatus               string    `json:"last_report_status"`
	LastReportTime                 time.Time `json:"last_report_time"`
	Reason                         string    `json:"reason"`
	HasProvisionedMasterComponents bool      `json:"provisioned_master_components"`
	MasterComponentsProvisionTime  time.Time `json:"master_components_provision_time"`
	HasProvisionedETCD             bool      `json:"provisioned_etcd"`
	ETCDProvisionTime              time.Time `json:"etcd_provision_time"`
	HasProvisionedMinion           bool      `json:"provisioned_minion"`
	MinionProvisionTime            time.Time `json:"minion_provision_time"`
	IsDelete                       bool      `json:"is_delete"`
	HasETCDRole                    bool      `json:"has_etcd_role"`
	HasMasterRole                  bool      `json:"has_master_role"`
	HasMinionRole                  bool      `json:"has_minion_role"`
	HasHARole                      bool      `json:"has_ha_role"`
}

func (*Agent) IsRunning

func (a *Agent) IsRunning() bool

type AgentJob

type AgentJob struct {
	Name      string            `json:"name"`
	Arguments map[string]string `json:"arguments"`
	Reason    string            `json:"reason"`
	//agent internal status listed blow.
	HadDone            bool
	HealthCheckHandler interface{}
}

type AgentReportStatusResponse

type AgentReportStatusResponse struct {
	Response
	LeaseId int64 `json:"lease_id"`
}

type AgentState

type AgentState struct {
	LastReportIP                   string    `json:"last_report_ip"`
	LastReportTime                 time.Time `json:"last_report_time"`
	Reason                         string    `json:"reason"`
	HasProvisionedMasterComponents bool      `json:"provisioned_master_components"`
	HasProvisionedETCD             bool      `json:"provisioned_etcd"`
	HasProvisionedMinion           bool      `json:"provisioned_minion"`
	HasProvisionedHA               bool      `json:"has_provisioned_ha"`
}

type AgentStatus

type AgentStatus struct {
	ReportType   string `json:"report_type"`
	IP           string `json:"ip"`
	Status       string `json:"status"`
	Reason       string `json:"reason"`
	ReportTarget string `json:"report_target"`
}

type AgentStatusFlag

type AgentStatusFlag int

type Certificate

type Certificate struct {
	Id         *bson.ObjectId `json:"id" bson:"_id"`
	ClusterId  *bson.ObjectId `json:"cluster_id" bson:"cluster_id"`
	Name       string         `json:"name" bson:"name"`
	Content    string         `json:"content" bson:"content"`
	CreateTime time.Time      `json:"create_time" bson:"create_time"`
}

type CertificateCollection

type CertificateCollection []*Certificate

func (CertificateCollection) GetCertificateContent

func (c CertificateCollection) GetCertificateContent(name string) string

type CertificateKeyPair

type CertificateKeyPair struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Cluster

type Cluster struct {
	Id                         *bson.ObjectId        `json:"id" bson:"_id"`
	CreateTime                 time.Time             `json:"create_time" bson:"create_time"`
	HasProvisionedNetworkStack bool                  `json:"has_provisioned_network_stack" bson:"has_provisioned_network_stack"`
	NetworkStackProvisionTime  time.Time             `json:"network_stack_provision_time" bson:"network_stack_provision_time"`
	LastStatusChangeTime       time.Time             `json:"last_status_change_time" bson:"last_status_change_time"`
	Name                       string                `json:"name" bson:"name"`
	ExpectedETCDCount          int                   `json:"expected_etcd_count" bson:"expected_etcd_count"`
	ServiceCIDR                string                `json:"service_cidr" bson:"service_cidr"`
	KubernetesVersion          string                `json:"kubernetes_version" bson:"kubernetes_version"`
	PodNetworkCIDR             string                `json:"pod_network_cidr" bson:"pod_network_cidr"`
	SecurityToken              string                `json:"security_token" bson:"security_token"`
	Status                     string                `json:"status" bson:"status"`
	ServiceDNSDomain           string                `json:"service_dns_domain" bson:"service_dns_domain"`
	NetworkStack               *NetworkStackSettings `json:"network_stack" bson:"network_stack"`
}

type ClusterStatus

type ClusterStatus struct {
	Status string `json:"status"`
	Reason string `json:"reason"`
}

type ConditionCheckedResult

type ConditionCheckedResult int

type CreateClusterResponse

type CreateClusterResponse struct {
	Response
	ClusterId string `json:"cluster_id"`
}

type DNSDeploymentSettings added in v0.0.43

type DNSDeploymentSettings struct {
	Type       string            `json:"type"` //kubedns,coredns...
	Attributes map[string]string `json:"attributes" bson:"attributes"`
}

type DockerImage

type DockerImage struct {
	DownloadAddr string `json:"download_addr"` //remote download address.
	ImageName    string `json:"image_name"`    //used for tagging a docker image as expected name on the local machine.
}

type DockerImageCollection

type DockerImageCollection struct {
	DownloadType      string                 `json:"download_type"` //"REGISTRY", "HTTP"
	HTTPDownloadToken string                 `json:"http_download_token"`
	Images            map[string]DockerImage `json:"images"`
}

type GetCertificateResponse

type GetCertificateResponse struct {
	Response
	Content     string `json:"content"`
	ForceUpdate bool   `json:"force_update"`
}

type GetClusterComponentStatusResponse added in v0.0.64

type GetClusterComponentStatusResponse struct {
	Response
	WatchPoints []monitors.WatchPoint `json:"status"`
}

type GetNextAgentJobResponse

type GetNextAgentJobResponse struct {
	Response
	Job *AgentJob `json:"job"`
}

type HASettings added in v0.0.72

type HASettings struct {
	VIP       string `json:"vip"`
	RouterID  string `json:"router_id"`
	NodeCount int    `json:"count"`
}

type LightningMonkeyAgent

type LightningMonkeyAgent struct {
	Id               string      `json:"id" bson:"_id"`
	ClusterId        string      `json:"cluster_id" bson:"cluster_id"`
	AdminCertificate string      `json:"admin_certificate"` //not exist if it has not master role.
	Hostname         string      `json:"hostname" bson:"hostname"`
	IsDelete         bool        `json:"is_delete" bson:"is_delete"`
	HasETCDRole      bool        `json:"has_etcd_role" bson:"has_etcd_role"`
	HasMasterRole    bool        `json:"has_master_role" bson:"has_master_role"`
	HasMinionRole    bool        `json:"has_minion_role" bson:"has_minion_role"`
	HasHARole        bool        `json:"has_ha_role"`
	State            *AgentState `json:"-"`
}

func (*LightningMonkeyAgent) HasInitializedRoles added in v0.0.72

func (a *LightningMonkeyAgent) HasInitializedRoles() bool

func (*LightningMonkeyAgent) IsRunning

func (a *LightningMonkeyAgent) IsRunning() bool

type LightningMonkeyAgentReportStatus

type LightningMonkeyAgentReportStatus struct {
	IP      string                                          `json:"ip"`
	Items   map[string]LightningMonkeyAgentReportStatusItem `json:"items"`
	LeaseId int64                                           `json:"lease_id"`
}

type LightningMonkeyAgentReportStatusItem

type LightningMonkeyAgentReportStatusItem struct {
	HasProvisioned bool      `json:"has_provisioned"`
	Reason         string    `json:"reason"`
	LastSeenTime   time.Time `json:"last_seen_time"`
}

type LightningMonkeyCertificateCollection

type LightningMonkeyCertificateCollection []*CertificateKeyPair

func (LightningMonkeyCertificateCollection) GetCertificateContent

func (c LightningMonkeyCertificateCollection) GetCertificateContent(name string) string

type LightningMonkeyClusterSettings

type LightningMonkeyClusterSettings struct {
	Id                            string                       `json:"id"`
	CreateTime                    time.Time                    `json:"create_time"`
	Name                          string                       `json:"name"`
	ExpectedETCDCount             int                          `json:"expected_etcd_count"`
	ServiceCIDR                   string                       `json:"service_cidr"`
	KubernetesVersion             string                       `json:"kubernetes_version"`
	PodNetworkCIDR                string                       `json:"pod_network_cidr"`
	SecurityToken                 string                       `json:"security_token"`
	ServiceDNSDomain              string                       `json:"service_dns_domain"`
	ServiceDNSClusterIP           string                       `json:"service_dns_cluster_ip"`
	MaximumAllowedPodCountPerNode int                          `json:"maximum_allowed_pod_count_per_node"`
	NetworkStack                  *NetworkStackSettings        `json:"network_stack"`
	DNSSettings                   *DNSDeploymentSettings       `json:"dns_deployment_settings"`
	HASettings                    *HASettings                  `json:"ha_settings"`
	ExtensionalDeployments        map[string]map[string]string `json:"ext_deployments"`
	ExtraDockerGraphPath          string                       `json:"extra_docker_graph_path"`
}

type NetworkStackSettings

type NetworkStackSettings struct {
	Type       string            `json:"type"` //flannel, kube-router, calico...
	Attributes map[string]string `json:"attributes" bson:"attributes"`
}

type RegisterAgentResponse

type RegisterAgentResponse struct {
	Response
	AgentId        string                `json:"agent_id"`
	BasicImages    DockerImageCollection `json:"image_collection"`
	MasterSettings map[string]string     `json:"master_settings"`
	LeaseId        int64                 `json:"lease_id"`
}

type Response

type Response struct {
	ErrorId     int    `json:"error-id"`
	Description string `json:"desc,omitempty"`
	Reason      string `json:"reason"`
	NeedCrash   bool   `json:"need_crash"`
}

Jump to

Keyboard shortcuts

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