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

fix(jobs): jobs termination after CP restart #10085

Merged

Conversation

jakubdyszkiewicz
Copy link
Contributor

Checklist prior to review

Fix jobs termination in case of CP missing update event (like CP restart etc.)

I tested it by applying this

apiVersion: batch/v1
kind: Job
metadata:
  name: pi-2
  namespace: kuma-demo
spec:
  template:
    spec:
      containers:
      - name: ubuntu
        image: ubuntu:latest
        command: [ "/bin/bash", "-c", "--" ]
        args: [ "sleep 60" ]
      restartPolicy: Never
  backoffLimit: 4

then scaling CP down

kubectl scale deployments -n kuma-system kuma-control-plane --replicas=0

then up

kubectl scale deployments -n kuma-system kuma-control-plane --replicas=1

without this fix, the job stays running.

I'd love write E2E test for it, but it requires CP restart so it would land in non-env tests and it would be a time-consuming test.

  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
    • Don't forget ci/ labels to run additional/fewer tests
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label) --

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team as a code owner April 25, 2024 13:17
@jakubdyszkiewicz jakubdyszkiewicz requested review from michaelbeaumont, slonka and lobkovilya and removed request for a team April 25, 2024 13:17
@jakubdyszkiewicz jakubdyszkiewicz enabled auto-merge (squash) April 25, 2024 13:23
@jakubdyszkiewicz jakubdyszkiewicz merged commit 358de6f into kumahq:release-2.7 Apr 25, 2024
18 checks passed
Copy link
Contributor

github-actions bot commented Apr 25, 2024

backporting to release-2.4 with action

backporting to release-2.5 with action
backporting to release-2.6 with action

Copy link
Contributor

backporting to release-2.3 with action

kumahq bot pushed a commit that referenced this pull request Apr 25, 2024
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
kumahq bot pushed a commit that referenced this pull request Apr 25, 2024
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
kumahq bot pushed a commit that referenced this pull request Apr 25, 2024
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
kumahq bot pushed a commit that referenced this pull request Apr 25, 2024
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
jakubdyszkiewicz added a commit that referenced this pull request Apr 25, 2024
…0086)

fix(jobs): jobs termination after CP restart (#10085)

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Co-authored-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
jakubdyszkiewicz added a commit that referenced this pull request Apr 25, 2024
…0087)

fix(jobs): jobs termination after CP restart (#10085)

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Co-authored-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
jakubdyszkiewicz added a commit that referenced this pull request Apr 25, 2024
…0088)

fix(jobs): jobs termination after CP restart (#10085)

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Co-authored-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
jakubdyszkiewicz added a commit that referenced this pull request Apr 26, 2024
…0089)

fix(jobs): jobs termination after CP restart (#10085)

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Co-authored-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants