Commit Graph
35 Commits
Author SHA1 Message Date
Max Leonard Inden b7a9751f09 Merge remote-tracking branch 'master' into release-0.22 2018-07-24 17:25:40 +02:00
Max IndenandGitHub 8edd622f2e *: cut 0.22.2 (#1683) 2018-07-24 17:17:53 +02:00
Max IndenandGitHub 06df9fb67d bundle.yaml: Bump Prometheus Operator memory request and limit (#1622)
When handling big Kubernetes objects, marshalling objects is memory
intense. This can be reproduced with the end-to-end test
`TestPrometheusRulesExceedingConfigMapLimit`. This patch doubles the
memory request and limit of the Prometheus Operator deployment to 100mb
and 200mb.
2018-07-20 15:09:17 +02:00
Max IndenandGitHub efe686c0c0 security: Enforce nobody user and read only / (#1393)
* Make the Prometheus Operator Docker image run as `nobody` by default.
* Disallow privilege escalation via K8s
* Enforce read only root filesystem
2018-07-17 15:11:46 +02:00
Max IndenandGitHub dabfca595b Makefile: Properly rebuild po-docgen on src changes (#1625) 2018-07-17 15:10:38 +02:00
Max Leonard Inden 4083705edf *: Cut 0.22.0 2018-07-10 13:41:50 +02:00
Max Leonard Inden cd709826c9 format: Introduce shellcheck [1] for shell script analysis
[1] https://github.com/koalaman/shellcheck
2018-07-08 16:58:17 +02:00
Max IndenandGitHub 938fe3745c Merge pull request #1361 from luarx/readme-compiling-section
Make "Compiling" section easier to execute
2018-07-04 13:57:23 +02:00
Max Leonard Inden 22066b4708 kube-prometheus/Makefile: Change target output from files to folder
Previously the `manifests` and `vendor` folder content has been build
via `manifests/**` and `vendor/**` target definitions. This results in
two issues:

1. The GNU Make recipe is executed for every single file in the folders.

2. Not all timestamps inside the `manifests` folder would be updated on
every run, thereby needing to be rerun on all following target
executions.

Solution:

1. Define the target based on the folder, not individual files

2. Remove target folder before execution recipe to ensure all timestamps
are updated.
2018-06-26 00:08:30 +08:00
Max IndenandGitHub c42e9d835c Merge pull request #1484 from mxinden/node-exporter-host-port
kube-prometheus: Run node-exporter in host network
2018-06-15 13:37:26 +02:00
Max Leonard Inden 603771ff14 kube-prometheus: Run node-exporter in host network
Node exporter needs to run in the host network, not in the pod network
in order to pick up network metrics of the node.
2018-06-15 11:47:51 +02:00
Max Leonard Inden 1d36d01b97 *: Refactor build system
- Move prometheus-config-reloader to cmd/
- Refactor Makefile & contrib/kube-prometheus/Makefile
- Only execute a target if its dependencies changed
  - Create empty target file for docker builds
- Replace promu with plain static `go build`
2018-06-12 13:56:57 +02:00
Max Leonard Inden c13b0556ba *: Bump version to v0.20.0 2018-06-05 15:07:17 +02:00
Max Leonard Inden 8f3b505049 kube-prometheus: Adjust to new Prometheus rule file CRD
89fc4e306972604eba2dcb961a6d29cc27a668ad introduced the new Prometheus
rule file custom resource definition. This patch adjusts the
kube-prometheus project to use the new custom resource definition.
2018-06-04 20:23:02 +02:00
Max IndenandGitHub a47d97859a Merge pull request #1407 from mxinden/rm-leftover
kube-prometheus: Remove duplicate unused files
2018-06-04 11:59:25 +02:00
Max Leonard Inden 304db75813 kube-prometheus: Remove duplicate unused files
afe9711ce2ef5dd0e0b5091f921ae9bc0aab3711 introduced
contrib/kube-prometheus/0prometheus-operator-clusterRole.yaml and
contrib/kube-prometheus/0prometheus-operator-deployment.yaml by mistake.
2018-05-31 16:09:53 +02:00
Max Leonard Inden 553d6b0c63 rbac: Remove Third Party Resources rules
Since PR 460 [1] the Prometheus Operator is using Kubernetes Custom Resource
Definitions instead of Kubernetes Third Party Resources. Permissions to
handle Third Party Resources in the RBAC rules of the Prometheus
Operator is thereby obsolete.

[1] https://github.com/coreos/prometheus-operator/pull/460
2018-05-31 15:12:15 +02:00
Max Leonard Inden 453e170f6a prometheus: Enable live migration of rule configmaps to rule file crds
With this patch the Prometheus Operator checks if there are any
Kubernetes ConfigMaps inside the Prometheus namespace which fullfill the
`Spec.RuleSelector` requirement. If so, it creates a RuleFile for each
key in the `ConfigMap.Spec.Data` map inside the Prometheus namespace.
2018-05-31 10:47:50 +02:00
Max Leonard Inden 9e180452f8 prometheus: Introduce RuleFile Custom Resource Definition
This patch introduces a new Custom Resource Definition to the
Prometheus Operator - the Rule CRD. It addresses two main
needs:

1. Prometheus (alerting and recording) Rule validation during creation time
via Kubernetes Custom Resource Definition validation.

2. Life-cycle management of Prometheus application Rules alongside the
application itself, inside the applications Kubernetes namespace, not
necessarily the namespace of the scraping Prometheus instance.

A user defines Prometheus alerting and recording Rules via a Kubernetes
Custom Resource Definition. These Custom Resource Definitions can be
fully validated by the Kubernetes API server during creation time via
automatically generated OpenAPI specifications. Instead of the
restriction of a Prometheus instance to only select Rule definitions
inside its own namespace, the Prometheus specification is extended to
also specify namespaces to look for Rule Custom Resource Definitions
outside its own namespace.

---

Dependent technical changes:

- prometheus: Use github.com/jimmidyson/configmap-reload to reload rules

- prometheus: Remove Prometheus Statefulset deletion function. Starting
with K8s >=1.8 this is handled via OwnerReferences.

- prometheus: Do not add rule files checksum to Prometheus configuration
secret

- prometheus: Update StatefulSet only on relevant changes. Instead of
updating the Prometheus StatefulSet on every `sync()` run, only update
it if the input parameters to `makeStatefulSet` change.  Enforce this
via a checksum of the parameters which is saved inside the annotations
of the statefulset.

- e2e/prometheus: Check how often resources (Secret, ConfigMap,
Prometheus CRD, Service) are updated to enforce that Prometheus Operator
only updated created resources if necessary.

- contrib/prometheus-config-reloader: Remove logic to retriev K8s
ConfigMaps. These are mounted into the pod right away now.
2018-05-18 16:27:20 +02:00
Max Leonard Inden 0461c85098 docs: Run embedmd on both Docs and kube-prometheus README.md 2018-05-14 11:55:16 +02:00
Max Leonard Inden 0124e8c272 contrib/kube-prometheus: add -f to rm in build.sh
According to the man pages of `rm` and the `-f` option:
> Attempt to remove the files without prompting for confirma- tion,
> regardless of the file's permissions.  If the file does not exist, do
> not display a diagnostic message or modify the exit status to reflect an
> error.  The -f option overrides any previous -i options.

This patch prevents the `build.sh` script from failing if files do not
exist when attempting to delete them.
2018-05-11 11:23:10 +02:00
Max Leonard Inden 992bcdccc1 *: Bump version to v0.19.0 2018-04-26 21:42:57 +02:00
Max Leonard Inden 157ad7eaea kube-prometheus: Update Prometheus Operator version before generating 2018-04-26 12:50:51 +02:00
Max IndenandGitHub c776fa4c48 Merge pull request #1238 from brancz/kube-prometheus-fixes
Various kube-prometheus fixes
2018-04-23 14:15:17 +02:00
Max IndenandGitHub 26d1dc86c9 Merge pull request #1229 from mxinden/move-serv-mon-to-target
kube-prometheus: Move service monitors to target folder
2018-04-18 14:15:26 +02:00
Max Leonard Inden 971ed1010e kube-prometheus: Move service monitors to target folder
With 1d00e0ab ("ServiceMonitor: Enable Prometheus to select ServMon
outside own ns") merged: To emphasize the fact, that ServiceMonitors can
be deployed alongside their targets, this patch moves the Alertmanager,
Kube-State-Metrics, Node-Exporter and Prometheus Operator
Service-Monitor into the respective target folder in the kube-prometheus
project.
2018-04-18 13:44:45 +02:00
Max IndenandGitHub 73e9a9882f Merge pull request #1206 from brancz/jsonnet
Convert kube-prometheus to jsonnet
2018-04-17 09:52:49 +02:00
Max IndenandGitHub b1aae67d99 Merge pull request #1219 from coreos/thanos4
Enable Thanos sidecar
2018-04-13 17:05:38 +02:00
Max Leonard Inden 3b13afb562 kube-prometheus/thanos: Move to experimental folder
In preparation of PR #1206 [1], This patch moves the Thanos manifests to the
`experimental` folder.

[1] https://github.com/coreos/prometheus-operator/pull/1206
2018-04-13 15:10:18 +02:00
Max Leonard Inden b10e343689 kube-prometheus: Fix minor typo 2018-04-10 10:27:54 +02:00
Max Leonard Inden 46c49616e0 *: Bump version to v0.18.1 2018-04-09 14:47:34 +02:00
Max Leonard Inden 310f471cf6 contrib/kube: Add rbac role to discover prometheus
The current example-app setup in the kube-prometheus project is able to
discover scraping targets in the default namespace. It is not able to
discover the configured Alertmanager in the monitoring namespace.

This patch adds an alertmanager-discovery rbac role, to permit the
above described action. In addition it does the following cleanups:

- Remove kubeconfig configuration in deploy and teardown script. kubectl
chooses .kube/config whenever KUBECONFIG is not set by default

- Remove namespace specification option via NAMESPACE env var. In most
of the manifests the metadata/namespace was hardcoded anyways, in
addition in the promtheus frontend role binding the service account
namespace is hardcoded to default as well.

- Instead of `kubectl {apply,delete}` individual manifests, the deploy
and teardown shell scripts {apply,delete} on the entire folder.
2018-03-19 17:13:33 +01:00
Max Leonard Inden 2f302943fe Unify rule file label accross repository
In some cases we have been using `alert-rules` in some cases
`prometheus-rulefiles`. This led to confusion [1]. Instead, unify the
Prometheus rules configmap labels to:

```yaml
labels:
  role: alert-rules
```

[1] https://github.com/coreos/prometheus-operator/issues/1102
2018-03-19 14:24:48 +01:00
Max Leonard Inden 3a6d38ea0e contrib/kube: Restrict example-app servicemonitor to default ns
The `prometheus-frontend` role of the example app kubeprometheus section
is scoped to the default namespace. Thereby the frontend Prometheus
instance is not able to discover anything outside of the default
namespace. We might as well restrict the front end service monitor to
the default namespace too.
2018-03-19 13:34:18 +01:00
Max IndenandGitHub f51416ba99 Update README.md 2017-03-13 09:26:20 +01:00