Files
troubleshoot/examples/preflight/postgres-connection-valid.yaml
Marc Campbell 518f826fc2 Regex analyzer
2019-12-19 00:49:16 +00:00

25 lines
773 B
YAML

apiVersion: troubleshoot.replicated.com/v1beta1
kind: Preflight
metadata:
name: postgres-connection-valid
spec:
collectors:
- run:
collectorName: "run-ping"
image: busybox:1
namespace: default
command: [ping]
args: [-w, "5", www.google.com]
imagePullPolicy: IfNotPresent
analyzers:
- regex:
collectorName: "run-ping"
checkName: "Ping google with low packet loss?"
expression: "(?P<Transmitted>\\d+) packets? transmitted, (?P<Received>\\d+) packets? received, (?P<Loss>\\d+\\.?\\d+)% packet loss"
outcomes:
- pass:
when: "Loss < 20"
message: "Solid connection to google.com"
- fail:
message: "Really high packet loss"