Repository navigation
Description
Hello everyone,
I am submitting this RFC as part of the UIUC++ SRSE evaluation task for a new SREGym benchmark problem.
Proposal: Injecting Missing imagePullSecret Dependency Fault
I propose adding a new standalone object-layer authentication fault: Missing or Invalid imagePullSecret. The inspiration for this issue comes from SREGym Issue #201 and is modeled after the cluster troubleshooting signals introduced in Kubernetes PR #117927. This PR updated the Kubelet to emit an explicit warning event (FailedToRetrieveImagePullSecret) when a referenced secret cannot be found—providing a clear object-layer signature that agents can leverage to diagnose underlying registry authentication issues.
Why This is a Great Fit for SREGym
- Addresses an Explicit Gap: Gap analysis actively tracks
imagePullSecretmissing as an open fault class with zero current registry coverage. - Distinct Fault DNA: The benchmark already includes image rollout faults like
incorrect_image. However, this new fault features a completely valid image tag. The failure happens exclusively at the cluster object dependency layer, forcing an agent to debug the Kubernetes secret infrastructure rather than the deployment manifest. - Evaluates Real-World Correlation (PR #117927 Update): Following Kubernetes PR #117927, Kubelet now emits a warning when a secret is missing. However, because this event is notoriously noisy and can trigger on perfectly healthy pods (e.g., if the image is public or alternate credentials succeed), this task forces the agent to contextually evaluate whether the log is an actual root cause or just noise based on the pod's true runtime state (
ImagePullBackOff).
Target Application
HotelReservation (hotel-reservation namespace).
Rationale from the existing problem inventory:
- HotelReservation hosts all of the benchmark's raw-KubeCtl problems —
network_policy_block,admission_webhook_outage,admission_webhook_tls_mismatch,expired_tls_hotel_reservation,node_conntrack_exhaustion,pod_cidr_exhaustion. An imagePullSecret fault is a cluster-credential object dependency, placing it naturally in this family. - The app uses a single shared image (
yinfangchen/hotelreservation:lateston Docker Hub) for all its microservices, which simplifies targeting a single Deployment without tracking multiple image references. - AstronomyShop (
ghcr.io/open-telemetry/demo:*) and SocialNetwork (docker.io/deathstarbench/social-network-microservices:latest) are also viable and can be good candidates too.
Technical Implementation Strategy (Handling the Public Image Paradox)
Because HotelReservation uses public Docker Hub images, a missing or invalid secret will not naturally prevent the image from being pulled; the Kubelet will simply bypass the missing secret and pull the public image successfully (though it will log the PR #117927 warning).
To ensure the pod actually breaks and falls into an ImagePullBackOff loop to test the agent's diagnostics, I propose one of two injection mechanisms alongside modifying the target deployment's imagePullPolicy to Always (which contradicts the change introduced in #201):
- Option A (Lightweight Domain Mutation): The injection script will use
kubectl patchto mutate the deployment's image string to point to a fictitious private registry domain (e.g.,internal-secure-registry.io/hotelreservation:latest) while injecting a brokenimagePullSecret. This simulates a complete authentication/resolution breakdown. - Option B (Local Auth Registry): The injection script will dynamically deploy a temporary, authenticated local registry container inside the cluster during problem setup, host the application image there, and then purposely delete or corrupt the matching namespace secret to trigger the hard failure.
Questions for the Authors
- Is this problem definition novel enough to be added to the registry as a standalone task? Did I miss something in my analysis of the existing problems?
- I could not find any associated Real World corporate incidents linked to the issue. Is it okay to add it by referencing the upstream Kubernetes documentation framework (PR #117927) as our domain justification?
- If you do approve of this plan, which of the proposed technical implementation strategies (Option A or Option B) fits better with SREGym's existing fault injection philosophy?
I look forward to your feedback on whether this aligns with the roadmap so I can begin drafting the PR!
Activity
Saadmrp1038 commentedon Jun 3, 2026
@W-OK-E Thanks for the RFC! The noisy-warning angle from PR #117927 is really interesting.
To me it looks like Option B is the better choice. Option A (fake registry + broken secret) is just
incorrect_imageagain, the pod goes intoImagePullBackOffandkubectl describe podshows the answer. Option B (valid image, real broken secret) plus a decoy of healthy pods throwing the sameFailedToRetrieveImagePullSecretwarning is much more unique. Now the agent can't trust the warning and has to check it against real pod state to find the one true root cause.One thing to watch out for is since the real image is also public on Docker Hub, the agent can just repoint the deployment at the public image, the pod goes Running without ever touching the secret, and it'll look solved. If the app comes back up that way, the agent will reasonably think it fixed it, so I don't think we can fairly fail it for that. You'll need to make sure there's no working image reachable except through the secret (private-only image, no cached/public fallback), otherwise this collapses back into
incorrect_image. Worth thinking about how you'd close that loophole before the PR.For your questions:
imagePullPolicy: Alwaysa permanent change to the manifest. Set it during injection and revert it on recovery.If you can figure out agent using public image part this could be a great fault!
Also, the implementation for this might be quite tricky. Feel free to ask for help and please test the fault thoroughly before giving PR.
W-OK-E commentedon Jun 4, 2026
Thank you for the feedback @Saadmrp1038 , have tested a few things, will incorporate aforementioned changes and keep you posted.
W-OK-E commentedon Jun 6, 2026
Hey @Saadmrp1038 , I went on and implemented the problem, here I outline the rough details and a few questions that were bugging me:
hotel-reservationapp, therecommendationpod image is moved to a private registry and its credentials secret (hotel-registry-creds) is deleted, leading toImagePullBackOff.FailedToRetrieveImagePullSecretwarning but stayRunning, requiring the agent to distinguish between pods using actual status, not just events. The decoy pods have no labels to distinguish them from legitimate or broken pods. (Inspired from #128544)kubernetes.io/dockerconfigjsonsecret and ensure the Deployment references it.registry:2container, configurescontainerdon Kind nodes for HTTP pulls, and forces a rollout.authsblock), Deployment reference, preservation of the private registry image URL, and pod health.All the oracle checks pass,
recover_fault()undoes all the changes successfully, and as instructed, the change inimagePullPolicyis reverted back toIfNotPresent.Questions
Some of these are also about design choices that confused me:
get_context()function? Or while I am pushing the docker image into the private registry, I could make the subprocess run the command in such a way that the password is discoverable viaps aux, currently it is getting piped in.And of course, let me know if you have any additional questions or would want me to share any additional test results before you approve this for a PR. Even if you think the current implementation is not challenging/novel enough for a PR, feel free to let me know, I will improve it.
Saadmrp1038 commentedon Jun 6, 2026
@W-OK-E Nice work! For your questions:
Reject any image URL change. Ideal scenerio is make the public swap actually fail (maybe block egress so the Docker Hub image isn't reachable, or some other way) instead of just failing it in the oracle while the pod runs. Otherwise the agent points to the public image, sees a healthy app, and thinks it fixed it.
The
ps auxtrick feels flaky. Better to leave the creds discoverable in cluster state like real recovery would. Just drop the registry user/pass into a Secret the agent can read and let it rebuild the pull secret from there. Easiest spot is probably the registry's own namespace, so the agent can trace from the broken pod to its registry to the secret. Worth looking up what's common in prod environments.I think the core challenge now is blocking the move-to-public-image mitigation.
W-OK-E commentedon Jun 6, 2026
Makes sense, thank you for the insights @Saadmrp1038 , I have been trying a few things with the image repointing trick. Will incorporate a readable secret and once the private to public image switch is resolved, will update here and raise a PR.
W-OK-E commentedon Jun 8, 2026
Hey @Saadmrp1038, I figured the following ways to tackle the credentials and the public image pull issues:
For credentials, I am isolating them in a separate namespace inspired from standard practices. The namespace contains an opaque secret, acting in line with a centralized external Secrets provider pattern
Additionally, a configMap (
registry-access-runbook) is left inhotel-reservation, as a hint that creds are centrally managed and pointing it at the namespace + secret name.To prevent public dockerhub pulls, any external pull requests are redirected at the containerd-mirror level to a small
nginx:alpinesidecar that returns 403 forbidden. The redirect happens tohttp://dockerhub.internal:80so as to keep it subtle, and even if the agent figures out that the redirect is forced, it cannot disable it since it lives in a node-filesystem containerd config, invisible to an agent operating viakubectl/Kubernetes RBAC. However, I found a bug after extensive testing:Sometimes, in the
hotel-reservationapp, I would exit theSREGym CLIviactrl + c(postinject_faultand without runningrecover_fault) which meant that the private-registry I created (for storing docker images) and the changes made to/etc/containerd/certs.d/docker.io/hosts.tomlwould still persist (Unless I get rid of them manually post exit). Now if someone starts any other problem after this series of events (inject_fault-> exit (no teardown, norecover_fault)) any requests to dockerhub would get redirected to the sidecar.So I wanted advice on whether this design choice is okay i.e. are there other problems that make node-level changes and we trust every problem to finish or should I look for other ways to block egress? There are a few but they can be turned off by an agent with
kubectlRBAC.Saadmrp1038 commentedon Jun 8, 2026
@W-OK-E
Yes we do and no we don't trust every problem to finish. Look at the
fix_kubernetesfunction insideconductor.py. For problems that if they exit mid-run without proper teardown can mess up our cluster we add global cleanup.W-OK-E commentedon Jun 8, 2026
Aah, I completely missed that! Thank you for highlighting it @Saadmrp1038 !!
I can see that currently there are a few cleanups which are specific to a few problem IDs in
fix_kubernetesif I am not wrong:I have taken a similar approach, and added cleanup for my problem ID:
Does this approach seem fine? If yes, I will go ahead and open the PR.
Saadmrp1038 commentedon Jun 8, 2026
@W-OK-E yeah this is fine.
tianyin commentedon Jun 16, 2026
Close this RFC as it is implemented in #883 already.