Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

feat: install Kubernetes to Flatcar from sysexts on MAR#7680

Merged
awesomenix merged 12 commits intomainfrom
chewi/aks-flatcar
Feb 18, 2026
Merged

feat: install Kubernetes to Flatcar from sysexts on MAR#7680
awesomenix merged 12 commits intomainfrom
chewi/aks-flatcar

Conversation

@chewi
Copy link
Contributor

@chewi chewi commented Jan 19, 2026

What this PR does / why we need it:

Following #7125, this installs kubelet, kubectl, and acr-credential-provider to Flatcar from systemd system extensions hosted on MAR.

Flatcar is immutable so cannot use traditional packages. The sysexts are downloaded using ORAS at build time and the desired version is later "merged" by simply creating symlinks and calling systemd-sysext refresh.

If a sysext for the requested Kubernetes version cannot be found locally at deployment time, ORAS is used to try and fetch one. Failing that, it falls back to downloading the regular binary tarballs.

Sysexts are a systemd concept, so they have been published using systemd's architecture names rather than Docker's even though they are hosted in an OCI registry.

The sysexts are built using Dalec from a distribution other than Flatcar, which is currently Azure Linux 3.

Renovate has been configured to consider azlinux3 part of the version so that different Kubernetes releases could potentially be built from different distributions. The use of matchCurrentVersion ensures that tags containing azlinux3 (e.g. not noble) will only be applied against artifacts already using azlinux3. Switching distribution should be a manual change.

This also adjusts the "aks-sysext" hack currently applied to Flatcar that allows writing to /usr/local/bin. Despite efforts to use /opt/bin instead, it is likely that waagent will still need to write here for the time being. aks-sysext now allows writes to all of /usr/local rather than just /usr/local/bin. The underlying files are now written under /mnt rather than /etc because Flatcar is going to start using confexts, making /etc an overlayfs, which would cause issues here.

The rest is just renames, refactoring, and fixes to support the above.

Which issue(s) this PR fixes:

Fixes Flatcar for AKS work item #34435556

@chewi chewi self-assigned this Jan 19, 2026
@github-actions github-actions bot added the components This pull request updates cached components on Linux or Windows VHDs label Jan 19, 2026
@chewi chewi changed the title Install K8s from systemd system extensions on Flatcar feat: install Kubernetes to Flatcar from sysexts on MAR Jan 19, 2026
@chewi chewi force-pushed the chewi/aks-flatcar branch from 0f01d7a to bb63179 Compare January 19, 2026 17:29
@chewi chewi force-pushed the chewi/aks-flatcar branch from bb63179 to 1edf82e Compare January 20, 2026 21:40
@chewi chewi force-pushed the chewi/aks-flatcar branch from 1edf82e to 9fafc40 Compare January 21, 2026 11:23
@chewi chewi force-pushed the chewi/aks-flatcar branch from 9fafc40 to e77233d Compare January 21, 2026 11:40
@chewi
Copy link
Contributor Author

chewi commented Jan 21, 2026

I am seeing a few persistent CI failures relating to sudo, which I haven't touched, at least not in this PR.

+ sudo sshd -t -f /tmp/tmp.0M7Kkzjjsv
sudo: Account or password is expired, reset your password and try again
Changing password for root.
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
sudo: a password is required

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 85 changed files in this pull request and generated 2 comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 85 changed files in this pull request and generated 3 comments.

chewi added 12 commits February 16, 2026 18:40
There are only really four outcomes here, install kubelet and kubectl
from a URL, bootstrap profile registry, or package, or fail.
There are only really four outcomes here, install the credential
provider from a URL, bootstrap profile registry, or package, or fail.
Flatcar will use the same logic but install these from MAR instead, so
make the name a bit more generic.
Flatcar will use the same logic but install these from MAR instead, so
make the name a bit more generic.
Flatcar is immutable so cannot use traditional packages. The sysexts are
downloaded using ORAS at build time and the desired version is later
"merged" by simply creating symlinks and calling systemd-sysext refresh.

If a sysext for the requested Kubernetes version cannot be found locally
at deployment time, ORAS is used to try and fetch one. Failing that, it
falls back to downloading the regular binary tarballs.

Sysexts are a systemd concept, so they have been published using
systemd's architecture names rather than Docker's even though they are
hosted in an OCI registry.

The sysexts are built using Dalec from a distribution other than
Flatcar, which is currently Azure Linux 3.

Renovate has been configured to consider `azlinux3` part of the version
so that different Kubernetes releases could potentially be built from
different distributions. The use of `matchCurrentVersion` ensures that
tags containing `azlinux3` (e.g. not `noble`) will only be applied
against artifacts already using `azlinux3`. Switching distribution
should be a manual change.
Functions like installKubeletKubectlFromPkg exist in multiple distro
scripts, so one script will shadow another. Only load the applicable
scripts when required by grouping the tests for each distro.

Defining BeforeEach as a function is not the correct way to use it, so
such usage was doing nothing. You need to give it code as a string.

Signed-off-by: James Le Cuirot <[email protected]>
This was mostly written by Copilot, but it did a good job.
Hosting a directory-based sysext from /etc is a problem because Flatcar
will use confext soon, which will make /etc an overlayfs. It is now
hosted from /opt/aks-sysext instead.

Pointing the /usr/local/bin symlink at /opt/bin is also confusing
because AKS now installs several binaries here. It just needs to point
somewhere writeable, so this now points under /opt/aks-sysext-rw.

Signed-off-by: James Le Cuirot <[email protected]>
Flatcar is breaking the OSProfile limit again, so savings need to be
made somewhere. This helper function is only used in that one file.

Signed-off-by: James Le Cuirot <[email protected]>
It's a legacy file with .deb package data, and Flatcar needs to save
space in OSProfile.

Also the `MANIFEST_FILEPATH` references in the tests were unused.

Signed-off-by: James Le Cuirot <[email protected]>
@awesomenix awesomenix merged commit f30e520 into main Feb 18, 2026
39 of 43 checks passed
@awesomenix awesomenix deleted the chewi/aks-flatcar branch February 18, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components This pull request updates cached components on Linux or Windows VHDs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants