-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cloud native observability (#15)
* fix: update Traefik to v3 to use OpenTelemetry * fix: changed apiversion for traefik * fix: added ingress for dapr dashboard and adjusted prometheus-values * fix: using new yaml for jaeger * fix: rename files * fix: removed unintended loop due to build in retry in golang * fix: added prometheus rules and error generation script * fix: removed unncessary lines of code * fix: added chaos engineering files
- Loading branch information
1 parent
d19b709
commit d730cd2
Showing
32 changed files
with
667 additions
and
95 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,17 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: StressChaos | ||
metadata: | ||
namespace: 12-factor-app | ||
name: burn-cpu-100 | ||
spec: | ||
selector: | ||
namespaces: | ||
- 12-factor-app | ||
labelSelectors: | ||
app.kubernetes.io/instance: 12-factor-app | ||
mode: all | ||
stressors: | ||
cpu: | ||
workers: 1 | ||
load: 100 | ||
duration: 30s |
39 changes: 39 additions & 0 deletions
39
dapr-distributed-calendar/chaos-engineering/chaos-on-the-rise.yaml
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,39 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
name: chaos-on-the-rise | ||
namespace: 12-factor-app | ||
spec: | ||
entry: entry | ||
templates: | ||
- name: entry | ||
templateType: Serial | ||
deadline: 2m | ||
children: | ||
- stress-test | ||
- pod-killer | ||
- name: stress-test | ||
templateType: StressChaos | ||
deadline: 10s | ||
stressChaos: | ||
selector: | ||
namespaces: | ||
- 12-factor-app | ||
labelSelectors: | ||
app: controller | ||
mode: all | ||
stressors: | ||
cpu: | ||
workers: 1 | ||
load: 100 | ||
- name: pod-killer | ||
templateType: PodChaos | ||
deadline: 60s | ||
podChaos: | ||
selector: | ||
namespaces: | ||
- 12-factor-app | ||
labelSelectors: | ||
app: controller | ||
mode: all | ||
action: pod-kill |
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,14 @@ | ||
apiVersion: traefik.io/v1alpha1 | ||
kind: IngressRoute | ||
metadata: | ||
name: chaos-ingress | ||
namespace: chaos-testing | ||
spec: | ||
entryPoints: | ||
- web | ||
routes: | ||
- match: Host(`chaos.<ENV-NAME>-<ENV-USER-ID>-01.<ENV-ANIMAL>.<ENV-DOMAIN>`) && PathPrefix(`/`) | ||
kind: Rule | ||
services: | ||
- name: chaos-dashboard | ||
port: 2333 |
20 changes: 20 additions & 0 deletions
20
dapr-distributed-calendar/chaos-engineering/network-bandwith.yaml
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,20 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: NetworkChaos | ||
metadata: | ||
name: network-bandwidth-100kbps | ||
namespace: 12-factor-app | ||
spec: | ||
action: bandwidth | ||
mode: all | ||
selector: | ||
namespaces: | ||
- 12-factor-app | ||
labelSelectors: | ||
app.kubernetes.io/instance: 12-factor-app | ||
bandwidth: | ||
rate: 100kbps | ||
limit: 100 | ||
buffer: 10000 | ||
peakrate: 1000000 | ||
minburst: 1000000 | ||
duration: "10s" |
17 changes: 17 additions & 0 deletions
17
dapr-distributed-calendar/chaos-engineering/network-corrupt.yaml
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,17 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: NetworkChaos | ||
metadata: | ||
name: network-corrupt-example | ||
namespace: 12-factor-app | ||
spec: | ||
action: corrupt | ||
mode: all | ||
selector: | ||
namespaces: | ||
- 12-factor-app | ||
labelSelectors: | ||
app.kubernetes.io/instance: 12-factor-app | ||
corrupt: | ||
corrupt: "40" | ||
correlation: "25" | ||
duration: "10s" |
14 changes: 14 additions & 0 deletions
14
dapr-distributed-calendar/chaos-engineering/pod-failure.yaml
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,14 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: PodChaos | ||
metadata: | ||
namespace: 12-factor-app | ||
name: pod-failure-example | ||
spec: | ||
selector: | ||
namespaces: | ||
- 12-factor-app # the namespace of the system under test (SUT) you've deployed | ||
labelSelectors: | ||
app.kubernetes.io/instance: 12-factor-app # the label of the pod for chaos injection | ||
mode: all # the mode to run chaos action; supported modes are one/all/fixed/fixed-percent/random-max-percent | ||
action: pod-failure # the specific chaos action to inject; supported actions: pod-kill/pod-failure/container-kill | ||
duration: 60s # duration for the injected chaos experiment |
21 changes: 21 additions & 0 deletions
21
dapr-distributed-calendar/chaos-engineering/schedule-chaos.yaml
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,21 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: Schedule | ||
metadata: | ||
namespace: 12-factor-app | ||
name: scheduled-pod-failure | ||
spec: | ||
schedule: 5 * * * * | ||
startingDeadlineSeconds: null | ||
concurrencyPolicy: Forbid | ||
historyLimit: 2 | ||
type: PodChaos | ||
podChaos: | ||
selector: | ||
namespaces: | ||
- 12-factor-app | ||
labelSelectors: | ||
app: controller | ||
mode: one | ||
action: pod-failure | ||
duration: 1m | ||
gracePeriod: 0 |
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,147 @@ | ||
#!/bin/bash | ||
|
||
ENDPOINT="${ENDPOINT:-localhost}" | ||
PORT="${PORT:-3000}" | ||
|
||
echo Endpoint: $ENDPOINT | ||
echo Port: $PORT | ||
|
||
# Update event 1 | ||
echo 'Update event 1' | ||
curl --location --request PUT 'http://'$ENDPOINT':'$PORT'/updateevent/1' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Updated Event", | ||
"date": "TBD" | ||
} | ||
}' | jq | ||
|
||
# Update event 1 | ||
echo 'Update event 1' | ||
curl --location --request PUT 'http://'$ENDPOINT':'$PORT'/updateevent/1' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Updated Event", | ||
"date": "TBD" | ||
} | ||
}' | jq | ||
|
||
# Update event 1 | ||
echo 'Update event 1' | ||
curl --location --request PUT 'http://'$ENDPOINT':'$PORT'/updateevent/1' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Updated Event", | ||
"date": "TBD" | ||
} | ||
}' | jq | ||
|
||
# Update event 1 | ||
echo 'Update event 1' | ||
curl --location --request PUT 'http://'$ENDPOINT':'$PORT'/updateevent/1' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Updated Event", | ||
"date": "TBD" | ||
} | ||
}' | jq | ||
|
||
# Get event 1 (should fail) | ||
echo 'Get event 1 (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Get event 1 (should fail) | ||
echo 'Get event 1 (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Get event 1 (should fail) | ||
echo 'Get event 1 (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Get event 1 (should fail) | ||
echo 'Get event 1 (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Create event 1 | ||
echo 'Create event 1' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/newevent' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Uninstall Event", | ||
"date": "TBD", | ||
"id": "1" | ||
} | ||
}' |jq | ||
|
||
# Create event 1 again (should fail) | ||
echo 'Create event 1 again (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/newevent' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Uninstall Event", | ||
"date": "TBD", | ||
"id": "1" | ||
} | ||
}' | jq | ||
|
||
# Create event 1 again (should fail) | ||
echo 'Create event 1 again (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/newevent' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Uninstall Event", | ||
"date": "TBD", | ||
"id": "1" | ||
} | ||
}' | jq | ||
|
||
# Create event 1 again (should fail) | ||
echo 'Create event 1 again (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/newevent' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Uninstall Event", | ||
"date": "TBD", | ||
"id": "1" | ||
} | ||
}' | jq | ||
|
||
# Create event 1 again (should fail) | ||
echo 'Create event 1 again (should fail)' | ||
curl --location 'http://'$ENDPOINT':'$PORT'/newevent' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"data": { | ||
"name": "Uninstall Event", | ||
"date": "TBD", | ||
"id": "1" | ||
} | ||
}' | jq | ||
|
||
# Delete event 1 | ||
echo 'Delete event 1' | ||
curl --location --request DELETE 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Delete event 1 again (should fail) | ||
echo 'Delete event 1 again (should fail)' | ||
curl --location --request DELETE 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Delete event 1 again (should fail) | ||
echo 'Delete event 1 again (should fail)' | ||
curl --location --request DELETE 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Delete event 1 again (should fail) | ||
echo 'Delete event 1 again (should fail)' | ||
curl --location --request DELETE 'http://'$ENDPOINT':'$PORT'/event/1' | jq | ||
|
||
# Delete event 1 again (should fail) | ||
echo 'Delete event 1 again (should fail)' | ||
curl --location --request DELETE 'http://'$ENDPOINT':'$PORT'/event/1' | jq |
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
Oops, something went wrong.