Skip to content

Commit

Permalink
Document stategic merge patch. (prometheus-operator#3823)
Browse files Browse the repository at this point in the history
* stategic merge patch

* Apply suggestions from code review

Optimize doc words

Co-authored-by: Lili Cosic <[email protected]>

* Apply suggestions from code review

Co-authored-by: Simon Pasquier <[email protected]>

* remove endline

* add endline

Co-authored-by: Lili Cosic <[email protected]>
Co-authored-by: Simon Pasquier <[email protected]>
  • Loading branch information
3 people authored Feb 9, 2021
1 parent 58ec20e commit 91cf69f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Documentation/user-guides/strategic-merge-patch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Strategic merge patch

When users need to apply a specific configuration to containers that we do not support or do not currently exist, merge patch can be used.
This document describes how to overwrite the container configuration generated by the operator by merging patches.

## How the "strategic merge patch" works

The operator supports `containers` field in `PrometheusSpec`, `AlertmanagerSpec` and `ThanosRulerSpec` configuration.
This field allows injecting additional containers, and the existing configuration can be overwritten by sharing the same container name.

### Merge patch example of Prometheus

The following manifest overwrites the `failureThreshold` value of the readiness probe for the Prometheus container.

```
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
labels:
prometheus: self
name: self
namespace: default
spec:
containers:
- name: prometheus
readinessProbe:
failureThreshold: 500
```

### Merge patch example for Alertmanager

The following manifest overwrites the `failureThreshold` values of the readiness and liveness probes for the Alertmanager container.

```
apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
labels:
alertmanager: main
name: main
namespace: monitoring
spec:
containers:
- name: alertmanager
livenessProbe:
failureThreshold: 5
readinessProbe:
failureThreshold: 5
```

0 comments on commit 91cf69f

Please sign in to comment.