Skip to content

Commit 7b760cf

Browse files
rsmittysmira
andcommitted
feat: support CAPI v1alpha4
This PR will add all of the changes necessary for supporting CAPI v1alpha4 resources. Signed-off-by: Spencer Smith <[email protected]> Co-authored-by: Andrey Smirnov <[email protected]> Signed-off-by: Andrey Smirnov <[email protected]>
1 parent 3147ba4 commit 7b760cf

27 files changed

+732
-390
lines changed

.drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ steps:
132132
- sha512
133133
draft: true
134134
files:
135-
- _out/*
135+
- _out/bootstrap-talos/*/*
136136
note: _out/RELEASE_NOTES.md
137137
when:
138138
event:
@@ -176,6 +176,6 @@ depends_on:
176176

177177
---
178178
kind: signature
179-
hmac: 523acbd6b6e92b11249b0515fe28ef34dc1c3c926826e84ce9a1de3412a6a65e
179+
hmac: a7d3d09b2ec221337f14cde8f5f2a872a4c3500df09b7f27e6a169a4eb35944b
180180

181181
...

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ ARG TAG
7171
RUN cd config/manager \
7272
&& kustomize edit set image controller=${REGISTRY_AND_USERNAME}/${NAME}:${TAG} \
7373
&& cd - \
74-
&& kustomize build config > /bootstrap-components.yaml \
74+
&& kustomize build config/default > /bootstrap-components.yaml \
7575
&& cp config/metadata/metadata.yaml /metadata.yaml
7676

7777
FROM scratch AS release
78-
COPY --from=release-build /bootstrap-components.yaml /bootstrap-components.yaml
79-
COPY --from=release-build /metadata.yaml /metadata.yaml
78+
ARG TAG
79+
COPY --from=release-build /bootstrap-components.yaml /bootstrap-talos/${TAG}/bootstrap-components.yaml
80+
COPY --from=release-build /metadata.yaml /bootstrap-talos/${TAG}/metadata.yaml
8081

8182
FROM build AS binary
8283
ARG TARGETARCH

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ PKGS ?= v0.8.0-alpha.0-3-gdb90f93
1313
TALOS_VERSION ?= v0.12.1
1414
K8S_VERSION ?= 1.21.4
1515

16-
CONTROLLER_GEN_VERSION ?= v0.5.0
17-
CONVERSION_GEN_VERSION ?= v0.21.0
16+
CONTROLLER_GEN_VERSION ?= v0.6.2
17+
CONVERSION_GEN_VERSION ?= v0.21.3
1818

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

config/crd/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# It should be run by config/default
44
commonLabels:
55
cluster.x-k8s.io/v1alpha3: v1alpha3
6+
cluster.x-k8s.io/v1alpha4: v1alpha3
67

78
resources:
89
- bases/bootstrap.cluster.x-k8s.io_talosconfigs.yaml

config/default/kustomization.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,52 @@
11
namespace: cabpt-system
22

3+
namePrefix: cabpt-
4+
5+
# Labels to add to all resources and selectors.
6+
commonLabels:
7+
cluster.x-k8s.io/provider: "bootstrap-talos"
8+
39
resources:
410
- namespace.yaml
511

612
bases:
13+
- ../crd
14+
- ../certmanager
15+
- ../webhook
716
- ../rbac
817
- ../manager
18+
19+
patchesStrategicMerge:
20+
- manager_webhook_patch.yaml
21+
- webhookcainjection_patch.yaml
22+
23+
vars:
24+
- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
25+
objref:
26+
kind: Certificate
27+
group: cert-manager.io
28+
version: v1alpha2
29+
name: serving-cert # this name should match the one in certificate.yaml
30+
fieldref:
31+
fieldpath: metadata.namespace
32+
- name: CERTIFICATE_NAME
33+
objref:
34+
kind: Certificate
35+
group: cert-manager.io
36+
version: v1alpha2
37+
name: serving-cert # this name should match the one in certificate.yaml
38+
- name: SERVICE_NAMESPACE # namespace of the service
39+
objref:
40+
kind: Service
41+
version: v1
42+
name: webhook-service
43+
fieldref:
44+
fieldpath: metadata.namespace
45+
- name: SERVICE_NAME
46+
objref:
47+
kind: Service
48+
version: v1
49+
name: webhook-service
50+
51+
configurations:
52+
- kustomizeconfig.yaml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This configuration is for teaching kustomize how to update name ref and var substitution
2+
varReference:
3+
- kind: Deployment
4+
path: spec/template/spec/volumes/secret/secretName

config/webhook/manager_webhook_patch.yaml renamed to config/default/manager_webhook_patch.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ spec:
88
spec:
99
containers:
1010
- name: manager
11-
args:
12-
- "--metrics-addr=127.0.0.1:8080"
13-
- "--webhook-port=9443"
1411
ports:
1512
- containerPort: 9443
1613
name: webhook-server
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
apiVersion: admissionregistration.k8s.io/v1
3+
kind: ValidatingWebhookConfiguration
4+
metadata:
5+
name: validating-webhook-configuration
6+
annotations:
7+
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)

config/kustomization.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
- command:
2020
- /manager
2121
args:
22-
- --metrics-addr=127.0.0.1:8080
22+
- --metrics-bind-addr=127.0.0.1:8080
2323
- --enable-leader-election
2424
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false}"
2525
image: controller:latest

0 commit comments

Comments
 (0)