Skip to content

Commit

Permalink
feature:
Browse files Browse the repository at this point in the history
1. support declaring multiple container configs in the same CRD. issue TencentBlueKing#688
2. support mapping path of container which is mounted from host into path of host which is mount source. issue TencentBlueKing#689
3. support windows container log collection. issue TencentBlueKing#690
4. support host mode. issue TencentBlueKing#691
5. support pruning symbolic link in log collection path. issue TencentBlueKing#692
  • Loading branch information
AlexAi27 committed Dec 9, 2020
1 parent 37e2ff9 commit 1b1b642
Show file tree
Hide file tree
Showing 10 changed files with 385 additions and 85 deletions.
2 changes: 2 additions & 0 deletions bcs-services/bcs-logbeat-sidecar/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ func setConfig(conf *config.Config, op *options.SidecarOption) {
conf.TemplateFile = op.TemplateFile
conf.LogbeatDir = op.LogbeatDir
conf.Kubeconfig = op.Kubeconfig
conf.EvalSymlink = op.EvalSymlink
conf.LogbeatPIDFilePath = op.LogbeatPIDFilePath
}
12 changes: 7 additions & 5 deletions bcs-services/bcs-logbeat-sidecar/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ type SidecarOption struct {
conf.LogConfig
conf.ProcessConfig

DockerSock string `json:"docker_sock" value:"unix:///var/run/docker.sock" usage:"docker socket file"`
LogbeatDir string `json:"logbeat_dir" value:"" usage:"logbeat config directory"`
TemplateFile string `json:"template_file" value:"./unifytlogc-template.conf" usage:"logbeat tempalte config file"`
PrefixFile string `json:"prefix_file" value:"" usage:"logbeat config file prefix name"`
Kubeconfig string `json:"kubeconfig" value:"" usage:"kubeconfig"`
DockerSock string `json:"docker_sock" value:"unix:///var/run/docker.sock" usage:"docker socket file"`
LogbeatDir string `json:"logbeat_dir" value:"" usage:"logbeat config directory"`
TemplateFile string `json:"template_file" value:"./unifytlogc-template.conf" usage:"logbeat tempalte config file"`
PrefixFile string `json:"prefix_file" value:"" usage:"logbeat config file prefix name"`
Kubeconfig string `json:"kubeconfig" value:"" usage:"kubeconfig"`
EvalSymlink bool `json:"eval_symlink" value:"false" usage:"whether to enable remove symbol link in the log path"`
LogbeatPIDFilePath string `json:"logbeat_pid_file_path" value:"" usage:"logbeat PID file path, which is used to reload logbeat"`
}

//NewSidecarOption create SidecarOption object
Expand Down
5 changes: 5 additions & 0 deletions bcs-services/bcs-logbeat-sidecar/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ type Config struct {
PrefixFile string
//kube-apiserver config file path
Kubeconfig string
// whether to enable remove symbol link in the log path
// this should be false if deployed as in-cluster mode
EvalSymlink bool
// logbeat PID file path
LogbeatPIDFilePath string
}

//NewConfig create a config object
Expand Down
5 changes: 5 additions & 0 deletions bcs-services/bcs-logbeat-sidecar/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ replace (

require (
github.com/Tencent/bk-bcs v0.0.0-20200805130634-8a6c639f4a4c
github.com/containerd/containerd v1.4.3 // indirect
github.com/docker/docker v20.10.0-rc1+incompatible // indirect
github.com/fsouza/go-dockerclient v1.6.5
github.com/moby/sys/mount v0.2.0 // indirect
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
gopkg.in/yaml.v2 v2.3.0
gotest.tools/v3 v3.0.3 // indirect
k8s.io/api v0.18.6
k8s.io/apiextensions-apiserver v0.18.6
k8s.io/apimachinery v0.18.6
Expand Down
Loading

0 comments on commit 1b1b642

Please sign in to comment.