Allow configuration of Prometheus log level (#2484) (#2487)

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
This commit is contained in:
Gaurav Kumar 2019-03-18 23:04:58 +05:30 committed by Andrew Seigner
parent 3d5e7eeb9d
commit d0bdd4ffb4
9 changed files with 15 additions and 0 deletions

View File

@ -91,6 +91,7 @@ spec:
- "--storage.tsdb.path=/{{.Values.PrometheusVolumeName}}"
- "--storage.tsdb.retention=6h"
- "--config.file=/etc/prometheus/prometheus.yml"
- "--log.level={{.Values.PrometheusLogLevel}}"
readinessProbe:
httpGet:
path: /-/ready

View File

@ -35,6 +35,7 @@ type installConfig struct {
UUID string
CliVersion string
ControllerLogLevel string
PrometheusLogLevel string
ControllerComponentLabel string
CreatedByAnnotation string
EnableTLS bool
@ -149,6 +150,11 @@ func validateAndBuildConfig(options *installOptions) (*installConfig, error) {
return nil, err
}
prometheusLogLevel := options.controllerLogLevel
if prometheusLogLevel == "panic" || prometheusLogLevel == "fatal" {
prometheusLogLevel = "error"
}
return &installConfig{
Namespace: controlPlaneNamespace,
ControllerImage: fmt.Sprintf("%s/controller:%s", options.dockerRegistry, options.linkerdVersion),
@ -162,6 +168,7 @@ func validateAndBuildConfig(options *installOptions) (*installConfig, error) {
UUID: uuid.NewV4().String(),
CliVersion: k8s.CreatedByAnnotationValue(),
ControllerLogLevel: options.controllerLogLevel,
PrometheusLogLevel: prometheusLogLevel,
ControllerComponentLabel: k8s.ControllerComponentLabel,
ControllerUID: options.controllerUID,
CreatedByAnnotation: k8s.CreatedByAnnotation,

View File

@ -33,6 +33,7 @@ func TestRender(t *testing.T) {
UUID: "UUID",
CliVersion: "CliVersion",
ControllerLogLevel: "ControllerLogLevel",
PrometheusLogLevel: "PrometheusLogLevel",
ControllerComponentLabel: "ControllerComponentLabel",
CreatedByAnnotation: "CreatedByAnnotation",
EnableTLS: true,

View File

@ -625,6 +625,7 @@ spec:
- --storage.tsdb.path=/data
- --storage.tsdb.retention=6h
- --config.file=/etc/prometheus/prometheus.yml
- --log.level=info
image: prom/prometheus:v2.7.1
imagePullPolicy: IfNotPresent
livenessProbe:

View File

@ -643,6 +643,7 @@ spec:
- --storage.tsdb.path=/data
- --storage.tsdb.retention=6h
- --config.file=/etc/prometheus/prometheus.yml
- --log.level=info
image: prom/prometheus:v2.7.1
imagePullPolicy: IfNotPresent
livenessProbe:

View File

@ -643,6 +643,7 @@ spec:
- --storage.tsdb.path=/data
- --storage.tsdb.retention=6h
- --config.file=/etc/prometheus/prometheus.yml
- --log.level=info
image: prom/prometheus:v2.7.1
imagePullPolicy: IfNotPresent
livenessProbe:

View File

@ -577,6 +577,7 @@ spec:
- --storage.tsdb.path=/data
- --storage.tsdb.retention=6h
- --config.file=/etc/prometheus/prometheus.yml
- --log.level=info
image: prom/prometheus:v2.7.1
imagePullPolicy: IfNotPresent
livenessProbe:

View File

@ -634,6 +634,7 @@ spec:
- --storage.tsdb.path=/data
- --storage.tsdb.retention=6h
- --config.file=/etc/prometheus/prometheus.yml
- --log.level=info
image: prom/prometheus:v2.7.1
imagePullPolicy: IfNotPresent
livenessProbe:

View File

@ -630,6 +630,7 @@ spec:
- --storage.tsdb.path=/data
- --storage.tsdb.retention=6h
- --config.file=/etc/prometheus/prometheus.yml
- --log.level=PrometheusLogLevel
image: PrometheusImage
imagePullPolicy: ImagePullPolicy
livenessProbe: