We use constants.OldestKubernetesVersion for testing the oldest version
and limiting --kubernetes-version when starting the clusters. Our
tradition is testing 6 releases back from current version, but we were
testing 14 release back (1.20.0).
For upgrading containerd to latest version (v2.1.4) we need to upgrade
to a newer release. Upgrade constants.OldestKubernetesVersion to 1.28.0
which seems to pass all tests.
legacyVersion() used in version_upgrade_test.go was 1.26.0. The comment
in file mention that this should be release from the last 6 month. We do
see failures in the relevant tests (TestRunningBinaryUpgrade) in many
builds so I bumped it as well to 1.32.0 (2 releases back from current).
In preload_test.go we tested --kubernetes-version=1.24.4 which is not
compatible with containerd v2. Use legacyVersion() instead so we don't
need to maintain another version.
We had many example of --kubernetes-version in the docs using older
version which are not supported. Replace all example with current
version to minimize future maintenance. We need to automated this later
so updating the version in minikube will also update the examples.
With this change we have 2 places to update kubernetes versions:
- constants.*KubernetesVersion
- legacyVersion()
Updated ingress-dns addon Pod template to align with current
deployment requirements:
* Added hostPort mapping for UDP 53
* Mounted ConfigMap for configurable DNS settings
* Introduced dns-nodata-delay-ms option via ConfigMap
- Switched default ingress-dns image reference from
gcr.io/k8s-minikube/minikube-ingress-dns to
kicbase/minikube-ingress-dns (multi-arch build available
on Docker Hub).
- Left legacy image mapping in aliyun_mirror.json for
backward compatibility, while adding new kicbase mapping.
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
Replace traditional append-in-loop patterns with modern Go functions slices.Sorted(), slices.Collect(), and maps.Keys()/maps.Values()
Changes made (5 files):
- cmd/minikube/cmd/config/addons_list.go: Use slices.Sorted(maps.Keys())
- cmd/minikube/cmd/version.go: Use slices.Sorted(maps.Keys())
- hack/changelog/changelog.go: Use slices.Collect(maps.Keys())
- pkg/minikube/node/cache.go: Use slices.Collect(maps.Keys())
- pkg/minikube/registry/registry.go: Use slices.Collect(maps.Values())
Files skipped due to complexity:
- pkg/drivers/kic/oci/oci.go
- pkg/drivers/hyperkit/driver.go
- pkg/drivers/kvm/gpu.go
- pkg/drivers/kvm/numa.go [Unrelated slice optimization possible, can be addressed along with other similar code]
- pkg/minikube/tunnel/kic/*
- cmd/minikube/cmd/service.go
- hack/legacy_fill_db/filldb.go
These cases require more sophisticated transformation logic that might be better addressed in separate issue/PR
Replace 9p mounts with virtiofs for vfkit and krunkit. Testing shows
that virtiofs mount is 23 times faster with krunkit, and 8 times faster
with vfkit.
vfkit and krunkit support multiple virtiofs mounts but minikube
--mount-* flags are not ready for multiple mounts. We have the same
issue with KIC drivers, supporting multiple mounts but using only one.
We hope to improve this in the next release.
Example usage:
minikube start --mount-string ~/models:/mnt/models
The arguments are parsed and validated when configuring the driver, so
invalid arguments fail quickly without starting the driver. The
validated mounts are stored in the machine config:
$ jq '.Driver.VirtiofsMounts' < ~/.minikube/machines/minikube/config.json
[
{
"HostPath": "/Users/joe/models",
"GuestPath": "/mnt/models",
"Tag": "f845b54d-00e3-493d-9541-3b37490b96db"
}
]
Minikube generates a new random UUID for every virtiofs mount to
identify the file system inside the guest. In krunkit and vfkit, every
mount is add as:
--device virtio-fs,sharedDir=/host-path,mountTag=f845b54d-00e3-493d-9541-3b37490b96db
When the guest is started the shared directory is mounted via SSH using:
sudo mkdir -p /mnt/models
sudo mount -t virtiofs f845b54d-00e3-493d-9541-3b37490b96db /mnt/models
Example mount:
$ minikube ssh findmnt /mnt/models
TARGET SOURCE FSTYPE OPTIONS
/mnt/models f845b54d-00e3-493d-9541-3b37490b96db virtiofs rw,relatime
More work is needed to add VirtioFS to qemu. I'm starting with vfkit and
krunkit since they have identical interface (krunkit was designed as
drop-in replacement for vfkit).
* test: Add findmnt package
When testing mounts we can use findmnt --json output to parse the output
cleanly. The package provides only ParseOutput() now, but it can be
extended later to run the findmnt command.
* test: Support virtiofs mounts
Use findmnt command to get the mounted filesystem details cleanly.
We use the actual mount fstype instead of driver name check so we can
switch drivers to virtiofs without changing the test.
For virtiofs mount we skip options validation since we don't support
setting virtiofs options yet, and the options are not the same as 9p
options.
For 9p mounts the uid= and gid= flags were fixed to match the real flags
(dfltuid=,dfltgid=). The issue was hidden by imprecise string matching.