Skip to content

Commit c0a6152

Browse files
committed
feat: update Talos to 1.8.0-beta.0
Bump CAPI, Kubernetes versions. Due to the conflict with K8s 1.30.x CEL library version (very old), go straight to Kubernetes 1.31.0 and newer controller-runtime. Signed-off-by: Andrey Smirnov <[email protected]>
1 parent d466f5a commit c0a6152

17 files changed

+330
-419
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ COPY --from=manifests-build /src/config /config
4747

4848
FROM build AS generate-build
4949
RUN --mount=type=cache,target=/.cache controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
50-
RUN --mount=type=cache,target=/.cache conversion-gen --input-dirs=./api/v1alpha2 --output-base ./ --output-file-base=zz_generated.conversion --go-header-file=./hack/boilerplate.go.txt
50+
RUN --mount=type=cache,target=/.cache conversion-gen --output-file=zz_generated.conversion.go --go-header-file=./hack/boilerplate.go.txt -v 9 ./api/v1alpha2
5151

5252
FROM scratch AS generate
5353
COPY --from=generate-build /src/api /api

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ NAME := cluster-api-talos-controller
99
ARTIFACTS := _out
1010
TEST_RUN ?= ./...
1111

12-
TOOLS ?= ghcr.io/siderolabs/tools:v1.7.0-1-g10b2a69
13-
PKGS ?= v1.7.0-5-gb7f1920
14-
TALOS_VERSION ?= v1.7.0
15-
K8S_VERSION ?= 1.29.3
12+
TOOLS ?= ghcr.io/siderolabs/tools:v1.8.0-1-ga0c06c6
13+
PKGS ?= v1.8.0
14+
TALOS_VERSION ?= v1.8.0-beta.0
15+
K8S_VERSION ?= 1.30.0
1616

17-
CONTROLLER_GEN_VERSION ?= v0.14.0
18-
CONVERSION_GEN_VERSION ?= v0.29.3
17+
CONTROLLER_GEN_VERSION ?= v0.16.2
18+
CONVERSION_GEN_VERSION ?= v0.31.0
1919

2020
BUILD := docker buildx build
2121
PLATFORM ?= linux/amd64

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ This provider's versions are compatible with the following versions of Cluster A
5454

5555
This provider's versions are able to install and manage the following versions of Kubernetes:
5656
57-
| | v1.19 | v1.20 | v1.21 | v1.22 | v1.23 | v1.24 | v1.25 | v1.26 | v1.27 | v1.28 | v1.29 | v1.30 |
58-
| -------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
59-
| CABPT (v0.5.x) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | |
60-
| CABPT (v0.6.x) | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
57+
| | v1.19 | v1.20 | v1.21 | v1.22 | v1.23 | v1.24 | v1.25 | v1.26 | v1.27 | v1.28 | v1.29 | v1.30 | v1.31 |
58+
| -------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
59+
| CABPT (v0.5.x) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | |
60+
| CABPT (v0.6.x) | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
6161
6262
This provider's versions are compatible with the following versions of Talos:
6363

64-
| | v1.0 | v1.1 | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 |
65-
| ---------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
66-
| CABPT (v0.5.x) ||||| | | | |
67-
| CABPT (v0.6.x) | | |||||||
64+
| | v1.0 | v1.1 | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 |
65+
| ---------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
66+
| CABPT (v0.5.x) ||||| | | | | |
67+
| CABPT (v0.6.x) | | ||||||||
6868

6969
> Note: CABPT is not compatible with multi-document Talos Linux machine configuration, as it relies on JSON patch to apply configuration patches.
7070

api/v1alpha2/doc.go

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
// +k8s:conversion-gen=github.com/siderolabs/cluster-api-bootstrap-provider-talos/api/v1alpha3
6+
package v1alpha2

api/v1alpha2/types.go

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
package v1alpha2
66

