-
Notifications
You must be signed in to change notification settings - Fork 418
update k8s domain configuration, add cluster entity upsert logic, fix journal tail mode on Ubuntu #2270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- update k8s domain configuration
- add cluster entity upsert logic
- fix journal tail mode on Ubuntu
pkg/flags/flags.go
Outdated
@@ -141,6 +141,8 @@ var ( | |||
DeployMode = flag.String("DEPLOY_MODE", DeployDaemonset, "alibaba log deploy mode, daemonset or statefulset or singleton") | |||
EnableKubernetesMeta = flag.Bool("ENABLE_KUBERNETES_META", false, "enable kubernetes meta") | |||
ClusterID = flag.String("GLOBAL_CLUSTER_ID", "", "cluster id") | |||
ClusterName = flag.String("GLOBAL_CLUSTER_NAME", "", "cluster name") | |||
ClusterRegion = flag.String("GLOBAL_CLUSTER_REGION", "", "cluster region") | |||
ClusterType = flag.String("GLOBAL_CLUSTER_TYPE", "", "cluster type, supporting ack, one, asi and k8s") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个还有用吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个需要的,clusterName和region都由接入测注入
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastSendClusterTime = time.Now() | ||
} | ||
|
||
clusterEntity := m.generateClusterEntity() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不用每次都生成,可以存起来
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
虽然entity的属性没有变化,但是observe的时间是在不断变化的,如果observe的时间不是近期的,那么实体就失效了,因此需要每次都生成
acsDomain = "acs" | ||
infraDomain = "infra" | ||
|
||
k8sDomain = "k8s" | ||
ackCluster = "ack" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些还需要吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acs和infra都删除了,clusterType如果不配默认就是k8s,支持后续配置拓展
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acsDomain = "acs" | ||
infraDomain = "infra" | ||
|
||
k8sDomain = "k8s" | ||
ackCluster = "ack" | ||
> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删掉这些吧
@@ -401,13 +403,15 @@ func (m *metaCollector) generateClusterEntity() models.PipelineEvent { | |||
log.Timestamp = uint64(time.Now().Unix()) | |||
log.Contents.Add(entityDomainFieldName, m.serviceK8sMeta.domain) | |||
log.Contents.Add(entityTypeFieldName, m.genEntityTypeKey(clusterTypeName)) | |||
log.Contents.Add(entityIDFieldName, m.genKey("", "", "")) | |||
log.Contents.Add(entityIDFieldName, m.genKey(clusterTypeName, "", "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind