mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 03:38:43 +00:00
pkg/alertmanager: add ability to specify -web.external-url
This commit is contained in:
parent
92947e95a1
commit
cc74f51486
2 changed files with 12 additions and 0 deletions
pkg
|
@ -117,6 +117,11 @@ func makeStatefulSetSpec(a *spec.Alertmanager) v1beta1.StatefulSetSpec {
|
|||
fmt.Sprintf("-mesh.listen-address=:%d", 6783),
|
||||
fmt.Sprintf("-storage.path=%s", "/etc/alertmanager/data"),
|
||||
}
|
||||
|
||||
if a.Spec.ExternalURL != "" {
|
||||
commands = append(commands, "-web.external-url="+a.Spec.ExternalURL)
|
||||
}
|
||||
|
||||
for i := int32(0); i < a.Spec.Replicas; i++ {
|
||||
commands = append(commands, fmt.Sprintf("-mesh.peer=%s-%d.%s.%s.svc", a.Name, i, "alertmanager", a.Namespace))
|
||||
}
|
||||
|
|
|
@ -144,6 +144,13 @@ type AlertmanagerSpec struct {
|
|||
// Storage is the definition of how storage will be used by the Alertmanager
|
||||
// instances.
|
||||
Storage *StorageSpec `json:"storage"`
|
||||
// ExternalURL is the URL under which Alertmanager is externally reachable
|
||||
// (for example, if Alertmanager is served via a reverse proxy). Used for
|
||||
// generating relative and absolute links back to Alertmanager itself. If the
|
||||
// URL has a path portion, it will be used to prefix all HTTP endpoints
|
||||
// served by Alertmanager. If omitted, relevant URL components will be
|
||||
// derived automatically.
|
||||
ExternalURL string `json:"externalUrl,omitempty"`
|
||||
}
|
||||
|
||||
type AlertmanagerList struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue