Documentation ¶
Index ¶
- Constants
- func GetTickFromFlags() int
- func NewDB() (*memdb.MemDB, error)
- type Annotations
- type Capabilities
- type Conditions
- type ConfigMap
- type ContainerStatuses
- type Containers
- type ElasticClient
- type EmptyDir
- type Env
- type Exec
- type FieldRef
- type ImagePullSecrets
- type InitContainerStatuses
- type InitContainers
- type Labels
- type LastState
- type LivenessProbe
- type LogMessage
- type LogRequestError
- type LogWatcher
- type Metadata
- type NodeSelector
- type Object
- type OwnerReferences
- type PersistentVolumeClaim
- type PodLogs
- func (p *PodLogs) Add(pod string, ch chan bool)
- func (p *PodLogs) AddWatcherToDb(pod string) (chan bool, error)
- func (p *PodLogs) Del(pod string)
- func (p *PodLogs) DelWatcherFromDB(pod string) error
- func (p *PodLogs) GetWatcherFromDB(pod string) (*LogWatcher, error)
- func (p *PodLogs) GetWatchersFromDBLen() int
- func (p *PodLogs) IsWatcherInTheDB(pod string) (bool, *LogWatcher, error)
- func (p *PodLogs) Len() int
- func (p *PodLogs) NewSender() (err error)
- func (p *PodLogs) PodTicker()
- func (p *PodLogs) Run(pod string, ch chan bool, con string)
- func (p *PodLogs) Shutdown(pod, con string)
- func (p *PodLogs) Stop(ch chan bool)
- func (p *PodLogs) Watch()
- type Ports
- type ReadinessProbe
- type Resources
- type Running
- type SeLinuxOptions
- type Secret
- type SecretKeyRef
- type SecurityContext
- type Sender
- type SenderClient
- type SenderConfig
- type Spec
- type State
- type Status
- type TCPClient
- type Terminated
- type ValueFrom
- type VolumeMounts
- type Volumes
- type WatchEvent
Constants ¶
View Source
const ( TAIL_LOGS_METHOD string = "tail" FOLLOW_LOGS_METHOD string = "follow" MAX_TAIL_LOGGERS int = 15 )
View Source
const ( ELASTIC_ENV_USERNAME = "KUBEAT_ELASTIC_USERNAME" ELASTIC_ENV_PASSWORD = "KUBEAT_ELASTIC_PASSWORD" )
Variables ¶
This section is empty.
Functions ¶
func GetTickFromFlags ¶
func GetTickFromFlags() int
Types ¶
type Annotations ¶
type Capabilities ¶
type Capabilities struct {
Drop []string `json:"drop"`
}
type Conditions ¶
type ContainerStatuses ¶
type ContainerStatuses struct { Name string `json:"name"` State State `json:"state"` Ready bool `json:"ready"` RestartCount int `json:"restartCount"` Image string `json:"image"` ImageID string `json:"imageID"` ContainerID string `json:"containerID"` LastState LastState `json:"lastState,omitempty"` }
type Containers ¶
type Containers struct { Name string `json:"name"` Image string `json:"image"` Command []string `json:"command"` Args []string `json:"args,omitempty"` Ports []Ports `json:"ports"` Resources Resources `json:"resources"` VolumeMounts []VolumeMounts `json:"volumeMounts"` LivenessProbe LivenessProbe `json:"livenessProbe"` ReadinessProbe ReadinessProbe `json:"readinessProbe,omitempty"` TerminationMessagePath string `json:"terminationMessagePath"` TerminationMessagePolicy string `json:"terminationMessagePolicy"` ImagePullPolicy string `json:"imagePullPolicy"` SecurityContext SecurityContext `json:"securityContext"` Env []Env `json:"env,omitempty"` }
type ElasticClient ¶
func (*ElasticClient) Connect ¶
func (e *ElasticClient) Connect(conf *SenderConfig) (err error)
func (*ElasticClient) Push ¶
func (e *ElasticClient) Push(l map[int64]LogMessage) error
type ImagePullSecrets ¶
type ImagePullSecrets struct {
Name string `json:"name"`
}
type InitContainerStatuses ¶
type InitContainers ¶
type InitContainers struct { Name string `json:"name"` Image string `json:"image"` Command []string `json:"command,omitempty"` Args []string `json:"args"` Resources Resources `json:"resources"` VolumeMounts []VolumeMounts `json:"volumeMounts"` TerminationMessagePath string `json:"terminationMessagePath"` TerminationMessagePolicy string `json:"terminationMessagePolicy"` ImagePullPolicy string `json:"imagePullPolicy"` SecurityContext SecurityContext `json:"securityContext"` Env []Env `json:"env,omitempty"` }
type LastState ¶
type LastState struct {
Terminated Terminated `json:"terminated"`
}
type LivenessProbe ¶
type LogMessage ¶
type LogRequestError ¶
type LogRequestError struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Metadata interface{} `json:"metadata"` Status string `json:"status"` Message string `json:"message"` Reason string `json:"reason"` Code int `json:"code"` }
func (*LogRequestError) Containers ¶
func (l *LogRequestError) Containers() (containers []string)
func (*LogRequestError) IsContanerCreating ¶
func (l *LogRequestError) IsContanerCreating() bool
type LogWatcher ¶
type Metadata ¶
type Metadata struct { Name string `json:"name"` GenerateName string `json:"generateName"` Namespace string `json:"namespace"` SelfLink string `json:"selfLink"` UID string `json:"uid"` ResourceVersion string `json:"resourceVersion"` CreationTimestamp time.Time `json:"creationTimestamp"` Labels Labels `json:"labels"` Annotations Annotations `json:"annotations"` OwnerReferences []OwnerReferences `json:"ownerReferences"` }
type NodeSelector ¶
type NodeSelector struct {
NodeRoleKubernetesIoCompute string `json:"node-role.kubernetes.io/compute"`
}
type OwnerReferences ¶
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct {
ClaimName string `json:"claimName"`
}
type PodLogs ¶
type PodLogs struct { Channels map[string]chan bool Client *kubernetes.Clientset Config *rest.Config Ignored string Namespace string SkipVerify bool EnableWatcher bool // contains filtered or unexported fields }
func NewPodLogs ¶
func (*PodLogs) AddWatcherToDb ¶
AddWatcherToDb adds a watcher record into DB
func (*PodLogs) DelWatcherFromDB ¶
DelWatcherFromDB removes a watcher record from the DB
func (*PodLogs) GetWatcherFromDB ¶
func (p *PodLogs) GetWatcherFromDB(pod string) (*LogWatcher, error)
GetWatcherFromDB returns a watcher from the DB
func (*PodLogs) GetWatchersFromDBLen ¶
GetWatchersFromDBLen retunrns the logwatchers count
func (*PodLogs) IsWatcherInTheDB ¶
func (p *PodLogs) IsWatcherInTheDB(pod string) (bool, *LogWatcher, error)
IsWatcherInTheDB checks the watcher already in the DB
type ReadinessProbe ¶
type SeLinuxOptions ¶
type SeLinuxOptions struct {
Level string `json:"level"`
}
type SecretKeyRef ¶
type SecurityContext ¶
type SecurityContext struct {
Capabilities Capabilities `json:"capabilities"`
}
type Sender ¶
type Sender struct { Client SenderClient Config *SenderConfig // contains filtered or unexported fields }
type SenderClient ¶
type SenderClient interface { Connect(*SenderConfig) error Push(map[int64]LogMessage) error }
type SenderConfig ¶
type SenderConfig struct { Type string `json:"type"` Hosts []string `json:"hosts"` Username string `json:"username"` Password string `json:"password"` Index string `json:"index"` DocType string `json:"doc_type"` Limit int `json:"limit"` }
func GetSenderConfigFromFlags ¶
func GetSenderConfigFromFlags() *SenderConfig
type Spec ¶
type Spec struct { Volumes []Volumes `json:"volumes"` InitContainers []InitContainers `json:"initContainers"` Containers []Containers `json:"containers"` RestartPolicy string `json:"restartPolicy"` TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds"` DNSPolicy string `json:"dnsPolicy"` NodeSelector NodeSelector `json:"nodeSelector"` ServiceAccountName string `json:"serviceAccountName"` ServiceAccount string `json:"serviceAccount"` NodeName string `json:"nodeName"` SecurityContext SecurityContext `json:"securityContext"` ImagePullSecrets []ImagePullSecrets `json:"imagePullSecrets"` Hostname string `json:"hostname"` Subdomain string `json:"subdomain"` SchedulerName string `json:"schedulerName"` Priority int `json:"priority"` }
type State ¶
type State struct { Running Running `json:"running"` Terminated Terminated `json:"terminated"` }
type Status ¶
type Status struct { Phase string `json:"phase"` Conditions []Conditions `json:"conditions"` HostIP string `json:"hostIP"` PodIP string `json:"podIP"` StartTime time.Time `json:"startTime"` InitContainerStatuses []InitContainerStatuses `json:"initContainerStatuses"` ContainerStatuses []ContainerStatuses `json:"containerStatuses"` QosClass string `json:"qosClass"` }
type TCPClient ¶
func (*TCPClient) Connect ¶
func (t *TCPClient) Connect(conf *SenderConfig) (err error)
type Terminated ¶
type VolumeMounts ¶
type Volumes ¶
type Volumes struct { Name string `json:"name"` PersistentVolumeClaim PersistentVolumeClaim `json:"persistentVolumeClaim,omitempty"` ConfigMap ConfigMap `json:"configMap,omitempty"` Secret Secret `json:"secret,omitempty"` EmptyDir EmptyDir `json:"emptyDir,omitempty"` }
type WatchEvent ¶
func (WatchEvent) Name ¶
func (e WatchEvent) Name() string
func (WatchEvent) State ¶
func (e WatchEvent) State() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.