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:
parent
8d75c08131
commit
42a2ef035d
4 changed files with 14 additions and 0 deletions
Documentation
pkg
|
@ -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
|
||||
|
||||
|
|
|
@ -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`
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue