Files
kagent-oci-devops-demo/k8s/broken/simulate-three-errors-command-spec.yaml
Oracle Public Cloud User 8b3cc8dd10 adding files 2
2026-09-04 13:54:16 +00:00

59 lines
1.6 KiB
YAML

version: 0.1
component: command
timeoutInSeconds: 900
shell: bash
failImmediatelyOnError: true
env:
variables:
APP_NAMESPACE: kagent-demo
PAYMENT_DEPLOYMENT: payment-service
PAYMENT_CONTAINER: payment-service
BROKEN_IMAGE_PULL_SECRET: missing-ocir-secret
steps:
- type: Command
name: Apply business degradation ConfigMap
command: |
kubectl apply -f k8s/broken/revenue-risk-configmap.yaml
kubectl rollout restart deployment/order-service -n "${APP_NAMESPACE}"
- type: Command
name: Apply limited HPA
command: |
kubectl apply -f k8s/broken/order-hpa-limited.yaml
kubectl get hpa order-service -n "${APP_NAMESPACE}" -o wide
- type: Command
name: Break payment image pull secret
command: |
kubectl patch deployment "${PAYMENT_DEPLOYMENT}" -n "${APP_NAMESPACE}" \
--type merge \
-p "{
\"spec\": {
\"template\": {
\"spec\": {
\"imagePullSecrets\": [
{\"name\": \"${BROKEN_IMAGE_PULL_SECRET}\"}
],
\"containers\": [
{
\"name\": \"${PAYMENT_CONTAINER}\",
\"imagePullPolicy\": \"Always\"
}
]
}
}
}
}"
kubectl rollout restart deployment/"${PAYMENT_DEPLOYMENT}" -n "${APP_NAMESPACE}"
- type: Command
name: Show simulated failures
command: |
sleep 45
kubectl get pods -n "${APP_NAMESPACE}" -o wide
kubectl get hpa -n "${APP_NAMESPACE}" -o wide
kubectl get events -n "${APP_NAMESPACE}" --sort-by=.lastTimestamp | tail -60