diff --git a/stable/prometheus-operator/Chart.yaml b/stable/prometheus-operator/Chart.yaml index 47e4dd149e..f628baccb5 100644 --- a/stable/prometheus-operator/Chart.yaml +++ b/stable/prometheus-operator/Chart.yaml @@ -12,7 +12,7 @@ sources: - https://github.com/coreos/kube-prometheus - https://github.com/coreos/prometheus-operator - https://coreos.com/operators/prometheus -version: 8.16.1 +version: 9.0.0 appVersion: 0.38.1 tillerVersion: ">=2.12.0" home: https://github.com/coreos/prometheus-operator diff --git a/stable/prometheus-operator/README.md b/stable/prometheus-operator/README.md index 4847fed120..ad83049c02 100644 --- a/stable/prometheus-operator/README.md +++ b/stable/prometheus-operator/README.md @@ -126,6 +126,9 @@ invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]s ``` If this error has already been encountered, a `helm history` command can be used to determine which release has worked, then `helm rollback` to the release, then `helm upgrade --force` to this new one +### Upgrading from 8.x.x to 9.x.x +Version 9 of the helm chart removes the existing `additionalScrapeConfigsExternal` in favour of `additionalScrapeConfigsSecret`. This change lets users specify the secret name and secret key to use for the additional scrape configuration of prometheus. This is useful for users that have prometheus-operator as a subchart and also have a template that creates the additional scrape configuration + ## prometheus.io/scrape The prometheus operator does not support annotation-based discovery of services, using the `serviceMonitor` CRD in its place as it provides far more configuration options. For information on how to use servicemonitors, please see the documentation on the coreos/prometheus-operator documentation here: [Running Exporters](https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/running-exporters.md) @@ -276,7 +279,9 @@ The following tables list the configurable parameters of the prometheus-operator | `prometheus.podSecurityPolicy.allowedCapabilities` | Prometheus Pod Security Policy allowed capabilities | `""` | | `prometheus.prometheusSpec.additionalAlertManagerConfigs` | AdditionalAlertManagerConfigs allows for manual configuration of alertmanager jobs in the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#. AlertManager configurations specified are appended to the configurations generated by the Prometheus Operator. As AlertManager configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible AlertManager configs are going to break Prometheus after the upgrade. | `{}` | | `prometheus.prometheusSpec.additionalAlertRelabelConfigs` | AdditionalAlertRelabelConfigs allows specifying additional Prometheus alert relabel configurations. Alert relabel configurations specified are appended to the configurations generated by the Prometheus Operator. Alert relabel configurations specified must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs. As alert relabel configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible alert relabel configs are going to break Prometheus after the upgrade. | `[]` | -| `prometheus.prometheusSpec.additionalScrapeConfigsExternal` | Enable additional scrape configs that are managed externally to this chart. This option requires a secret in the same namespace as Prometheus with the name, `prometheus-operator-prometheus-scrape-confg` and a key of `additional-scrape-configs.yaml`. Note that the prometheus will fail to provision if the correct secret does not exist. | `false` | +| `prometheus.prometheusSpec.additionalScrapeConfigsSecret.enabled` | Enable additional scrape configs that are managed externally to this chart. Note that the prometheus will fail to provision if the correct secret does not exist. | `false` | +| `prometheus.prometheusSpec.additionalScrapeConfigsSecret.name` | Name of the secret that Prometheus should use for the additional scrape configuration. | `""` | +| `prometheus.prometheusSpec.additionalScrapeConfigsSecret.key` | Name of the key inside the secret specified under `additionalScrapeConfigsSecret.name` to be used for the additional scrape configuration. | `""` | | `prometheus.prometheusSpec.additionalScrapeConfigs` | AdditionalScrapeConfigs allows specifying additional Prometheus scrape configurations. Scrape configurations are appended to the configurations generated by the Prometheus Operator. Job configurations must have the form as specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#. As scrape configs are appended, the user is responsible to make sure it is valid. Note that using this feature may expose the possibility to break upgrades of Prometheus. It is advised to review Prometheus release notes to ensure that no incompatible scrape configs are going to break Prometheus after the upgrade. | `[]` | | `prometheus.prometheusSpec.additionalPrometheusSecretsAnnotations` | additionalPrometheusSecretsAnnotations allows to add annotations to the kubernetes secret. This can be useful when deploying via spinnaker to disable versioning on the secret, strategy.spinnaker.io/versioned: 'false' | `{}` | | `prometheus.prometheusSpec.affinity` | Assign custom affinity rules to the prometheus instance https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ | `{}` | diff --git a/stable/prometheus-operator/ci/02-test-without-crds-values.yaml b/stable/prometheus-operator/ci/02-test-without-crds-values.yaml index f1dd74f27d..3df8ea4a5a 100644 --- a/stable/prometheus-operator/ci/02-test-without-crds-values.yaml +++ b/stable/prometheus-operator/ci/02-test-without-crds-values.yaml @@ -4,3 +4,8 @@ prometheusOperator: releaseNamespace: true additional: - kube-system + +prometheus-node-exporter: + service: + targetPort: 9101 + port: 9101 diff --git a/stable/prometheus-operator/templates/prometheus/prometheus.yaml b/stable/prometheus-operator/templates/prometheus/prometheus.yaml index 894b346ddb..5528b25ff2 100644 --- a/stable/prometheus-operator/templates/prometheus/prometheus.yaml +++ b/stable/prometheus-operator/templates/prometheus/prometheus.yaml @@ -201,11 +201,16 @@ spec: imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | indent 4 }} {{- end }} -{{- if or .Values.prometheus.prometheusSpec.additionalScrapeConfigs .Values.prometheus.prometheusSpec.additionalScrapeConfigsExternal }} +{{- if .Values.prometheus.prometheusSpec.additionalScrapeConfigs }} additionalScrapeConfigs: name: {{ template "prometheus-operator.fullname" . }}-prometheus-scrape-confg key: additional-scrape-configs.yaml {{- end }} +{{- if .Values.prometheus.prometheusSpec.additionalScrapeConfigsSecret.enabled }} + additionalScrapeConfigs: + name: {{- .Values.prometheus.prometheusSpec.additionalScrapeConfigsSecret.name }} + key: {{- .Values.prometheus.prometheusSpec.additionalScrapeConfigsSecret.key }} +{{- end }} {{- if .Values.prometheus.prometheusSpec.additionalAlertManagerConfigs }} additionalAlertManagerConfigs: name: {{ template "prometheus-operator.fullname" . }}-prometheus-am-confg diff --git a/stable/prometheus-operator/values.yaml b/stable/prometheus-operator/values.yaml index 155ca783b7..b9db8cd6f8 100644 --- a/stable/prometheus-operator/values.yaml +++ b/stable/prometheus-operator/values.yaml @@ -1864,6 +1864,14 @@ prometheus: # - regex: (kubernetes_io_hostname|failure_domain_beta_kubernetes_io_region|beta_kubernetes_io_os|beta_kubernetes_io_arch|beta_kubernetes_io_instance_type|failure_domain_beta_kubernetes_io_zone) # action: labeldrop + ## If additional scrape configurations are already deployed in a single secret file you can use this section. + ## Expected values are the secret name and key + ## Cannot be used with additionalScrapeConfigs + additionalScrapeConfigsSecret: {} + # enabled: false + # name: + # key: + ## additionalPrometheusSecretsAnnotations allows to add annotations to the kubernetes secret. This can be useful ## when deploying via spinnaker to disable versioning on the secret, strategy.spinnaker.io/versioned: 'false' additionalPrometheusSecretsAnnotations: {} @@ -1926,18 +1934,6 @@ prometheus: ## (permissions, dir tree) on mounted volumes before starting prometheus initContainers: [] - ## Enable additional scrape configs that are managed externally to this chart. Note that the prometheus - ## will fail to provision if the correct secret does not exist. - ## This option requires that you are maintaining a secret in the same namespace as Prometheus with - ## a name of 'prometheus-operator-prometheus-scrape-confg' and a key of 'additional-scrape-configs.yaml' that - ## contains a list of scrape_config's. The name of the secret may vary if you utilize the "fullnameOverride". - ## This feature cannot be used in conjunction with the additionalScrapeConfigs attribute (the helm-generated - ## secret will overwrite your self-maintained secret). - ## - ## scrape_config docs: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config - ## explanation of "confg" typo: https://github.com/helm/charts/issues/13368 - additionalScrapeConfigsExternal: false - ## PortName to use for Prometheus. ## portName: "web"