adding files 2
This commit is contained in:
48
k8s/broken/imagepull-secret-failure-command-spec.yaml
Normal file
48
k8s/broken/imagepull-secret-failure-command-spec.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
version: 0.1
|
||||
component: command
|
||||
timeoutInSeconds: 600
|
||||
shell: bash
|
||||
failImmediatelyOnError: true
|
||||
|
||||
env:
|
||||
variables:
|
||||
APP_NAMESPACE: kagent-demo
|
||||
DEPLOYMENT_NAME: payment-service
|
||||
CONTAINER_NAME: payment-service
|
||||
BROKEN_IMAGE_PULL_SECRET: missing-ocir-secret
|
||||
|
||||
steps:
|
||||
- type: Command
|
||||
name: Simulate missing imagePullSecret
|
||||
command: |
|
||||
echo "Forcing ImagePullBackOff by replacing imagePullSecrets with ${BROKEN_IMAGE_PULL_SECRET}"
|
||||
|
||||
kubectl patch deployment "${DEPLOYMENT_NAME}" -n "${APP_NAMESPACE}" \
|
||||
--type merge \
|
||||
-p "{
|
||||
\"spec\": {
|
||||
\"template\": {
|
||||
\"spec\": {
|
||||
\"imagePullSecrets\": [
|
||||
{\"name\": \"${BROKEN_IMAGE_PULL_SECRET}\"}
|
||||
],
|
||||
\"containers\": [
|
||||
{
|
||||
\"name\": \"${CONTAINER_NAME}\",
|
||||
\"imagePullPolicy\": \"Always\"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}"
|
||||
|
||||
kubectl rollout restart deployment/"${DEPLOYMENT_NAME}" -n "${APP_NAMESPACE}"
|
||||
kubectl get pods -n "${APP_NAMESPACE}" -o wide
|
||||
|
||||
- type: Command
|
||||
name: Show image pull events
|
||||
command: |
|
||||
sleep 30
|
||||
kubectl get pods -n "${APP_NAMESPACE}" -o wide
|
||||
kubectl get events -n "${APP_NAMESPACE}" --sort-by=.lastTimestamp | tail -40
|
||||
Reference in New Issue
Block a user