Skip to content
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

fix vmalert default port #659

Merged
merged 2 commits into from
Jun 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions api/v1beta1/vmalert_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ func (cr *VMAlert) Probe() *EmbeddedProbes {
}

func (cr *VMAlert) ProbePath() string {

return buildPathWithPrefixFlag(cr.Spec.ExtraArgs, healthPath)
}

Expand Down Expand Up @@ -407,6 +406,7 @@ func (cr *VMAlert) AsOwner() []metav1.OwnerReference {
},
}
}

func (cr VMAlert) PodAnnotations() map[string]string {
annotations := map[string]string{}
if cr.Spec.PodMetadata != nil {
Expand Down Expand Up @@ -451,6 +451,7 @@ func (cr VMAlert) AllLabels() map[string]string {
func (cr VMAlert) PrefixedName() string {
return fmt.Sprintf("vmalert-%s", cr.Name)
}

func (cr VMAlert) TLSAssetName() string {
return fmt.Sprintf("tls-assets-vmalert-%s", cr.Name)
}
Expand Down Expand Up @@ -495,7 +496,7 @@ func (cr VMAlert) RulesConfigMapSelector() client.ListOption {
func (cr *VMAlert) AsURL() string {
port := cr.Spec.Port
if port == "" {
port = "8880"
port = "8080"
}
return fmt.Sprintf("http://%s.%s.svc:%s", cr.PrefixedName(), cr.Namespace, port)
}
Expand All @@ -518,6 +519,7 @@ func (cr *VMAlert) GetNotifierSelectors() []*DiscoverySelector {
}
return r
}

func init() {
SchemeBuilder.Register(&VMAlert{}, &VMAlertList{})
}
6 changes: 4 additions & 2 deletions api/victoriametrics/v1beta1/vmalert_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ func (cr *VMAlert) Probe() *EmbeddedProbes {
}

func (cr *VMAlert) ProbePath() string {

return buildPathWithPrefixFlag(cr.Spec.ExtraArgs, healthPath)
}

Expand Down Expand Up @@ -407,6 +406,7 @@ func (cr *VMAlert) AsOwner() []metav1.OwnerReference {
},
}
}

func (cr VMAlert) PodAnnotations() map[string]string {
annotations := map[string]string{}
if cr.Spec.PodMetadata != nil {
Expand Down Expand Up @@ -451,6 +451,7 @@ func (cr VMAlert) AllLabels() map[string]string {
func (cr VMAlert) PrefixedName() string {
return fmt.Sprintf("vmalert-%s", cr.Name)
}

func (cr VMAlert) TLSAssetName() string {
return fmt.Sprintf("tls-assets-vmalert-%s", cr.Name)
}
Expand Down Expand Up @@ -495,7 +496,7 @@ func (cr VMAlert) RulesConfigMapSelector() client.ListOption {
func (cr *VMAlert) AsURL() string {
port := cr.Spec.Port
if port == "" {
port = "8880"
port = "8080"
}
return fmt.Sprintf("http://%s.%s.svc:%s", cr.PrefixedName(), cr.Namespace, port)
}
Expand All @@ -518,6 +519,7 @@ func (cr *VMAlert) GetNotifierSelectors() []*DiscoverySelector {
}
return r
}

func init() {
SchemeBuilder.Register(&VMAlert{}, &VMAlertList{})
}
Loading