Comments (2)
Hello!
I think the read_pod_logs probe doesn't return a boolean so the tolerance would be incorrect. Maybe use a jsonpath or regex instead?
for instance:
https://docs.chaostoolkit.org/reference/tutorials/tolerance/#validate-the-stdoutstderr-of-a-process
from chaostoolkit-kubernetes.
Thanks for the help!
I have added something like this
{
"name": "fetch-guamapper-pod-logs",
"type": "probe",
"tolerance": {
"type": "regex",
"pattern": "@timestamp",
"target": "stdout"
},
"provider": {
"func": "read_pod_logs",
"arguments": {
"name": "guamapper",
"last": "30m",
"ns": "core"
},
"type": "python",
"module": "chaosk8s.pod.probes"
}
}
where the logs I should receive from kubectl is similar to -
{"@timestamp":"2020-02-25T07:27:30.7609245Z","Message":"Deleted Source blob "51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz" From Container.","BlobName":"51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz","SourceContext":"Grundfos.GiC.ZipTranslatorService.Services.BlobFileOperations.BlobOperationManager"}
{"@timestamp":"2020-02-25T07:27:30.8889674Z","Message":"Marked file upload notification as complete:DeviceId:"51558226fb58524ca6b3137c150e308f",BlobName: "51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz", BlobUrl:"https://gfstoiotfileuploadpazwe.blob.core.windows.net/wwnfiles/51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0%232020-02-25T07-29-55Z.json.gz\", BlobSizeInBytes:7156, LastUpdatedTime:02/25/2020 07:27:26 +00:00, EnqueuedTimeUtc:02/25/2020 07:27:28","Level":"Verbose","DeviceId":"51558226fb58524ca6b3137c150e308f","BlobName":"51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz","BlobUri":"https://gfstoiotfileuploadpazwe.blob.core.windows.net/wwnfiles/51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0%232020-02-25T07-29-55Z.json.gz","BlobSizeInBytes":7156,"LastUpdatedTime":"2020-02-25T07:27:26.0000000+00:00","EnqueuedTimeUtc":"2020-02-25T07:27:28.1185446Z","SourceContext":"Grundfos.GiC.ZipTranslatorService.ZipTranslator"}
where I am searching for "timestamp"
the Pod Yaml contains labels -
labels:
app.kubernetes.io/environment: p
app.kubernetes.io/instance: guamapper
app.kubernetes.io/name: guamapper
pod-template-hash: 574f89f4cd
Am I missing something? Or is there a syntax error, I am looking for last 30 minutes logs
It gives an error -
File "/opt/hostedtoolcache/Python/3.8.1/x64/lib/python3.8/site-packages/chaoslib/hypothesis.py", line 304, in _
return rx.search(value) is not None
TypeError: expected string or bytes-like object
from chaostoolkit-kubernetes.
Related Issues (20)
- Experiment does not fails/breaks when k8s action cannot be performed
- Failed to discover chaostoolkit-kubernetes HOT 1
- `service_is_initialized` should use field_selector when name is provided
- delete_deployment uses an incorrect label_selector due to variable and arg being the same name
- Bug in chaosk8s.statefulset.probes.statefulset_fully_available: V1StatefulSetStatus' object has no attribute 'unavailable_replicas' HOT 2
- Using two different source of truth to filter pods HOT 4
- deny_all_ingress not working HOT 1
- SSL Error - CERTIFICATE_VERIFY_FAILED HOT 3
- Merge terminate_pods and delete_pods to avoid confusion and unnecessary code bloat HOT 1
- Kubernetes delete_pod action is not working HOT 1
- exec_in_pods cannot use space in the command itself HOT 3
- Receiving msg: ConnectionRefusedError: [Errno 111] Connection refused HOT 2
- exec_in_pods fails to parse stderr as json HOT 1
- There is a cmd splitting issue, therefore the shell commands will not parse correctly
- [error] deny-all-ingress is not working
- terminate_pod is not working for OpenShift HOT 4
- exec_in_pods function can not handle pipe operator
- How to get the value for tolerance for all_pods_healthy Steady State Hypothesis probe ? HOT 2
- Link to the documentation in the README is broken HOT 2
- New Release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chaostoolkit-kubernetes.