Commit Graph

165 Commits

Author SHA1 Message Date
Danil Grigorev 6fc88d9288
Fix linter errors
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-04-08 21:35:56 +02:00
Danil Grigorev 287254ad85
Add tests for etcd management
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-04-08 21:35:56 +02:00
Danil Grigorev 759d835f62
Fetch external certificate from child cluster
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-04-08 21:35:55 +02:00
Danil Grigorev f5d65f1eb9
Add etcd membeship change logic for etcd scale down scenarios
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-04-08 21:35:53 +02:00
Furkat Gofurov 0402c6eeea
Fix lint issues in the codebase
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
2024-03-19 17:24:46 +02:00
Furkat Gofurov 400e4d9f8b
Improve patch helper error handling
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
2024-03-19 14:54:30 +02:00
Furkat Gofurov 26c7cab5af
Required changes after CAPI bump
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
2024-03-19 12:46:08 +02:00
Richard Case 0f98d5f775
feat: added control plane endpoint registration method
This adds a new registration method that will use the **host** from the
control plane endpoint set on the **Cluster**.

Signed-off-by: Richard Case <richard.case@suse.com>
2024-03-18 11:41:34 +00:00
Richard Case ae0ecc3e71
Merge pull request #261 from salasberryfin/v1beta1-feat-add-support-for-clusterclass
 feat: add support for cluster class
2024-02-27 09:19:46 +00:00
Carlos Salas 0b62188aaa
feat: add support for cluster class
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
2024-02-23 18:12:52 +01:00
Danil Grigorev a4202a2699
Add tests for nodeRef lookup in annotation propagation logic
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-02-19 11:16:21 +01:00
ekarlso b4cb04bead feat: Fix handling of registries config to work as rke2
fixes ##253

Signed-off-by: ekarlso <endre.karlson@gmail.com>
2024-01-26 15:24:31 +01:00
Danil Grigorev 7a4225eace
Add List conversion and update copyright
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-01-09 11:34:36 +01:00
Danil Grigorev dc7c307123
Rename v1alpha2 to v1beta1
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-01-08 13:18:49 +01:00
Danil Grigorev 911a3f10bb
Introduce fuzzy tests for conversion
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-01-08 13:03:27 +01:00
Danil Grigorev c8762be772
Introduce v1alpha2 api version
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2024-01-08 13:03:26 +01:00
Richard Case f76dff43f3
chore: update to capi v1.6.0
This bumps CAPI to v1.6.0 along with associated depenendies. The
sample templates have also been updated for docker so they are
compatible with v1.6.0, specifically using a custom LB config.

Signed-off-by: Richard Case <richard.case@outlook.com>
2023-12-07 14:32:40 +00:00
Richard Case 37320aebff
chore: comment changes from review
Signed-off-by: Richard Case <richard.case@outlook.com>
2023-11-16 21:06:45 +01:00
Richard Case b2904bd585
fix: change to ensure maxsurge=0 and 1 after testing
Signed-off-by: Richard Case <richard.case@outlook.com>
2023-11-16 17:31:37 +01:00
Alexandr Demicev aff415beaa
Add maxsurge option for control plane upgrade
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2023-11-16 13:25:48 +01:00
Danil Grigorev 8af997563f
Merge pull request #190 from Danil-Grigorev/arbitrary-cloud-init
Add arbitrary data field
2023-11-16 10:20:51 +01:00
Danil Grigorev 91b733692f
Add arbitrary data field
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2023-11-15 11:59:02 +01:00
Danil Grigorev 22903011b2
Fix nil machine occurence during upgrade
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2023-11-02 18:40:44 +01:00
Danil Grigorev df0d88e916
Update files with lint fixes
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2023-10-30 16:49:54 +01:00
Danil Grigorev 71354c2218
Add test cases covering metadata propagation
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2023-10-30 16:49:54 +01:00
Danil Grigorev db08f5556f
Implement metadata propagation on the workload cluster nodes
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
2023-10-30 16:49:53 +01:00
Alexandr Demicev 85372d9be5
Fix breaking changes after updating dependecies
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2023-10-11 12:16:58 +02:00
Richard Case 6e2efbee2d
fix: incorrectly defaulting advertise address
With the recent change to introduce new registration methods we started
to default the `advertiseAddress` to the "registration address" if the
registration method of `address` was used. This caused the kube-api
server to be startedw tith that address. If you then used a VIP/LB
solution like kube-vip or metalb that runs within cluster it caused
pods to not start start as there is a chicken and egg scenario.

This change removes that defaulting and also adds a sample that uses
kube-vip.

Signed-off-by: Richard Case <richard.case@outlook.com>
2023-06-30 15:40:23 +01:00
Richard Case 6c07719274
feat: support different registration methods
This adds support for different ways to register new nodes into the
cluster.

Signed-off-by: Richard Case <richard.case@outlook.com>
2023-06-15 15:33:45 +01:00
Luis Rascao 4fe5e53aa5
fixup! chore(deps): Bump github.com/onsi/ginkgo/v2 from 2.9.1 to 2.9.4
Signed-off-by: Luis Rascao <luis.rascao@gmail.com>
2023-05-22 11:44:46 +01:00
Luis Rascão 1d27bb4c2c
Improve e2e tests (#133)
* e2e: add low number of file descriptors helper tip

Signed-off-by: Luis Rascao <luis.rascao@gmail.com>

* controplane: don't fail status update when no machines available/ready

Failing prevents requeing leading to high bootstrap times of the
controlplane, in most cases the machine is ready and with IP addresses
but the controller is waiting for a full sync.

Signed-off-by: Luis Rascao <luis.rascao@gmail.com>

---------

Signed-off-by: Luis Rascao <luis.rascao@gmail.com>
2023-05-16 15:34:17 +02:00
Mohamed Belgaied Hassine 90e5619a1f
Implemented possibility to use Multus CNI, fixes #103 (#132)
improved some logging

fixed small issue related to the change in the way CNI field is handled

Fixing comments for validate func in webhook

Cleaning up multus RKE2-on-CAPD manifests

updated godoc comment on API field for rke2controlplane

Removed unnecessary comment in external AWS templates

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-05-16 15:32:54 +02:00
Mohamed Belgaied Hassine 6808c7580b
Fixing issue with disableComponents fields in RKE2ControlPlane, fixes #128 (#130)
Fix linting

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-05-09 12:15:48 +02:00
Alexander Demicev 21892040ed
Validate/default control plane object with webhooks (#123)
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2023-03-28 22:43:30 +02:00
Alexandr Demicev 67d46fedee
Regenerate manifests
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2023-03-27 17:42:12 +02:00
Richard Case 926bea3ce2
feat: initial e2e tests
This adds initial e2e tests for the RKE2 providers. There are still lots
more e2e tests that need to be added.

Signed-off-by: Richard Case <richard.case@outlook.com>
2023-03-27 15:09:15 +01:00
Mohamed Belgaied Hassine e4d636bf64
implemented additionUserData configuration in the API (#114)
* implemented additionUserData configuration in the API

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

* implemented review feedback

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

---------

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-03-24 11:23:09 +01:00
Mohamed Belgaied Hassine 5d9837a73b
Fixed a mistake in the description of ExtraArgs field
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-03-21 20:52:04 +00:00
Mohamed Belgaied Hassine a0858f8ea2
Fixed #28 CIS Profile now works and is different for v1.25+ and v1.24- (#110)
Fixes #28 and makes it possible to differenciate CIS profiles between versions
Removed snake case in util.go
Fixed Units tests for the CIS scenario

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-03-14 14:27:46 +01:00
Mohamed Belgaied Hassine fc445b63b8
fixed linting issues (first pass)
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

make generate afte minor fixes to API descriptions

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

fixed some regressions from refactoring

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

changed timeout value for golanci-lint GH action, because it was failing

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-03-10 12:58:16 +00:00
Mohamed Belgaied Hassine 09add13e83
moved cloud-init package to bootstrap/internal and did some cleanup
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Revert "code cleanup, removing unnecessary takeovers. removing some references to Kubeadm provider code"

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

change verbosity level

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

updated matching RKE2Config of the machine with new ControlPlane

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

implemented registries.yaml files for workers, cp might be problematic in this impl

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Fixing issues around registries.yaml for control plane nodes

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

implemented manifests feature, still to be tested!

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

small fixes and adding AWS sample

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

small fixes and adding AWS sample

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

testing aws -- not working providerID

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

testing aws -- not working providerID

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Fixing some AWS testing using templates

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Fixed several issues when deploying with AWS external cloud provider

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

implemented NTP configuration

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

implemented review comments

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Fixed typo on registry rewrites and endpoints

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-02-15 17:11:44 +00:00
Mohamed Belgaied Hassine e2c134c69b
Fixes for PR #60
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-17 18:52:14 +00:00
Mohamed Belgaied f17429b76e
Fixed some small issues in the generation of config.yaml
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-11 15:52:19 +00:00
Mohamed Belgaied 0cb534163a
implemented air gapped installation with API Airgapped option
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-11 15:52:09 +00:00
Mohamed Belgaied b575a7c0b3
Working multi-controlplane and multi-worker
Signed-off-by: Mohamed Belgaied <belgaied2@hotmail.com>
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-11 15:50:40 +00:00
Mohamed Belgaied Hassine 9c3e70f61e
working 1 node deployment
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-11 15:50:40 +00:00
Mohamed Belgaied Hassine 0141473d6b
Fixing 1 node initialization
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-11 15:50:39 +00:00
Mohamed Belgaied Hassine 9a1a2cc718
prepare for rebase on main
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-11 15:50:38 +00:00
Mohamed Belgaied Hassine 1cfab9f30a
code cleanup, removing unnecessary takeovers. removing some references to Kubeadm provider code
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2023-01-11 15:50:31 +00:00
Alexandr Demicev ebf5730295
Use CAPI machine collections library
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2022-12-27 11:44:38 +01:00
Alexander Demicev d3056ea326
Merge pull request #51 from alexander-demicev/config
Generate config for agent and server
2022-12-20 14:14:42 +01:00
Alexandr Demicev fa4235450b
Minor API improvements
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2022-12-05 16:32:48 +01:00
Alexandr Demicev a3c13b9c94
Fix license year and add where its missing
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2022-11-24 16:52:38 +01:00
Mohamed Belgaied Hassine 85232c3a0e
fixing review feedback and removing references to kubeadm and coredns
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2022-11-24 14:38:32 +00:00
Mohamed Belgaied Hassine 0815036d17
Draft Implementation of controlplane provider
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2022-11-23 20:34:08 +00:00
Mohamed Belgaied Hassine ae3fbbceba
removed wrong comment
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2022-11-23 20:27:34 +00:00
Mohamed Belgaied Hassine a3e3206a73
fixed issue causing tilt to throw an envsubst error, removed comment with variable format
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2022-11-23 20:27:34 +00:00
Mohamed Belgaied Hassine 8ce4898c4f
fixed an issue with malformed JSON name of field ServiceNodePortRange
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2022-11-23 20:27:34 +00:00
Alexandr Demicev 3d4ffa44b5
Improve main.go after scaffolding
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2022-11-14 17:29:19 +01:00
Mohamed Belgaied Hassine 57c6795ecf
Refining the Control Plane API
Moved RKE2ServerConfig relevant parts to Control Plane API

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

standardized comment spacing to a single space

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Added ManifestsConfigMapReference to the control plane for the possibility to automatically deploy manifests

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Added NTP Field to the common node configuration

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Adding Status fields in the Control API and clarifying bootstrap import

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Adding fields from RKE2ConfigSpec to RKE2ControlPlaneSpec and removing RKE2CommonNodeConf struct

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

fixed LoadBalancerPort json name

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Removed fields for requests and limits of the control plane components from the API

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Removed some unnecessary comments generated by kubebuilder

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2022-11-14 14:22:24 +00:00
Mohamed Belgaied Hassine 915cc0b839
Refining the Bootstrap API
First commit - drafting data struct docs

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Added UML file for documenting structs

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Adding first version of RKE2Config structs

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Updating go modules because of changes in imports

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

did a go mod tidy

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

re-generated CRDs using make generate

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

fixed refactoring issue in webhook configuration

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Dot at the end of comment line

Co-authored-by: Alexander Demicev <alexandr.demicev@suse.com>
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Dot at the end of comment line

Co-authored-by: Alexander Demicev <alexandr.demicev@suse.com>
Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Adding dots in comment end of lines when necessary

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Small improvements in comment formatting

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Removed DeployRKE2Commands attribute because of duplicate usage

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Replaced SecretRef and ConfigMapRef types by the generic v1.ObjectReference type

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

fixed additional issue with webhook refactoring

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

simplified EtcdBackupConfig struct field names

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

removed Snapshotter attribute from RKE2Agent/ServerConfig

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

changed ResolvConf attribute to reference a ConfigMap instead of a string with a path

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

changed EtcdMetricsExposed to EtcdMetricsExposurePolicy to replace bool with enum

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

replaced bool fields with enums as recommended by KubeAPI best practices

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Capitalize acronym in KubeAPIServer

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Co-authored-by: Alexander Demicev <alexandr.demicev@suse.com>

Fixed small issues related to capitalization of KubeAPIServer attribute

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

fixed issue of Kubebuilder enum validation + moved validation tags to structs fields instead of types

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Changed LbServerPort to LoadBalancerPort with type int

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

capitalized some acronym attributes

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Removed some unnecessary structs and annotations from Registry struct, will use another struct for marshalling yaml

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Modify TLSConfig for registries to reference a single tls secret instead of three secrets

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

removed duplicate attributes between agent and server, and put them their own common struct

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

removed BootstrapData field in RKE2ConfigStatus struct

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Small comment changes

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

moved multiple disableXXX attributes to single DisableComponents struct

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

refactoring back to bool and adding constants

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>

Changed all Rke2Xxx structs to RKE2Xxx

Signed-off-by: Mohamed Belgaied Hassine <belgaied2@hotmail.com>
2022-11-14 14:21:54 +00:00
Alexandr Demicev 303493bcc2
Fix CRD paths in envtest setup
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2022-11-03 11:38:30 +01:00
Richard Case 8469f799e5
chore: readme and tailt changes
Some changes after testing with tilt. The tilt setup is dependent on a
bug being fixed upstream in capi. Added some initial instructions to the
README to get started.

Signed-off-by: Richard Case <richard.case@outlook.com>
2022-11-03 07:59:02 +00:00
Alexandr Demicev e697e283f9
Standardise API imports
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
2022-11-02 15:53:10 +01:00
Richard Case e5e027de73
chore: scaffolding of the provider
This is the initial scaffolding for the RKE2 provider. It includes a
bootstrap and control plane provider,

Signed-off-by: Richard Case <richard.case@outlook.com>
2022-11-02 10:07:26 +00:00