Skip to content

Commit

Permalink
chore: update headless svc labels for the prometheus scrape job (#8088)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophon-zt authored and wangyelei committed Sep 19, 2024
1 parent 06065d9 commit 690d7a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/constant/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ func GetClusterWellKnownLabels(clusterName string) map[string]string {
}
}

// GetKBKnownLabels returns the kb-known labels for the headless svc
func GetKBKnownLabels() map[string]string {
return map[string]string{
AppManagedByLabelKey: AppName,
}
}

// GetComponentWellKnownLabels returns the well-known labels for Component API
func GetComponentWellKnownLabels(clusterName, componentName string) map[string]string {
return map[string]string{
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/instanceset/object_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func buildHeadlessSvc(its workloads.InstanceSet, labels, selectors map[string]st
annotations := ParseAnnotationsOfScope(HeadlessServiceScope, its.Annotations)
hdlBuilder := builder.NewHeadlessServiceBuilder(its.Namespace, getHeadlessSvcName(its.Name)).
AddLabelsInMap(labels).
AddLabelsInMap(constant.GetKBKnownLabels()).
AddSelectorsInMap(selectors).
AddAnnotationsInMap(annotations).
SetPublishNotReadyAddresses(true)
Expand Down

0 comments on commit 690d7a2

Please sign in to comment.