-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
taskruns will stay in Running(Pending)
state if non existing pvc name is given to workspace
#2994
Comments
/cc @jlpettersson @sbwsg |
Running(Pending)
state if non existing pvc name is given to workspaceRunning(Pending)
state if non existing pvc name is given to workspace
I'm not sure that I agree that a PipelineRun should fail if a PVC doesn't exist the moment a Pod runs. Isn't it possible that the volume is being provisioned by some other service and will appear some time after the Pod launches? Or will a PVC always exist prior to a Pod launching? |
Yes, this is the way Kubernetes works. It is hard to say if we should do it differently. Kubernetes is an eventual consistency system. E.g. you may create a PVC and a Pod/TaskRun in the same "kubectl create"-command. But they are created by different controllers that solve different responsibilities - independent of eachother. If the taskrun-controller should be responsible for this, it need to lookup PVCs and there might be a race from the same "kubectl create"-command, so a missing PVC might be created just a few milliseconds after the taskrun-controller does the PVC-lookup. I agree that UX might be better to show this earlier. But that is contrary to the loosely-coupled Kubernetes architecture with eventual consistency that make it very scalable and with clear bounded responsibilities for controllers. |
@jlpettersson @sbwsg maybe we should at least update the |
I agree that this is Kubernetes behavior and I'd be cautious about changing it. This is just one manifestation of a non-existent resource. You can get the same behavior for example when referencing a configmap that doesn't yet exist. I did look into improving the display status for issue #2268 but didn't get a lot of feedback. Part of the problem is that if there are multiple pipeline branches active there can be multiple things going "wrong". It's hard to concisely summarize what's going on. |
This is an interesting idea. I wonder if we can detect from Pod status / events whether it is waiting on a PVC. |
Ah, good point, I hadn't considered the non-PVC scenarios too. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
/remove-lifecycle rotten |
These seems similar to #3563 in that it's a question of whether or not we should add PVC specific behavior that differs from the k8s paradigm. Since this issue went rotten and the discussion was pointing out that this is the standard k8s behavior (and the same question applies to other types like configmaps as @GregDritschler pointed out), I'm inclined to close this issue. |
I am not sure I fully agree on this. This issue is about what should we do in case of PVC not being ready at the time we try to create TaskRun/PipelineRun. Right now, we say we are pending because it might be available at some point in the future. But we never reconcile again (aka if it is available), so we always end-up timing out (after 1h or more). From a user perspective, I would either assume we are waiting because it will be reconciled at some point or it should fail directly. I think we need to decide on this. |
OH. That sounds like a bug I 100% agree. I thought we've only been discussing the messages when a PVC isn't available; i definitely did not understand that this was also an issue describing a bug where the reconcile doesn't occur again! |
I don't think we should fail directly, as this is asynchronous (e.g. how Kubernetes works). This problem is very similar to #3378 |
Ah kk thanks for explaining that extra detail @vdemeester I agree this is a bug.
I agree, I think we might want to subscribe to updates on the PVC if we can - does anyone know which part of the tekton code requires the PVC to exist? |
This is news to me as well. I just tried it again and when the missing PVC is created and bound to a PV, the pod runs and the It is true that if the PVC is never created that the pipelinerun will timeout. Again that is what one would expect. What is the scenario where the pipelinerun does not continue when the PVC is created and bound? I have not seen that reported before. |
a TaskRun could hold-on to create a Pod until the PVC exists, perhaps? When creating a Pod from a TaskRun we know if a PVC is passed or not. But isn't this preventing concurrent work? E.g. a node could pull the image concurrently as it waits for a PVC to be created? We could perhaps have a shorter timeout if the Pod never start to run? 1h is a bit long for that case?
Yes, there are many scenarios here, if we should handle them all. If we watch PVCs or so, Tekton can do more.... e.g. if the PV is located in a different AZ the Pod cannot be scheduled either - and there are more reasons to not be able to schedule a Pod. |
I'm a bit confused. I feel like there are two different conversations happening at once here:
I am much more immediately interested in fixing the possible bug described in (1) (from comment) than the messaging part of this. That sounds like a serious bug that needs to be fixed. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Re-opening this issue as I am not sure this has been fixed. |
Expected Behavior
The piplinerun should check if given pvc is existing or not and pipelinerun should fail if the pvc is not present
Actual Behavior
The pipelinerun will be in
Running
state and taskruns will be inRunning(Pending)
stateSteps to Reproduce the Problem
tkn
commands to run the pipelineAdditional Info
Kubernetes version:
Output of
kubectl version
:Command logs
Running using
kubectl
task:
pipeline:
pipelinerun:
The text was updated successfully, but these errors were encountered: