Brad Davidson
3cb6c2dc92
Avoid use of github.com/pkg/errors functions that capture stack
...
We are not making use of the stack traces that these functions capture, so we should avoid using them as unnecessary overhead.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit bed1f66880 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-03-07 14:46:16 -08:00
Brad Davidson
ad668b3897
Update containerd config schema to version 3
...
Ref: https://github.com/containerd/containerd/blob/release/2.0/docs/cri/config.md
Since this is a breaking change, add support for a new v3 template file. If no v3 template is present, fall back to checking for the legacy v2 template and render the old structure.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit bc45972398 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-02-10 10:16:22 -08:00
Brad Davidson
9b003e9a9e
Upgrade containerd to v2.0.2
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 124e46bccf )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-02-10 10:16:22 -08:00
Brad Davidson
1ad3551b36
Fix containerd hosts.toml path on windows
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit bf97b8facc )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-02-10 10:16:22 -08:00
Brad Davidson
84522f0229
Consolidate linux and windows containerd config templates
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 85b3775071 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2025-02-10 10:16:22 -08:00
Vitor Savian
2e419c771d
Add auto import images for containerd image store
...
* Add auto import images for containerd image store
* Add auto import images
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
* Fix EOF error log when importing tarball files
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
* Delaying queue
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
* Add parse for images
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
---------
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
2025-01-11 01:59:24 -03:00
Brad Davidson
a413c5baf7
Add nonroot-devices flag to agent CLI
...
Add new flag that is passed through to the device_ownership_from_security_context parameter in the containerd CRI config. This is not possible to change without providing a complete custom containerd.toml template so we should add a flag for it.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 56fb3b0991 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-11-06 12:40:51 -08:00
manuelbuil
d74ad4253a
Add the nvidia runtime cdi
...
Signed-off-by: manuelbuil <mbuil@suse.com >
2024-10-12 07:38:21 +02:00
Vitor Savian
efa2804d55
Add user path to runtimes search
...
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
2024-10-08 13:18:43 -03:00
Brad Davidson
2caa785e17
Only clean up containerd hosts dirs managed by k3s
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 270f85e468 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-09-06 11:30:11 -07:00
galal-hussein
5087240e32
Downgrade Microsoft/hcsshim to v0.8.26
...
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
2024-08-22 14:23:34 -07:00
galal-hussein
20b50426ab
Update to v1.31.0
...
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
2024-08-22 14:23:34 -07:00
Brad Davidson
30999f9a07
Switch stargz over to cri registry config_path
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-05-23 13:35:15 -07:00
Brad Davidson
5f6b813cc8
Add WithSkipMissing to not fail import on missing blobs
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-05-23 13:32:22 -07:00
Hussein Galal
144f5ad333
Kubernetes V1.30.0-k3s1 ( #10063 )
...
* kubernetes 1.30.0-k3s1
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Update go version to v1.22.2
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update dynamiclistener and helm-controller
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update go in go.mod to 1.22.2
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update go in Dockerfiles
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update cri-dockerd
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Add proctitle package with linux and windows constraints
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* go mod tidy
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Fixing setproctitle function
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* update dynamiclistener to v0.6.0-rc1
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
---------
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
2024-05-06 19:42:27 +03:00
Brad Davidson
f099bfa508
Fix error when image has already been pulled
...
CRI and containerd APIs disagree about the registry names - CRI supports
index.docker.io as an alias for docker.io, while containerd does not.
Use the actual stored RepoTag to determine what image to ask containerd for.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-03-26 16:19:40 -07:00
Brad Davidson
bba3e3c66b
Fix wildcard entry upstream fallback
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-03-12 23:31:16 -07:00
Brad Davidson
fe2ca9ecf1
Warn and suppress duplicate registry mirror endpoints
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-03-07 16:30:06 -08:00
Vitor Savian
59c724f7a6
Fix wildcard with embbeded registry test
...
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-03-05 14:38:36 -08:00
Flavio Castelli
64e4f0e6e7
fix: use correct wasm shims names
...
Fix the wasm shim detection and the containerd configuration generation.
Prior to this commit, the binary and the `RuntimeType` values were not
correct.
Signed-off-by: Flavio Castelli <fcastelli@suse.com >
2024-03-05 13:12:08 -08:00
Brad Davidson
b164d7a270
Fix additional corner cases in registries handling
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-03-04 11:59:33 -08:00
Harrison Affel
a36cc736bc
allow executors to define containerd and docker behavior
...
Signed-off-by: Harrison Affel <harrisonaffel@gmail.com >
2024-02-09 15:51:35 -03:00
Brad Davidson
753c00f30c
Consistently handle component exit on shutdown
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-02-07 10:23:54 -08:00
Vitor Savian
e9cec46a23
Runtimes refactor using exec.LookPath
...
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
2024-02-07 15:06:16 -03:00
Brad Davidson
97a22632b9
gofmt config_test.go
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-02-01 18:51:51 -08:00
Brad Davidson
29848dea3d
Fix issues with certs.d template generation
...
* Fix issue with bare host or IP as endpoint
* Fix issue with localhost registries not defaulting to http.
* Move the registry template prep to a separate function,
and adds tests of that function so that we can ensure we're
generating the correct content.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-02-01 12:09:13 -08:00
Brad Davidson
37e9b87f62
Add embedded registry implementation
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-01-09 15:23:05 -08:00
Brad Davidson
16d29398ad
Move registries.yaml load into agent config
...
Moving it into config.Agent so that we can use or modify it outside the context of containerd setup
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-01-09 15:23:05 -08:00
Brad Davidson
5c99bdd9bd
Pin images instead of locking layers with lease
...
Layer leases never did what we wanted anyways, and this is the new approved interface for ensuring that images do not get GCd
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-01-09 15:23:05 -08:00
Lex Rivera
5fe074b540
Add more paths to crun runtime detection ( #9086 )
...
* add usr/local paths for crun detection
Signed-off-by: Lex Rivera <me@lex.io >
2024-01-04 16:51:13 -08:00
Brad Davidson
c45524e662
Add support for containerd cri registry config_path
...
Render cri registry mirrors.x.endpoints and configs.x.tls into config_path; keep
using mirrors.x.rewrites and configs.x.auth those do not yet have an
equivalent in the new format.
The new config file format allows disabling containerd's fallback to the
default endpoint when using mirror endpoints; a new CLI flag is added to
control that behavior.
This also re-shares some code that was unnecessarily split into parallel
implementations for linux/windows versions. There is probably more work
to be done on this front but it's a good start.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-01-04 16:50:26 -08:00
Vitor Savian
03532f7c0b
Added runtime classes for crun/wasm/nvidia
...
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
Added default runtime flag
Signed-off-by: Vitor Savian <vitor.savian@suse.com >
2023-12-08 15:49:28 -03:00
Flavio Castelli
ba5fcf13fc
Wasm shims and runtimes detection
...
Create a generic helper function that finds extra containerd runtimes.
The code was originally inside of the nvidia container discovery file.
Signed-off-by: Flavio Castelli <fcastelli@suse.com >
Discover the containerd shims based on runwasi that are already
available on the node.
The runtimes could have been installed either by a package manager or by
the kwasm operator.
Signed-off-by: Flavio Castelli <fcastelli@suse.com >
The containerd configuration on a Linux system now handles the nvidia
and the WebAssembly runtimes.
Signed-off-by: Flavio Castelli <fcastelli@suse.com >
---------
Signed-off-by: Flavio Castelli <fcastelli@suse.com >
2023-11-13 14:43:41 -08:00
Manuel Buil
d3f7632463
Fix error reporting
...
Signed-off-by: Manuel Buil <mbuil@suse.com >
2023-08-31 17:20:14 +02:00
Derek Nola
d218068f34
Adds a warning about editing to the containerd config.toml file ( #7057 )
...
* Add a warning to the config.toml file
Signed-off-by: Derek Nola <derek.nola@suse.com >
Co-authored-by: Brad Davidson <brad@oatmail.org >
2023-03-13 13:42:17 -07:00
Derek Nola
0d4caf4e24
Wait for cri-dockerd socket ( #6812 )
...
* Wait for cri-dockerd socket
* Consolidate cri utility functions
Signed-off-by: Derek Nola <derek.nola@suse.com >
2023-01-27 13:16:59 -08:00
Brad Davidson
f54b5e4fa0
Fix CI tests
...
* General cleanup of test-helpers functions to address CI failures
* Install awscli in test image
* Log containerd output to file even when running with --debug
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-01-13 17:22:25 -08:00
Hussein Galal
f8b661d590
Update to v1.26.0-k3s1 ( #6370 )
...
* Update to v1.26.0-alpha.2
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* go generate
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Default CURRENT_VERSION to VERSION_TAG for alpha versions
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* remove containerd package
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Update k8s to v1.26.0-rc.0-k3s1 cri-tools cri-dockerd and cadvisor
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* replace cri-api reference to the new api
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* go mod tidy
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Fix version script to allow rc and alphas
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Fix version script to allow rc and alphas
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Fix version script to allow rc and alphas
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Update to Kubernetes 1.26.0-rc.1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
* Undo helm-controller pin
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
* Bump containerd to -k3s2 for stargz fix
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
* DevicePlugins featuregate is locked to on
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
* Bump kine for DeleteRange fix
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
* Update to v1.26.0-k3s1
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* go mod tidy
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* Bring back snapshotter checks and update golang to 1.19.4
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
* fix windows containerd snapshotter checks
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com >
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
Co-authored-by: Brad Davidson <brad.davidson@rancher.com >
2022-12-10 01:42:15 +02:00
Derek Nola
06d81cb936
Replace deprecated ioutil package ( #6230 )
...
* Replace ioutil package
* check integration test null pointer
* Remove rotate retries
Signed-off-by: Derek Nola <derek.nola@suse.com >
2022-10-07 17:36:57 -07:00
Brad Davidson
4aca21a1f1
Add cri-dockerd support as backend for --docker flag
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2022-08-05 02:39:25 -07:00
Brad Davidson
db2ba7b61d
Don't enable unprivileged ports and icmp on old kernels
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2022-07-28 14:33:20 -07:00
Brad Davidson
bd5fdfce33
Fix server systemd detection
...
* Use INVOCATION_ID to detect execution under systemd, since as of a9b5a1933f NOTIFY_SOCKET is now cleared by the server code.
* Set the unit type to notify by default for both server and agent, which is what Rancher-managed installs have done for a while.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2022-07-21 13:42:20 -07:00
Brad Davidson
3399afed83
Ensure that CONTAINERD_ variables are not shadowed by later entries
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2022-06-15 10:58:12 -07:00
Brad Davidson
a69d635c9b
Drop unnecessary intermediate variable
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2022-04-29 09:22:57 -07:00
Brad Davidson
333311c7ee
Add systemd cgroup controller support
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2022-04-29 09:22:57 -07:00
Dirk Müller
fa0fa8b1d0
Update golangci-lint to 1.45.2
...
This requires a further set of gofmt -s improvements to the
code, but nothing major. golangci-lint 1.45.2 brings golang 1.18
support which might be needed in the future.
Signed-off-by: Dirk Müller <dirk@dmllr.de >
2022-04-13 14:48:42 -07:00
Luther Monson
13191da58a
add a wrapper around the containerd.New call to fix and pass the proper npipe connector
...
Signed-off-by: Luther Monson <luther.monson@gmail.com >
2022-03-29 18:06:48 -07:00
Luther Monson
9a849b1bb7
[master] changing package to k3s-io ( #4846 )
...
* changing package to k3s-io
Signed-off-by: Luther Monson <luther.monson@gmail.com >
Co-authored-by: Derek Nola <derek.nola@suse.com >
2022-03-02 15:47:27 -08:00
Brad Davidson
bc7635f01f
Move containerd wait into exported function
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2022-01-25 13:09:30 -08:00
Brad Davidson
a70487d5ae
Update wharfie usage in windows code path
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2021-12-09 13:16:22 -08:00