Skip to content

Commit 48d834b

Browse files
lion7Unix4ever
authored andcommitted
feat: support CAPI v1alpha4
This PR will add all of the changes necessary for supporting CAPI v1alpha4 resources. Signed-off-by: Gerard de Leeuw <[email protected]> Signed-off-by: Artem Chernyshev <[email protected]>
1 parent 14c6e72 commit 48d834b

22 files changed

+692
-404
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ARG TAG
5959
RUN cd config/manager \
6060
&& kustomize edit set image controller=${REGISTRY_AND_USERNAME}/${NAME}:${TAG} \
6161
&& cd - \
62-
&& kustomize build config >/control-plane-components.yaml \
62+
&& kustomize build config/default >/control-plane-components.yaml \
6363
&& cp config/metadata/metadata.yaml /metadata.yaml
6464

6565
FROM scratch AS release

config/crd/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# This kustomization.yaml is not intended to be run by itself,
2+
# since it depends on service name and namespace that are out of this kustomize package.
3+
# It should be run by config/default
14
commonLabels:
25
cluster.x-k8s.io/v1alpha3: v1alpha3
6+
cluster.x-k8s.io/v1alpha4: v1alpha3
7+
38
# This kustomization.yaml is not intended to be run by itself,
49
# since it depends on service name and namespace that are out of this kustomize package.
510
# It should be run by config/default

config/default/kustomization.yaml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,52 @@
11
namespace: cacppt-system
22

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

612
bases:
7-
- ../rbac
8-
- ../manager
13+
- ../crd
14+
- ../certmanager
15+
- ../webhook
16+
- ../rbac
17+
- ../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
File renamed without changes.

config/kustomization.yaml

Lines changed: 0 additions & 17 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
image: controller:latest
2525
imagePullPolicy: Always

config/metadata/metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ releaseSeries:
77
- major: 0
88
minor: 2
99
contract: v1alpha3
10+
- major: 0
11+
minor: 3
12+
contract: v1alpha4

config/patch_crd_webhook_namespace.yaml

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

0 commit comments

Comments
 (0)