Commit Graph
167 Commits
Author SHA1 Message Date
Hussein GalalandGitHub 3abffae92d External datastore support (#879)
* Adding new k3s function to get the config
* Adding a new way to get the bootstrap data directly from the server Pod
* Gate the bootstrap fetch if external datastore is in use
---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-06-26 17:22:00 +03:00
Enrico CandinoandGitHub 244011e68d Refactor kubeconfig URL generation (#938)
* Refactor kubeconfig generation to remove unused port parameter and update related functions

* Refactor kubeconfig generation to streamline error handling and remove unused imports

* Refactor kubeconfig URL generation functions and deprecate old implementation

* restore old behavior

* Add 'k3kcli kubeconfig get' command and update documentation

* Refactor URL generation by removing deprecated getURLFromService function and updating tests to use new implementation

* Fix expected URL for LoadBalancer test case to include hostname

* Refactor kubeconfig test documentation to clarify URL generation behavior for ClusterIP, NodePort, and LoadBalancer service types

* Refactor kubeconfig URL generation functions to improve clarity and maintainability

* Remove deprecated 'k3kcli kubeconfig get' command and update related documentation

* Set logger to discard in NewRootCmd for improved logging control

* Refactor getURLFromService to streamline ingress key retrieval
2026-06-26 11:16:54 +02:00
Enrico CandinoandGitHub 1e23fdb4fa Add unit tests for URL generation across service types in kubeconfig (#939)
* Add unit tests for URL generation across service types in kubeconfig

* addressed comments for SchemeBuilder and Context

* Refactor client creation and REST config loading in NewRootCmd

* Refactor scheme and schemeBuilder initialization

* use t.Helper in helper funcs
2026-06-25 14:44:19 +02:00
Enrico CandinoandGitHub 651da42ef0 Added provider.cattle.io=k3k label to Clusters (#901)
* added provider k3k label

* small change to check  build
2026-06-12 16:12:38 +02:00
ff02eb5473 Initial support for kata runtimes (#814)
* update shell script to exec and remove pipe, add conditional kmsg mount for kata

update logging config

Apply suggestions from code review

Co-authored-by: Enrico Candino <enrico.candino@gmail.com>

pr comments, remove isKata, fix agent unit tests, update config

fix validation

fix template

revert log changes

update init script

remove emptydir mounts from kata

remove emptydir mounts from kata

fix tests

lint

* add quickstart docs

* centralise kata spotspec modifications

* update doc

* update docs
2026-06-12 13:57:42 +03:00
Hussein GalalandGitHub 5bd779cdaa Refactor bootstrap data management (#869)
* Refactor bootstrap data management

* Change errors from errors.New to fmt.Errorf

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-06-03 19:40:31 +03:00
Kevin McDermott 4795ef5ae7 Mirror events for the cluster into the virtual cluster.
Adds a controller to watch for virtual cluster namespace events and
mirrors them into the virtual cluster.
2026-05-22 08:44:13 +01:00
Hussein GalalandGitHub 8457d3a20b Refactor servers and agents configuration management (#827)
* Refactor server config secret

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* lint fixes

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Refactor Agents configuration for virtual and shared mode

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* wsl

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* fixes

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* fix typo

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* fix unit tests

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Remove go assert depednecny

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-05-12 15:57:24 +03:00
Hussein GalalandGitHub 1ca9e7274c Add server and worker resource request and limits (#832)
* Add server and worker resource request and limits

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* docs

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-04-30 16:16:11 +03:00
Hussein GalalandGitHub d4c8f56639 Fix cgroup dirs for virtual mode clusters (#792)
* Fix cgroup dirs for virtual mode clusters

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-04-28 16:06:30 +03:00
Hussein GalalandGitHub d8f962e5dc Add WorkerLimit to shared cluster and add unit tests (#798)
* Fix WorkerLimit to shared agents
* Add unit tests for pod spec for both virtual and shared modes
* Fix image registry for virtual mode

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-04-17 13:07:45 +02:00
Hussein GalalandGitHub 28acb94d8a Add hostUsers to cluster spec (#787)
* Add hostUsers to cluster spec

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* wsl

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Fix the do comment for hostusers

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Fix the do comment for hostusers

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-04-15 15:46:23 +02:00
Enrico CandinoandGitHub 737dcf998e Added Policy finalizer (#781)
* added policy finalizer

* check with a small timeout

* comments

* removed requeue, renamed log
2026-04-15 11:14:22 +02:00
Enrico CandinoandGitHub 06c5aee7c9 add importas linter (#779) 2026-04-13 17:25:17 +02:00
Enrico CandinoandGitHub ba1648e560 Refactoring of tests moving common logic in tests/framework (#769)
* first commit

* refactor: update golangci configuration and reorder imports in namespace.go

* refactor: update golangci configuration for linters and formatters

* check restart for logs fetch

* rverted a bit the structure

* requested changes

* WriteLogs rename
2026-04-13 12:50:38 +02:00
Hussein GalalandGitHub 96d812a3cb Custom runtime class and security context (#742)
* Add experimental runtimeClass and securityContext to spec

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-04-09 10:22:46 +02:00
Gaurav MehtaandGitHub 8add97934e minor fix to translated ingress tls secrets in ingress object (#672)
* minor fix to translated ingress tls secrets in ingress object

updated cluster ingress sync options to include extra field for SyncTLSSecrets

Signed-off-by: Gaurav Mehta <gaurav.mehta@suse.com>

* rebase changes from main, include feedback for renaming ingress secret sync field to DisableTLSSecretTranslation, and add kubelet integration tests to verify secret name translation

Signed-off-by: Gaurav Mehta <gaurav.mehta@suse.com>

---------

Signed-off-by: Gaurav Mehta <gaurav.mehta@suse.com>
2026-04-08 11:39:23 +02:00
Hussein GalalandGitHub 183c5a0a5a Fix networkpolicy for kube-ovn network (#691)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-04-03 15:32:32 +02:00
Enrico CandinoandGitHub 18889ba6b7 Removed Pod mutating Webhook (shared mode) (#699)
* removed all webhook references

* fix tests

* removal of webhook

* updated doc

* add downward API test

* small refactor of virtual-kubelet

* split tests
2026-03-31 10:29:22 +02:00
Jonathan CrowtherandGitHub 624fee98d7 Refactor tests to their own directories (#723)
* Move cli tests

* Move e2e tests to their own directory

* Move integration tests

* Fix path within the cli tests

* Move k3k-kubelet tests

* Improve the various make test- options

* Remove dead code from cli tests

* Update development.md with the new make commands
2026-03-26 09:45:31 -04:00
Jonathan CrowtherandGitHub 25e910ccaf Add initial affinity to podspecs (#696)
* Add initial affinity to podspecs

* Fix go generate

* Add field to the policy and prioritize it over the cluster spec

* Fix linter issue

* Add docs

* Address comments

* Fix the tests and improve the field descriptions

* Fix formatter issues

* Change logs to info level

* run validation

* undo pandoc changes
2026-03-23 16:16:30 -04:00
Enrico CandinoandGitHub 9554628fc5 Update virtual-kubelet (v1.12) and Kubernetes deps (v1.35) (#716)
* bump virtual-kubelet and k8s

* bump controller-manager

* fix upgrade-downgrade

* fix kubernetes version

* Update tests_suite_test.go

* removed direct dep of yaml.v2, bump etcd modules
2026-03-23 12:51:43 +01:00
Kevin McDermott 056b36e8b5 Don't start the metrics server in tests.
This prevents the metrics server from starting when testing.

None of the tests check the metrics server.
2026-03-19 14:06:59 +00:00
Enrico CandinoandGitHub 7b0f695248 Bump some tes dependencies and fix lint (#708) 2026-03-18 17:43:41 +01:00
Enrico CandinoandGitHub 7641a1c9c5 Add sync of Host StorageClasses (#681)
* initial impl

* wip test

* fix

* wip tests

* Refactor storage class sync logic and enhance test coverage

* fix test

* remove storageclass sync test

* removed commented code

* added sync to cluster status to apply policy configuration

* fix for storageClass policy indexes

* fix for missing indexed field, and label sync

* - update sync options descriptions for resource types
- added storage class tests sync with policy
- requested changes

* fix for nil map
2026-03-17 16:53:29 +01:00
Enrico CandinoandGitHub 9836f8376d Added policy in Cluster Status (#663)
* initial implementation

restored policyName

* added test, fixed priority scheduling

* requested changes from review

- wrapped errors
- fixed some kube-api-linter issues to match k8s conventions
- moved policy namespace check in the same condition branch
2026-02-17 16:15:13 +01:00
Enrico CandinoandGitHub 0164c785ab Show correct allocatable resources when a Policy is applied (#638)
* wip

* wip

* wip

* fix lint and tests

* fixed bugs for missing resources

* cleanup and refactor

* removed coreClient from configureNode

* added comments to distribute algorithm
2026-01-27 15:56:37 +01:00
Hussein GalalandGitHub c1b7da4c72 SecretMounts feature and private registries (#570)
* Add SecretMounts field

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-01-26 21:47:40 +02:00
Kevin McDermottandGitHub c0418267c9 Merge pull request #623 from bigkevmcd/resource-quantity
Use resource.Quantity instead of a string for storageRequestSize in the Cluster definition.
2026-01-22 13:13:06 +00:00
Kevin McDermott eaa20c16e7 Make the storageRequestSize immutable.
It can't be changed in the StatefulSet and modifying the value causes an
error.
2026-01-22 08:27:20 +00:00
jpgouinandGitHub 0cea0c9e14 Only reconcile the server resource on the StatefullSet Controller (fix #618) 2026-01-21 16:53:52 +01:00
Kevin McDermott d12f3ea757 Fix lint issues and failing test.
golangci-lint was complaining about duplicate imports of corev1 and the
ordering of them in the files.
2026-01-21 14:50:30 +00:00
Kevin McDermott 9ea81c861b Use resource.Quantity for storageRequestSize
Previously the resource.Quantity was stored as string which allowed
invalid values to be created.

This performs validation on the strings using the standard K8s resource
mechanism.
2026-01-21 14:50:28 +00:00
jpgouinandGitHub ff6862e511 fix virtual pod NodeSelector #572 (#616) 2026-01-20 11:33:42 +01:00
Hussein GalalandGitHub a871917aec Refactor startup command to wait for node IP changes (#598)
* Patch node ip when server pod restarts

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* wsl

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Refactor startup command and adding safe mode

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Add date/time logging to the startup script

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* fixes

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2026-01-09 16:29:47 +02:00
Enrico CandinoandGitHub e385ceb66f Fixed missing Kubernetes host version when specified (#585)
* fix for missing host version

* added test

* fix test

* fix test
2025-12-03 09:21:27 +01:00
Enrico CandinoandGitHub 5c49c3d6b7 Fix create events rbac (#575)
* cleanup logs in kubelet provider

* added events create rbac to kubelet

* fix lint, moved fetch pod logic in separate func
2025-11-25 13:48:04 +01:00
Enrico CandinoandGitHub 7dc4726bbd Fixed panic during kubeconfig generate (#554)
* fix panic during kubeconfig generate

* moved check
2025-11-11 17:18:26 +01:00
Enrico CandinoandGitHub 7144cf9e66 Moved CRDs to Helm templates folder (#552)
* moved CRDs of Cluster and VirtualClusterPolicy

Updated the generate script to output CRDs to the correct directory and include the keep resource policy annotation.

* fix crd directory in tests
2025-11-11 16:22:56 +01:00
Enrico CandinoandGitHub af9e1d6ca7 Cleanup orphaned resources after Cluster deletion (#540)
* adding controller reference for garbage collection, delete API lease

* added test

* fix lint
2025-10-31 15:25:38 +01:00
Enrico CandinoandGitHub bf70e0d171 Updated Cluster and VirtualClusterPolicy spec for sync and loadbalancer (#528)
* add default false for ingress and priorityClass, cleanup tests and added new tests

* fix typo for loadBalancer

* fix test aligning VirtualClusterPolicy SyncConfig

* set required enabled field, revert pointer on optional SyncConfig

* update samples
2025-10-24 17:02:26 +02:00
Enrico CandinoandGitHub cebf6594c4 switch to text log as default (#529) 2025-10-24 13:42:41 +02:00
Enrico CandinoandGitHub 075d72df5d Cleanup of customCAs spec (#527)
* cleanup spec from customCAs when omitted

* add enabled default for customCAs
2025-10-23 22:11:44 +02:00
Enrico CandinoandGitHub ee7eac89ce Enhance logging and update Helm installation parameters for better debugging and cluster management (#519) 2025-10-22 14:55:47 +02:00
Enrico CandinoandGitHub 594c2571c3 promoted v1alpha1 resources to v1beta1 (#505) 2025-10-13 17:24:56 +02:00
Enrico CandinoandGitHub 7387fc1b23 Fix Service reconciliation error loop (#497)
* fix service reconciliation error by adding checks for virtual service annotations

* renamed var
2025-10-08 14:03:50 +02:00
Enrico CandinoandGitHub 9f265c73d9 Fix for HA server deletion (#493)
* wip

* wip

* wip

* removed todo
2025-10-08 13:23:15 +02:00
Enrico CandinoandGitHub 00ef6d582c Add log-format, and cleanup (#494)
* using logr.Logger

* testing levels

* adding log format

* fix lint

* removed tests

* final cleanup
2025-10-08 13:19:57 +02:00
Enrico CandinoandGitHub 5c95ca3dfa Fix for pod eviction in host cluster (#484)
* update statefulset controller

* fix for single pod

* adding pod controller

* added test

* removed comment

* merged service controller

* revert statefulset

* added test

* added common owner filter
2025-10-03 16:22:54 +02:00
jpgouinandGitHub 6523b8339b change the default storage request size request to 2Gi (#490)
* change the default storage request size request to 2Gi
2025-10-03 09:04:13 +02:00