7-
// +k8s:conversion-gen=github.com/siderolabs/cluster-api-bootstrap-provider-talos/api/v1alpha3
8-
97
// TalosConfigTemplateResource defines the Template structure
108
type TalosConfigTemplateResource struct {
119
Spec TalosConfigSpec `json:"spec,omitempty"`

api/v1alpha2/zz_generated.conversion.go

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/bootstrap.cluster.x-k8s.io_talosconfigs.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.16.2
77
name: talosconfigs.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io
@@ -125,7 +125,6 @@ spec:
125125
description: |-
126126
Source of the hostname.
127127
128-
129128
Allowed values: "MachineName" (use linked Machine's Name).
130129
type: string
131130
type: object
@@ -211,7 +210,6 @@ spec:
211210
description: |-
212211
Talos config will be a string containing the config for download.
213212
214-
215213
Deprecated: please use `<cluster>-talosconfig` secret.
216214
type: string
217215
type: object

config/crd/bases/bootstrap.cluster.x-k8s.io_talosconfigtemplates.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.16.2
77
name: talosconfigtemplates.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io
@@ -120,7 +120,6 @@ spec:
120120
description: |-
121121
Source of the hostname.
122122
123-
124123
Allowed values: "MachineName" (use linked Machine's Name).
125124
type: string
126125
type: object

config/manager/manager.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,13 @@ spec:
4848
requests:
4949
cpu: 100m
5050
memory: 128Mi
51+
securityContext:
52+
allowPrivilegeEscalation: false
53+
capabilities:
54+
drop:
55+
- ALL
56+
privileged: false
57+
runAsUser: 65532
58+
runAsGroup: 65532
59+
terminationMessagePolicy: FallbackToLogsOnError
5160
terminationGracePeriodSeconds: 10

controllers/secrets.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (r *TalosConfigReconciler) writeBootstrapData(ctx context.Context, scope *T
178178
return dataSecretName, nil
179179
}
180180

181-
if err != nil && !k8serrors.IsNotFound(err) {
181+
if !k8serrors.IsNotFound(err) {
182182
return dataSecretName, err
183183
}
184184

controllers/talosconfig_controller.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (r *TalosConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
172172
// Handle deleted talosconfigs
173173
// We no longer set finalizers on talosconfigs, but we have to remove previously set finalizers
174174
if !config.ObjectMeta.DeletionTimestamp.IsZero() {
175-
return r.reconcileDelete(ctx, config)
175+
return r.reconcileDelete(config)
176176
}
177177

178178
// Look up the resource that owns this talosconfig if there is one
@@ -254,7 +254,7 @@ func (r *TalosConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
254254
}
255255

256256
if err = r.reconcileGenerate(ctx, tcScope); err != nil {
257-
conditions.MarkFalse(config, bootstrapv1alpha3.DataSecretAvailableCondition, bootstrapv1alpha3.DataSecretGenerationFailedReason, capiv1.ConditionSeverityError, err.Error())
257+
conditions.MarkFalse(config, bootstrapv1alpha3.DataSecretAvailableCondition, bootstrapv1alpha3.DataSecretGenerationFailedReason, capiv1.ConditionSeverityError, "%s", err.Error())
258258

259259
return ctrl.Result{}, err
260260
}
@@ -380,7 +380,7 @@ func (r *TalosConfigReconciler) reconcileGenerate(ctx context.Context, tcScope *
380380
return nil
381381
}
382382

383-
func (r *TalosConfigReconciler) reconcileDelete(ctx context.Context, config *bootstrapv1alpha3.TalosConfig) (ctrl.Result, error) {
383+
func (r *TalosConfigReconciler) reconcileDelete(config *bootstrapv1alpha3.TalosConfig) (ctrl.Result, error) {
384384
controllerutil.RemoveFinalizer(config, bootstrapv1alpha3.ConfigFinalizer)
385385

386386
return ctrl.Result{}, nil
@@ -499,6 +499,11 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
499499

500500
genOptions = append(genOptions, generate.WithSecretsBundle(secretBundle))
501501

502+
// Talos dropped support for version contracts <= 0.14, but we still need to support old secret bundles
503+
if versionContract != nil && versionContract.Major < 1 && versionContract.Minor < 14 {
504+
genOptions = append(genOptions, generate.WithClusterDiscovery(false))
505+
}
506+
502507
APIEndpointPort := strconv.Itoa(int(scope.Cluster.Spec.ControlPlaneEndpoint.Port))
503508

504509
input, err := generate.NewInput(

0 commit comments

Comments
 (0)