-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster API provider - initial skeleton for Bootstrap & ControlPlane providers #119
Conversation
@@ -137,7 +150,7 @@ func (kmc *Cluster) GetStatefulSetName() string { | |||
} | |||
|
|||
func (kmc *Cluster) GetAdminConfigSecretName() string { | |||
return fmt.Sprintf("kmc-admin-kubeconfig-%s", kmc.Name) | |||
return fmt.Sprintf("%s-kubeconfig", kmc.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to match the Cluster API conventions/contracts
@@ -65,6 +65,8 @@ type ClusterSpec struct { | |||
//+kubebuilder:validation:Enum:=kuberouter;calico;custom | |||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="cniPlugin is immutable" | |||
CNIPlugin string `json:"cniPlugin,omitempty"` | |||
// CertificateRefs defines the certificate references. | |||
CertificateRefs []CertificateRef `json:"certificateRefs,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows passing certs from secrets when using Cluster API
c9a073a
to
4929306
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple questions, obviously there are a lot of things to address but given the early stage I'm not making a full code review.
@@ -6,10 +6,13 @@ require ( | |||
github.com/k0sproject/k0s v1.27.2-0.20230504131248-94378e521a29 | |||
github.com/onsi/ginkgo/v2 v2.9.5 | |||
github.com/onsi/gomega v1.27.7 | |||
github.com/pkg/errors v0.9.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github.com/pkg/errors is legacy pkg/errors#245
apierrors.IsNotFound(errors.Cause(err))
should work as apierrors.IsNotFound(err)
.
errors.Wrap(..)
=> errors.Join(...)
errors.Cause(err) == x
=> errors.Is(err, x)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I took some inspiration for these from the upstream cluster api providers which seem to use these heavily still. And in the core of cluster api there's lot of usage of pkg/errors
. I wonder if the changes would be fully compatible 🤔
13dc71d
to
0905fed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general. Left some minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mostly fine, other than the install.yaml which needs to be regenerated the rest are just nits. Also we need github actions to detect this in the future.
config/crd/bases/bootstrap.cluster.x-k8s.io_kzerosworkerconfigs.yaml
Outdated
Show resolved
Hide resolved
@makhov @juanluisvaladas I fixed all the commented bits now. PTAL again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a side note, I noticed the new API is not defined in the PROJECT file. I imagine this happened because you added this manually without using the kubebuilder CLI. If this is the case we should either remove the PROJECT file or make sure it's consistent.
The PROJECT file isn't adding a lot of value and I noticed it's already inconsistent in the main branch (became inconssistent after renaming the Cluster type) so I'm in favour of removing it entirely.
Anyway this doesn't have to be done in this PR, I'm requesting changes for the hertzner sample, the rest isn't important enough to block. The other changes look good to me.
Signed-off-by: Jussi Nummelin <[email protected]> Very rough skeleton for control plane provider using k0smotron Signed-off-by: Jussi Nummelin <[email protected]> Use k8s 1.27 as dependency Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
…ller was missing node get/list permissions. Also remove stale hetzner example Signed-off-by: Jussi Nummelin <[email protected]>
Signed-off-by: Jussi Nummelin <[email protected]>
Very rough skeleton for control plane provider using k0smotron
This implements following features:
There's quite a few things to still "fix":
I've currently been testing with Hetzner provider only but other infra providers should work too as they all adhere to Cluster API contracts.