mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Use nginx controller canary metrics
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
set -o errexit
|
||||
|
||||
NGINX_HELM_VERSION=3.36.0 # ingress v0.49.0
|
||||
NGINX_HELM_VERSION=4.0.3 # ingress v1.0.2
|
||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||
|
||||
mkdir -p ${REPO_ROOT}/bin
|
||||
|
||||
@@ -32,40 +32,6 @@ spec:
|
||||
EOF
|
||||
|
||||
echo '>>> Create metric templates'
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: flagger.app/v1beta1
|
||||
kind: MetricTemplate
|
||||
metadata:
|
||||
name: error-rate
|
||||
namespace: ingress-nginx
|
||||
spec:
|
||||
provider:
|
||||
type: prometheus
|
||||
address: http://flagger-prometheus.ingress-nginx:9090
|
||||
query: |
|
||||
100 - sum(
|
||||
rate(
|
||||
http_request_duration_seconds_count{
|
||||
kubernetes_namespace="{{ namespace }}",
|
||||
kubernetes_pod_name=~"{{ target }}-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)",
|
||||
path="root",
|
||||
status!~"5.*"
|
||||
}[{{ interval }}]
|
||||
)
|
||||
)
|
||||
/
|
||||
sum(
|
||||
rate(
|
||||
http_request_duration_seconds_count{
|
||||
kubernetes_namespace="{{ namespace }}",
|
||||
kubernetes_pod_name=~"{{ target }}-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)",
|
||||
path="root"
|
||||
}[{{ interval }}]
|
||||
)
|
||||
)
|
||||
* 100
|
||||
EOF
|
||||
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: flagger.app/v1beta1
|
||||
kind: MetricTemplate
|
||||
@@ -115,12 +81,9 @@ spec:
|
||||
maxWeight: 40
|
||||
stepWeight: 20
|
||||
metrics:
|
||||
- name: error-rate
|
||||
templateRef:
|
||||
name: error-rate
|
||||
namespace: ingress-nginx
|
||||
- name: request-success-rate
|
||||
thresholdRange:
|
||||
max: 1
|
||||
min: 1
|
||||
interval: 30s
|
||||
- name: latency
|
||||
templateRef:
|
||||
@@ -255,12 +218,9 @@ spec:
|
||||
x-user:
|
||||
exact: "insider"
|
||||
metrics:
|
||||
- name: error-rate
|
||||
templateRef:
|
||||
name: error-rate
|
||||
namespace: ingress-nginx
|
||||
- name: request-success-rate
|
||||
thresholdRange:
|
||||
max: 1
|
||||
min: 1
|
||||
interval: 30s
|
||||
- name: latency
|
||||
templateRef:
|
||||
|
||||
Reference in New Issue
Block a user