fix(k3s): order coder.service after coder-k3s-namespace#24
Open
bpmct wants to merge 2 commits into
Open
Conversation
On a cold boot Coder could start provisioning before the
coder-k3s-namespace oneshot had created the coder-workspaces namespace,
so the first workspace build failed with:
Error: namespaces "coder-workspaces" not found
(the namespace then appeared seconds later, leaving the workspace stuck
in a failed state until a manual rebuild).
Add after + requires = [ "coder-k3s-namespace.service" ] to the
coder.service overlay in both k3s-podman.nix and k3s-sysbox.nix so the
namespace is guaranteed to exist before Coder runs its first
template-sync / workspace build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a cold boot, Coder could start provisioning before the
coder-k3s-namespaceoneshot had created thecoder-workspacesnamespace, so the first workspace build failed with:The namespace then appeared seconds later (the oneshot is only
wantedBy = multi-user.target, with no ordering vs.coder.service), leaving the workspace stuck in a failed state until a manual rebuild/retry.Observed live on a box: a
k3s-podmanworkspace build failed at20:20:33;coder-workspaceswas created at20:21:08— 35 s too late. Re-running the build then succeeded with no other change.Fix
Add to the
systemd.services.coderoverlay in bothnixos/k3s-podman.nixandnixos/k3s-sysbox.nix:coder-k3s-namespacealready orders itself after k3s + the kubeconfig fix, so this guarantees the namespace exists before Coder runs its firstcoder-init-admintemplate deploy / workspace build.Validation
nixos-rebuild dry-build --flake /etc/nixos-repo— evaluates clean.