gitops/manifests/demo-app/analysistemplate.yaml

40 lines
1.3 KiB
YAML

# Canary ke har step par chalta hai. App theek jawab de raha hai ya nahi -
# 5 baar check, 2 se zyada fail hue to rollout wapas purane version par.
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: app-health
namespace: demo-app
spec:
args:
- name: service
metrics:
- name: http-health
interval: 20s
count: 5
successCondition: result == "1"
failureLimit: 2
provider:
job:
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: check
image: curlimages/curl:8.11.1
command: [sh, -c]
args:
- >-
curl -sf --max-time 5 http://{{args.service}}/health
>/dev/null && echo 1 || echo 0
resources:
requests: { cpu: "10m", memory: "16Mi" }
limits: { cpu: "100m", memory: "64Mi" }
securityContext:
runAsNonRoot: true
runAsUser: 65534
allowPrivilegeEscalation: false
capabilities: { drop: ["ALL"] }