Skip to content

Commit

Permalink
flatcar: Run kubeadm after containerd
Browse files Browse the repository at this point in the history
Ensure kubeadm runs after containerd to avoid a race condition between
the two.

We intentionally add an After= directive and not a Requires= directive
to avoid breaking things for distros which use Ignition and don't use
containerd.

See kubernetes-sigs/image-builder#939.

Signed-off-by: Johanan Liebermann <[email protected]>
  • Loading branch information
johananl committed Sep 28, 2023
1 parent 76e369a commit 84f7fc8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/cluster-template-flatcar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ spec:
# kubeadm must run after coreos-metadata populated /run/metadata directory.
Requires=coreos-metadata.service
After=coreos-metadata.service
# kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
After=containerd.service
[Service]
# To make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
Expand Down Expand Up @@ -155,6 +157,8 @@ spec:
# kubeadm must run after coreos-metadata populated /run/metadata directory.
Requires=coreos-metadata.service
After=coreos-metadata.service
# kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
After=containerd.service
[Service]
# To make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ spec:
# kubeadm must run after coreos-metadata populated /run/metadata directory.
Requires=coreos-metadata.service
After=coreos-metadata.service
# kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
After=containerd.service
[Service]
# To make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
Expand Down Expand Up @@ -154,6 +156,8 @@ spec:
# kubeadm must run after coreos-metadata populated /run/metadata directory.
Requires=coreos-metadata.service
After=coreos-metadata.service
# kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
After=containerd.service
[Service]
# To make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ spec:
# kubeadm must run after coreos-metadata populated /run/metadata directory.
Requires=coreos-metadata.service
After=coreos-metadata.service
# kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
After=containerd.service
[Service]
# To make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
# kubeadm must run after coreos-metadata populated /run/metadata directory.
Requires=coreos-metadata.service
After=coreos-metadata.service
# kubeadm must run after containerd - see https://github.com/kubernetes-sigs/image-builder/issues/939.
After=containerd.service
[Service]
# To make metadata environment variables available for pre-kubeadm commands.
EnvironmentFile=/run/metadata/*
Expand Down

0 comments on commit 84f7fc8

Please sign in to comment.