1
0
Fork 0
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:
Frederic Branczyk 2017-01-02 16:08:12 +01:00
parent 92947e95a1
commit cc74f51486
No known key found for this signature in database
GPG key ID: CA14788B1E48B256
2 changed files with 12 additions and 0 deletions
pkg
alertmanager
spec

View file

@ -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))
}

View file

@ -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 {