1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 11:48:53 +00:00

prometheus: add routePrefix field

This commit is contained in:
Frederic Branczyk 2017-01-27 14:38:31 +01:00
parent 8d75c08131
commit 42a2ef035d
No known key found for this signature in database
GPG key ID: CA14788B1E48B256
4 changed files with 14 additions and 0 deletions
Documentation
pkg
client/monitoring/v1alpha1
prometheus

View file

@ -27,6 +27,8 @@ instances in high availability mode.
| baseImage | The base container image (without tag) to use. | false | string | quay.io/prometheus/alertmanager |
| replicas | Number of Alertmanager instances to deploy. | false | integer (int32) | 1 |
| storage | Configuration of persistent storage volumes to attach to deployed Alertmanager pods. | false | [StorageSpec](prometheus.md#storagespec) | |
| externalUrl | External URL Alertmanager will be reachable under. Used for registering routes. | false | string | |
| paused | If true, the operator won't process any changes affecting the Alertmanager setup | false | bool | false |
## Current state and roadmap

View file

@ -43,6 +43,8 @@ still benefiting from the Operator's capabilities of managing Prometheus setups.
| alerting | Configuration of alerting | false | AlertingSpec | |
| resources | Resource requirements of single Prometheus server | false | [v1.ResourceRequirements](http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_resourcerequirements) | |
| nodeSelector | [Select nodes](https://kubernetes.io/docs/tasks/administer-cluster/assign-pods-nodes/) to be used to run the Prometheus pods on | false | [object](https://kubernetes.io/docs/user-guide/node-selection/) | |
| externalUrl | External URL Prometheus will be reachable under. Used for generating links, and registering routes. | false | string | |
| routePrefix | Prefix used to register routes. Overrides `externalUrl` route. Useful for proxies, that rewrite URLs. | false | string | |
### `StorageSpec`

View file

@ -55,6 +55,11 @@ type PrometheusSpec struct {
// necessary to generate correct URLs. This is necessary if Prometheus is not
// served from root of a DNS name.
ExternalURL string `json:"externalUrl,omitempty"`
// The route prefix Prometheus registers HTTP handlers for. This is useful,
// if using ExternalURL and a proxy is rewriting HTTP routes of a request,
// and the actual ExternalURL is still true, but the server serves requests
// under a different route prefix. For example for use with `kubectl proxy`.
RoutePrefix string `json:"routePrefix,omitempty"`
// Storage spec to specify how storage shall be used.
Storage *StorageSpec `json:"storage,omitempty"`
// Define details regarding alerting.

View file

@ -177,6 +177,11 @@ func makeStatefulSetSpec(p v1alpha1.Prometheus) v1beta1.StatefulSetSpec {
}
}
if p.Spec.RoutePrefix != "" {
promArgs = append(promArgs, "-web.route-prefix="+p.Spec.RoutePrefix)
webRoutePrefix = p.Spec.RoutePrefix
}
localReloadURL := &url.URL{
Scheme: "http",
Host: "localhost:9090",