Skip to content
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

fix: Use ControlPlaneJoinConfig certificates during Control Plane Join #1029

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/src/_parts/control_plane_join_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ If omitted defaults to an auto generated certificate.
The client key to be used for the front proxy.
If omitted defaults to an auto generated key.

### admin-client-crt
**Type:** `string`<br>

The admin client certificate to be used for Kubernetes services.
If omitted defaults to an auto generated certificate.

### admin-client-key
**Type:** `string`<br>

The admin client key to be used for Kubernetes services.
If omitted defaults to an auto generated key.

### kube-proxy-client-crt
**Type:** `string`<br>

Expand Down
2 changes: 1 addition & 1 deletion src/k8s/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.23.4
require (
dario.cat/mergo v1.0.0
github.com/canonical/go-dqlite/v2 v2.0.0
github.com/canonical/k8s-snap-api v1.0.16
github.com/canonical/k8s-snap-api v1.0.17-0.20250131162740-516354cc6588
github.com/canonical/lxd v0.0.0-20250113143058-52441d41dab7
github.com/canonical/microcluster/v2 v2.1.1-0.20250127104725-631889214b18
github.com/go-logr/logr v1.4.2
Expand Down
4 changes: 2 additions & 2 deletions src/k8s/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXe
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/canonical/go-dqlite/v2 v2.0.0 h1:RNFcFVhHMh70muKKErbW35rSzqmAFswheHdAgxW0Ddw=
github.com/canonical/go-dqlite/v2 v2.0.0/go.mod h1:IaIC8u4Z1UmPjuAqPzA2r83YMaMHRLoKZdHKI5uHCJI=
github.com/canonical/k8s-snap-api v1.0.16 h1:j1VPvWimgRt3P5uRtD2ZCPGalSFvU5AJ/Jbz60QMoBs=
github.com/canonical/k8s-snap-api v1.0.16/go.mod h1:LDPoIYCeYnfgOFrwVPJ/4edGU264w7BB7g0GsVi36AY=
github.com/canonical/k8s-snap-api v1.0.17-0.20250131162740-516354cc6588 h1:MiO0ouXB+p/hLU84CV0WqT4m8IbAIJViDjfwwU/OGNI=
github.com/canonical/k8s-snap-api v1.0.17-0.20250131162740-516354cc6588/go.mod h1:LDPoIYCeYnfgOFrwVPJ/4edGU264w7BB7g0GsVi36AY=
github.com/canonical/lxd v0.0.0-20250113143058-52441d41dab7 h1:lZCOt9/1KowNdnWXjfA1/51Uj7+R0fKtByos9EVrYn4=
github.com/canonical/lxd v0.0.0-20250113143058-52441d41dab7/go.mod h1:4Ssm3YxIz8wyazciTLDR9V0aR2GPlGIHb+S0182T5pA=
github.com/canonical/microcluster/v2 v2.1.1-0.20250127104725-631889214b18 h1:h5VJaUnE4gAKPolBTJ11HMRTEN5JyA+oR4gHkoK//6o=
Expand Down
10 changes: 10 additions & 0 deletions src/k8s/pkg/k8sd/app/hooks_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ func (a *App) onPostJoin(ctx context.Context, s state.State, initConfig map[stri
certificates.FrontProxyClientKey = joinConfig.GetFrontProxyClientKey()
certificates.KubeletCert = joinConfig.GetKubeletCert()
certificates.KubeletKey = joinConfig.GetKubeletKey()
certificates.AdminClientCert = joinConfig.GetAdminClientCert()
certificates.AdminClientKey = joinConfig.GetAdminClientKey()
certificates.KubeControllerManagerClientCert = joinConfig.GetKubeControllerManagerClientCert()
certificates.KubeControllerManagerClientKey = joinConfig.GetKubeControllerManagerClientKey()
certificates.KubeSchedulerClientCert = joinConfig.GetKubeSchedulerClientCert()
certificates.KubeSchedulerClientKey = joinConfig.GetKubeSchedulerClientKey()
certificates.KubeProxyClientCert = joinConfig.GetKubeProxyClientCert()
certificates.KubeProxyClientKey = joinConfig.GetKubeProxyClientKey()
certificates.KubeletClientCert = joinConfig.GetKubeletClientCert()
certificates.KubeletClientKey = joinConfig.GetKubeletClientKey()

// generate missing certificates
if err := certificates.CompleteCertificates(); err != nil {
Expand Down
Loading