Skip to content

fix(infra): Restart k3s with a cordon and no drain - #6744

Merged
dan-petty merged 3 commits into
mainfrom
fix/6338-restart-k3s-with-a-cordon-and
Nov 22, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/6338-restart-k3s-with-a-cordon-and

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

devops infra apply drains a node before each change of class service-restart:k3s or service-restart:k3s-agent, and the drain check of the control-plane node of homelab can never pass: k8s/llm/gateway-db.yaml and k8s/mattermost/database.yaml each give instances: 1, and their primaries run on that node. A merged k3s or kubelet change therefore never reaches the server node through devops infra. A restart of k3s stops only the k3s process and keeps the containers, so the apply needs a cordon, no drain, and the Ready wait and the health check of the control plane (#6338).

Closes #6338

Change: openspec/changes/archive/2026-11-22-6338-restart-k3s-with-a-cordon-and/

@devops-cli-service devops-cli-service Bot added type/docs Type docs: a change to the documents scope/openspec OpenSpec changes, specs and their checks labels Nov 22, 2026
@devops-cli-service
devops-cli-service Bot force-pushed the fix/6338-restart-k3s-with-a-cordon-and branch from f8e0bca to 5d4a108 Compare November 22, 2026 05:55
@devops-cli-service devops-cli-service Bot changed the title docs(openspec): plan #6338 Restart k3s with a cordon and no drain docs(openspec): plan #6338 restart k3s with a cordon and no drain Nov 22, 2026
@devops-cli-service devops-cli-service Bot changed the title docs(openspec): plan #6338 restart k3s with a cordon and no drain fix(infra): Restart k3s with a cordon and no drain Nov 22, 2026
@devops-cli-service devops-cli-service Bot added type/bug Type bug: the code does not do what it must scope/infra Docker container images, DevContainers, and infrastructure tooling and removed type/docs Type docs: a change to the documents scope/openspec OpenSpec changes, specs and their checks labels Nov 22, 2026
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Stopped at push. The stop report is on #6338: #6338 (comment).

  • tools: run_command 124, read_file 65, edit_file 51, grep 37, list_files 2, write_file 2, create_directory 1
  • scoped check pre-push: passed, 4 s
  • scoped check static: passed, 23 s
  • scoped check tests: passed, 29 s
  • scoped check strength: passed, 0 s
  • group 5: skipped, group 5: kind other
  • fail-to-pass of group 1: fails on the base commit. Tests that fail on the base commit: tests.infra.test_plan::test_a_unit_that_the_host_lists_for_a_nodrain_restart_gets_its_own_class, tests.infra.test_plan::test_a_templated_list_of_nodrain_units_is_not_read, tests.infra.test_plan::test_the_nondisruptive_list_wins_over_the_nodrain_list.
  • fail-to-pass of group 2: fails on the base commit. Tests that fail on the base commit: tests.infra.test_nodes::test_the_cordon_of_a_node_leaves_it_unschedulable.
  • fail-to-pass of group 3: fails on the base commit. Tests that fail on the base commit: tests.commands.test_infra_apply::test_a_nodrain_restart_cordons_the_node_and_skips_the_drain[schedulable], tests.commands.test_infra_apply::test_a_nodrain_restart_cordons_the_node_and_skips_the_drain[cordoned-before].
  • fail-to-pass of group 4: fails on the base commit. Tests that fail on the base commit: tests.commands.test_infra_apply::test_a_dry_run_of_a_nodrain_host_lists_the_cordon_and_no_drain.
  • verify of group 5: uv run devops ci docs exits 0.
\u2139 Quality gate root: /home/devops/.data/roadmap/implement-runs/devops-implement-ruuzi8h8/work/model-clone
\u2713 All documentation files are up to date.

@devops-cli-service
devops-cli-service Bot force-pushed the fix/6338-restart-k3s-with-a-cordon-and branch from 5d4a108 to ab9d30a Compare November 22, 2026 14:01
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Step Status Attempts Tokens in/out Last failing command
group 1 done 2 5181997/21975 -
group 2 done 1 1424337/5693 -
group 3 done 1 3017846/13595 -
group 4 done 1 3531471/17456 -
group 5 done 1 1042183/4153 -
group 6 done 1 2013174/9819 -
  • tools: run_command 144, read_file 56, edit_file 54, grep 30, write_file 1, create_directory 1
  • scoped check pre-push: passed, 5 s
  • scoped check static: passed, 24 s
  • scoped check tests: passed, 29 s
  • scoped check strength: passed, 0 s
  • group 5: skipped, group 5: kind other
  • group 6: skipped, group 6: kind other
  • fail-to-pass of group 1: fails on the base commit. Tests that fail on the base commit: tests.infra.test_plan::test_the_k3s_agent_role_shows_a_hidden_diff_and_a_restart_of_its_unit, tests.infra.test_plan::test_each_change_skip_and_handler_of_a_host_is_in_the_plan, tests.infra.test_plan::test_a_skip_by_a_when_that_names_check_mode_is_unchecked, tests.infra.test_plan::test_a_skip_result_in_color_stays_unchecked, tests.infra.test_plan::test_a_reboot_task_is_disruptive, tests.infra.test_plan::test_a_failed_task_marks_the_plan_failed, tests.infra.test_plan::test_a_unit_that_the_host_lists_as_nondisruptive_is_not_disruptive, tests.infra.test_plan::test_a_unit_that_the_host_lists_for_a_nodrain_restart_gets_the_nodrain_class, tests.infra.test_plan::test_a_templated_nodrain_list_lists_no_unit, tests.infra.test_plan::test_a_host_skips_the_drain_only_when_each_of_its_classes_is_a_nodrain_restart[no-class], tests.infra.test_plan::test_a_host_skips_the_drain_only_when_each_of_its_classes_is_a_nodrain_restart[one-nodrain], tests.infra.test_plan::test_a_host_skips_the_drain_only_when_each_of_its_classes_is_a_nodrain_restart[two-nodrain], tests.infra.test_plan::test_a_host_skips_the_drain_only_when_each_of_its_classes_is_a_nodrain_restart[drain], tests.infra.test_plan::test_a_host_skips_the_drain_only_when_each_of_its_classes_is_a_nodrain_restart[nodrain-and-reboot], tests.infra.test_plan::test_the_same_events_give_the_same_plan_id, tests.infra.test_plan::test_another_commit_or_limit_gives_another_plan_id[commit], tests.infra.test_plan::test_another_commit_or_limit_gives_another_plan_id[limit].
  • fail-to-pass of group 2: fails on the base commit. Tests that fail on the base commit: tests.infra.test_nodes::test_a_cordon_leaves_the_node_cordoned.
  • fail-to-pass of group 3: fails on the base commit. Tests that fail on the base commit: tests.commands.test_infra_apply::test_a_nodrain_restart_cordons_the_node_and_skips_the_drain[schedulable], tests.commands.test_infra_apply::test_a_nodrain_restart_cordons_the_node_and_skips_the_drain[cordoned-before].
  • fail-to-pass of group 4: fails on the base commit. Tests that fail on the base commit: tests.commands.test_infra_apply::test_a_dry_run_of_a_nodrain_host_lists_the_cordon_and_no_drain.
  • verify of group 5: uv run devops ci docs exits 0.
\u2139 Quality gate root: /home/devops/.data/roadmap/implement-runs/devops-implement-akxhpq9r/work/model-clone
\u2713 All documentation files are up to date.
  • verify of group 6: uv run devops ci test tests/infra/test_apply.py exits 0.
No coverage index found. Run `devops ci coverage --build-index` to build one.
  tests/infra/test_apply.py \u2192 tests/infra/test_apply.py
================================================================================================================== test session starts ===================================================================================================================
platform linux -- Python 3.14.10, pytest-9.2.0, pluggy-1.7.0
rootdir: /home/devops/.data/roadmap/implement-runs/devops-implement-akxhpq9r/work/model-clone
configfile: pyproject.toml
plugins: xdist-3.8.0, cov-7.1.0, asyncio-1.4.1.post1, platformdirs-4.14.8, time-machine-3.6.0, mock-3.17.0, anyio-4.16.0, syrupy-7.0.3, timeout-2.4.0, hypothesis-6.170.17
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
timeout: 600.0s
timeout method: signal
timeout func_only: False
collected 9 items

tests/infra/test_apply.py .........                                                                                                                                                                                                                [100%]

=================================================================================================================== 9 passed in 0.34s ====================================================================================================================
/home/devops/.data/roadmap/implement-runs/devops-implement-akxhpq9r/work/model-clone/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
  • verify of group 6: uv run devops ci docs exits 0.
\u2139 Quality gate root: /home/devops/.data/roadmap/implement-runs/devops-implement-akxhpq9r/work/model-clone
\u2713 All documentation files are up to date.

@devops-cli-service
devops-cli-service Bot force-pushed the fix/6338-restart-k3s-with-a-cordon-and branch from ab9d30a to 2d9f1e3 Compare November 22, 2026 14:16
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

Tests & Coverage (shard 5 of 5)

The model repaired check Tests & Coverage (shard 5 of 5). The plan does not list these files, but the change of the branch causes their failure, so the repair could change them:

tests/commands/test_infra_node.py: it uses the changed name `FakeCluster`

@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 22, 2026 14:30
@dan-petty
dan-petty force-pushed the fix/6338-restart-k3s-with-a-cordon-and branch from 2d9f1e3 to b83d45d Compare November 22, 2026 14:59
@dan-petty
dan-petty merged commit cc703b6 into main Nov 22, 2026
29 checks passed
@dan-petty
dan-petty deleted the fix/6338-restart-k3s-with-a-cordon-and branch November 22, 2026 15:07
dan-petty pushed a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.194.2](v0.194.1...v0.194.2)
(2026-11-22)


### Bug Fixes

* **deps:** pin the devtools image at its first semantic version
([#6778](#6778))
([8e99f1d](8e99f1d)),
closes [#6775](#6775)
* **infra:** Restart k3s with a cordon and no drain
([#6744](#6744))
([cc703b6](cc703b6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/infra Docker container images, DevContainers, and infrastructure tooling type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(infra): restart k3s with a cordon and no drain

1 participant