Skip to content
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

stop \ terminate running jobs without waiting for the timeout from the pods #156

Closed
shayb01 opened this issue Oct 3, 2022 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@shayb01
Copy link

shayb01 commented Oct 3, 2022

Brief summary

Hi, is it possible to stop \ terminate a running job without waiting for the timeout from the pods?

deleting the k6 crd object will remove the pods but the operator will keep waiting for pod status until the timeout is reached
(version 0.0.7)

k6-operator version or image

operator:controller-v0.0.8rc1

K6 YAML

apiVersion: k6.io/v1alpha1
kind: K6
metadata:
name: k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3
spec:
cleanup: post
arguments: --out influxdb=http://.....
parallelism: 6
runner:
resources:
limits:
cpu: "4"
memory: 5000Mi
script:
configMap:
name: k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3-config
file: k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3.tar
separate: true

Other environment details (if applicable)

kube v1.20, k6 v0.0.7

Steps to reproduce the problem

  1. deploy k6 yaml and wait for k6 object status to become "started"
  2. delete k6 object
  3. all pods will terminiate immediately but the operator will keep waiting for pod status

2022-10-02T15:10:16.564Z INFO controllers.K6 0/6 jobs complete {"k6": "k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3"}
2022-10-02T15:10:46.564Z INFO controllers.K6 0/6 jobs complete {"k6": "k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3"}
2022-10-02T15:11:16.564Z INFO controllers.K6 0/6 jobs complete {"k6": "k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3"}

  1. once the k6 job timeout threshold is reached the operator will return an error message and will be able to start a new k6 job if any

2022-10-02T15:15:46.564Z ERROR controllers.K6 Waiting for pods to finish ended with error {"k6": "k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3", "error": "timed out waiting for the condition"}
github.com/go-logr/zapr.(*zapLogger).Error
/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128...

2022-10-02T15:15:46.564Z INFO controllers.K6 Changing stage of K6 status to finished {"k6": "k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3"}
2022-10-02T15:15:46.570Z ERROR controllers.K6 Could not update status of custom resource {"k6": "k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3", "error": "Operation cannot be fulfilled on k6s.k6.io "k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3": StorageError: invalid object, Code: 4, Key: /registry/k6.io/k6s/k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 01095a6b-f88c-4ee5-b1a2-5a828febe07b, UID in object meta: "}
github.com/go-logr/zapr.(*zapLogger).Error...

2022-10-02T15:15:46.570Z ERROR controller Reconciler error {"reconcilerGroup": "k6.io", "reconcilerKind": "K6", "controller": "k6", "name": "k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3", "namespace": "k6-loadtest1", "error": "Operation cannot be fulfilled on k6s.k6.io "k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3": StorageError: invalid object, Code: 4, Key: /registry/k6.io/k6s/k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 01095a6b-f88c-4ee5-b1a2-5a828febe07b, UID in object meta: "}
github.com/go-logr/zapr.(*zapLogger).Error...

2022-10-02T15:15:47.571Z INFO controllers.K6 Request deleted. Nothing to reconcile. {"k6": "k6-loadtest1/k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3"}
2022-10-02T15:15:47.571Z DEBUG controller Successfully Reconciled {"reconcilerGroup": "k6.io", "reconcilerKind": "K6", "controller": "k6", "name": "k6-load-50fab991-31bd-48f6-ac5c-b3e879f10ce3", "namespace": "k6-loadtest1"}

Expected behaviour

The operator should notice that k6 object was deleted and stop waiting for the return respond from pods

Actual behaviour

deleting the k6 crd object will remove the pods but the operator will keep waiting for pod status until the timeout is reached

@yorugac
Copy link
Collaborator

yorugac commented Oct 7, 2022

Thanks for opening the issue, @shayb01. It will not be resolved separately but as part of #138.

@yorugac
Copy link
Collaborator

yorugac commented Aug 22, 2023

I believe this issue was resolved during all the work on #138 (PRs #169 and #213) Closing this. @shayb01, please update to the latest version of k6-operator and if smth is off, let us know!

@yorugac yorugac closed this as completed Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants