forked from prometheus-operator/prometheus-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document stategic merge patch. (prometheus-operator#3823)
* 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
1 parent
58ec20e
commit 91cf69f
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |