Commit Graph

88 Commits

Author SHA1 Message Date
Enrico Candino
2655d792cc Update allowedModeTypes field to allowedMode (#367)
* change allowedModeTypse to allowedMode

* added shortname "vcp" and additional mode column
2025-05-29 14:53:58 +02:00
Enrico Candino
8fbe4b93e8 Change VirtualClusterPolicy scope to Cluster (#358)
* rename clusterset to policy

* fixes

* rename clusterset to policy

* wip

* go mod

* cluster scoped

* gomod

* gomod

* fix lint

* wip

* moved logic to vcp controller

* update for clusters

* small fixes

* update cli

* fix docs, updated spec

* fix cleanup

* added missing owns for limitranges
2025-05-29 10:45:48 +02:00
jpgouin
2b1448ffb8 add air-gap support (#359)
* add airgap support
* add airgap howto guide
2025-05-27 10:13:07 +02:00
Enrico Candino
cca3d0c309 Rename ClusterSet to VirtualClusterPolicy (#349)
* rename clusterset to policy

* fixes
2025-05-15 12:04:47 +02:00
Hussein Galal
37fe4493e7 Fix HA init server scaling (#333)
* Fix HA init server scaling

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

* increase timeout in e2e test

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-05-12 11:51:35 +03:00
Enrico Candino
96a4341dfb Services updates (LoadBalancerConfig and NodePortConfig) (#329)
* updates to services

- added loadBalancerConfig
- removed service-port
- added logic to not expose services

* Refactor cluster tests to improve readability and maintainability

- Simplified service port expectations by directly accessing elements instead of using `ContainElement`.
- Enhanced clarity of test assertions for `k3s-server-port` and `k3s-etcd-port` attributes.
- Removed redundant code for checking service ports.

* fix ports for ingress expose, update kubeconfig generate
2025-04-22 11:52:18 +02:00
Hussein Galal
510ab4bb8a Add extra env for servers/agents (#324)
* Add extra env for servers/agents

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

* wsl

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

* cli docs

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

* Fix container env

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-04-21 12:25:51 +02:00
Hussein Galal
d41d2b8c31 Fix update bug in ensureObject (#325)
* Fix update bug in ensureObjects

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

* wsl

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

* Fix log msg

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

* Fix import

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Co-authored-by: Enrico Candino <enrico.candino@gmail.com>
2025-04-09 17:25:48 +02:00
Enrico Candino
90568f24b1 Added ClusterSet as singleton (#316)
* added ClusterSet as singleton

* fix tests
2025-04-03 16:26:25 +02:00
Hussein Galal
0843a9e313 Initial support for ResourceQuotas in clustersets (#308)
* Add ResourceQuota to clusterset

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

* wsl fixes

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

* Generate docs

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

* fix tests

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

* Add a defualt limitRange for ClusterSets

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

* fix linting

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

* fix docs

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

* Add test for clusterset limitRange

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

* Add server and worker limits

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

* make charts

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

* add default limits and fixes to resourcesquota

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

* wsl lint

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

* wsl lint

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

* make docs

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

* make build-crds

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

* make build-crds

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

* make spec as pointer

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

* fix tests

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

* fix tests

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

* delete default limit

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

* wsl lint

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

* wsl

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

* wsl

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

* Update tests

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

* Update tests

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

* return on delete in limitrange

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

* wsl

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-04-03 12:30:48 +02:00
Enrico Candino
c4cc1e69cd requeue if server not ready (#318) 2025-04-03 10:45:18 +02:00
Enrico Candino
3281d54c6c fix typo (#300) 2025-03-24 10:48:42 +01:00
Enrico Candino
2b7202e676 Added NetworkPolicy for Cluster isolation (#290)
* added cluster NetworkPolicy

* wip tests

* remove focus

* added networking test

* test refactoring

* unfocus

* revert labels

* added async creation of clusters, and namespace deletion

* add unfocus validation
2025-03-07 14:36:49 +01:00
Enrico Candino
5e8bc0d3cd Update CRDs documentation (#279)
* complete CRD documentation

* fix missing rebuild of CRDs
2025-03-03 11:47:53 +01:00
Enrico Candino
430e18bf30 Added wsl linter, and fixed related issues (#275)
* added wsl linter

* fixed issues
2025-02-27 10:59:02 +01:00
Hussein Galal
ec0e5a4a87 Support for multi node in shared mode (#269)
* Support for multi node in shared mode

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

* Fixing typo

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>
2025-02-26 22:55:31 +02:00
Hussein Galal
c2cde0c9ba Fix the default CIDRs for both modes (#271)
* Fix the default CIDRs for both modes

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

* Fix service/cluster cidr

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-02-26 11:32:17 +02:00
Enrico Candino
26a0bb6583 Added ServiceCIDR lookup, and changed default (#263)
* added serviceCIDR lookup

* fix log

* fix comment

* swap serviceCIDR lookup
2025-02-24 12:08:58 +01:00
Hussein Galal
8811ba74de Fix cluster spec update (#257)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-02-18 15:40:49 +02:00
Hussein Galal
fa553d25d4 Default to dynamic persistence and fix HA restarts (#250)
* Default to dynamic persistence and fix HA restarts

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-02-14 14:26:10 +02:00
Enrico Candino
51a8fd8a8d Fix and enhancements to IngressExposeConfig (annotations) (#248)
* ingress fixes

* added annotations to IngressConfig

* sync annotations with CR

* removed hosts

* small doc for ingress
2025-02-14 12:38:42 +01:00
Enrico Candino
fdb133ad4a Added Ports to NodePortConfig and expose fixes (#247)
* fix NodePort service update

* updated crd docs
2025-02-11 14:47:01 +01:00
Enrico Candino
8d1bda4733 fix panic for nil Expose (#240) 2025-02-10 12:44:53 +01:00
Hussein Galal
ac132a5840 Fixing etcd pod controller (#233)
* Fixing etcd pod controller

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

* Fix logic in etcd pod controller

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-02-06 22:36:05 +02:00
Enrico Candino
48efbe575e Fix Webhook certificate recreate (#226)
* wip cert webhook

* fix lint

* cleanup and refactor

* fix go.mod

* removed logs

* renamed

* small simplification

* improved logging

* improved logging

* some tests for config data

* fix logs

* moved interface
2025-02-05 21:55:34 +01:00
jpgouin
3df5a5b780 Merge pull request #213 from jp-gouin/fix-ingress
fix ingress creation, use the ingress host in Kubeconfig when enabled
2025-02-04 09:31:49 +01:00
Enrico Candino
2a7541cdca Fix missing updates of server certificates (#219)
* merge

* wip test

* added test for restart

* tests reorg

* simplified tests
2025-02-04 09:17:56 +01:00
Enrico Candino
bc3f906280 Fix status update, updated k3s default version, updated CRDs (#218)
* fix status update

* fix schema and default image

* removed retry in controller

* removed fmt
2025-01-30 12:56:42 +01:00
Hussein Galal
19efdc81c3 Add initial support for daemonsets (#217)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-01-30 00:59:25 +02:00
Enrico Candino
54be0ba9d8 Logs and organization cleanup (#208)
* logs and organization cleanup

* getting log from context

* reused log var
2025-01-29 12:03:33 +01:00
Enrico Candino
72b5a98dff Fix typos and adding spellcheck linter (#215)
* adding spellcheck linter

* fix typos
2025-01-28 17:47:45 +01:00
jpgouin
2019decc78 check value of cluster.Spec.Expose.Ingress 2025-01-28 14:34:50 +00:00
jpgouin
ebdeb3aa58 fix merge 2025-01-28 14:27:50 +00:00
jpgouin
c88890e502 Merge branch 'main' into fix-ingress 2025-01-28 15:11:09 +01:00
Enrico Candino
44045c5592 Added test (virtual cluster creation, with pod) and small kubeconfig refactor (#211)
* added virtual cluster and pod test

* moved ClusterCreate

* match patch k8s host version
2025-01-24 22:26:01 +01:00
jpgouin
e6db5a34c8 fix ingress creation, use the ingress host in Kubeconfig when enabled 2025-01-24 18:48:31 +00:00
Hussein Galal
931c7c5fcb Fix secret tokens and DNS translation (#200)
* Include init containers in token translation

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

* Fix kubernetes.defaul service DNS translation

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

* Add skip test var to dapper

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

* Add kubelet version and image pull policy to the shared agent

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>
2025-01-23 01:55:05 +02:00
Enrico Candino
fd6ed8184f removed antiaffinity (#199) 2025-01-22 18:34:30 +01:00
Enrico Candino
b0aa22b2f4 Simplify Cluster spec (#193)
* removed some required parameters, adding defaults

* add hostVersion in Status field

* fix tests
2025-01-21 21:19:44 +01:00
Enrico Candino
3f49593f96 Add Cluster creation test (#192)
* added k3kcli to path

* test create cluster

* updated ptr

* added cluster creation test
2025-01-21 17:53:42 +01:00
Hussein Galal
ccaa09fa4a Add PVC syncing support (#179)
* Add pvc syncing support

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>
2025-01-14 20:57:04 +02:00
Enrico Candino
f9ddec53b7 Added priorityClass to Clusters and ClusterSets (#180)
* added priorityClass to Clusters and ClusterSets

* fixed comment
2025-01-14 11:05:48 +01:00
Enrico Candino
7fdd48d577 Implementation of GetStatsSummary and GetMetricsResource for Virtual Kubelet (#163)
* implemented  GetStatsSummary and GetMetricsResource for Virtual Kubelet

* fixed ClusterRole for node proxy

* limit the clusterrole with get and list

* remove unused Metrics client interface
2024-12-27 11:41:40 +01:00
jpgouin
70a098df4c allow exec into pod and fetching log in shared mode (#160) 2024-12-17 11:41:17 +01:00
Hussein Galal
6739aa0382 Initial networking support for shared mode (#154)
* Initial networking support for shared mode

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

* Fix deletion logic and controller reference

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

* Fixes

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

* Fixes

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

* golintci

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2024-12-10 23:22:55 +02:00
Enrico Candino
72b2a5f1d1 Added podSecurityAdmissionLevel to ClusterSet (#145)
* added Namespace reconciliation for PodSecurity labels

* added Namespace Watch

* added tests, and example

* bump deps
2024-12-04 21:38:02 +01:00
Enrico Candino
6db5247ff7 fix netpol reconciliation (#150) 2024-11-28 01:44:37 +01:00
Enrico Candino
c561b033df Added allowedNodeTypes to ClusterSet, and fixed NetworkPolicy reconciliation (#144)
* updated CRDs

* added Mode to ClusterSet, and enum to CRD

* fix typos

* fix mode type in cli

* deletion of second clusterset in same namespace

* removed focused test, added clusterset example

* renamed modes

* added allowedNodeTypes, fixed samples

* fixed network policy reconciliation
2024-11-27 23:00:39 +02:00
Enrico Candino
37573d36a4 Added envtest integration tests for ClusterSet (#143)
* init tests

* added clusterset tests

* added github action

* updated Dapper with envtest bins
2024-11-11 18:13:20 +02:00
Hussein Galal
bc25c1c70a Serviceaccount token synchronization (#139)
* Serviceaccount token sync

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

* fixes

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

* fixing typo

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

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2024-11-08 00:11:56 +02:00