Skip to content

Commit 469acd2

Browse files
committed
More progress.
1 parent 5fdc668 commit 469acd2

12 files changed

+280
-84
lines changed

api/v1alpha1/metalstackcluster_types.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,22 @@ import (
2323
capierrors "sigs.k8s.io/cluster-api/errors"
2424

2525
fcmv2 "github.com/metal-stack/firewall-controller-manager/api/v2"
26+
"github.com/metal-stack/metal-lib/pkg/tag"
2627
)
2728

2829
const (
2930
// ClusterFinalizer allows to clean up resources associated with before removing it from the apiserver.
3031
ClusterFinalizer = "metal-stack.infrastructure.cluster.x-k8s.io/cluster"
3132

32-
ClusterNodeNetworkEnsured clusterv1.ConditionType = "ClusterNodeNetworkEnsured"
33-
ClusterFirewallDeploymentReady clusterv1.ConditionType = "ClusterFirewallDeploymentReady"
33+
ClusterControlPlaneEndpointDefaultPort = 443
34+
35+
ClusterNodeNetworkEnsured clusterv1.ConditionType = "ClusterNodeNetworkEnsured"
36+
ClusterControlPlaneEndpointEnsured clusterv1.ConditionType = "ClusterControlPlaneEndpointEnsured"
37+
ClusterFirewallDeploymentReady clusterv1.ConditionType = "ClusterFirewallDeploymentReady"
38+
)
39+
40+
var (
41+
TagControlPlanePurpose = tag.New("metal-stack.infrastructure.cluster.x-k8s.io/purpose", "control-plane")
3442
)
3543

3644
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

api/v1alpha1/metalstackmachinetemplate_types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ type MetalStackMachineTemplateSpec struct {
2929
}
3030

3131
// +kubebuilder:object:root=true
32-
// +kubebuilder:resource:path=inframachinetemplates,scope=Namespaced,categories=cluster-api,shortName=imt
33-
// +kubebuilder:storageversion
3432

3533
// MetalStackMachineTemplate is the Schema for the inframachinetemplates API.
3634
type MetalStackMachineTemplate struct {

capi-lab/roles/cluster-api-provider-metal-stack/tasks/main.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@
99
labels:
1010
name: "{{ cluster_api_provider_metal_stack_namespace }}"
1111

12-
- name: Deploy capi-operator
13-
include_role:
14-
name: ansible-common/roles/helm-chart
15-
vars:
16-
helm_repo: "https://kubernetes-sigs.github.io/cluster-api-operator"
17-
helm_chart: cluster-api-operator
18-
helm_target_namespace: "{{ cluster_api_provider_metal_stack_namespace }}"
19-
helm_release_name: capi-operator
20-
helm_chart_version: "0.14.0"
21-
helm_value_file_template: "operator-values.yaml"
12+
# - name: Deploy capi-operator
13+
# include_role:
14+
# name: ansible-common/roles/helm-chart
15+
# vars:
16+
# helm_repo: "https://kubernetes-sigs.github.io/cluster-api-operator"
17+
# helm_chart: cluster-api-operator
18+
# helm_target_namespace: "{{ cluster_api_provider_metal_stack_namespace }}"
19+
# helm_release_name: capi-operator
20+
# helm_chart_version: "0.14.0"
21+
# helm_value_file_template: "operator-values.yaml"
2222

23-
- name: Deploy cap-provider-metal-stack backing resources
24-
k8s:
25-
definition: "{{ lookup('file', item) }}"
26-
namespace: "{{ cluster_api_provider_metal_stack_namespace }}"
27-
with_fileglob:
28-
- "{{ playbook_dir }}/../config/crd/bases/*.yaml"
29-
- "{{ playbook_dir }}/../config/rbac/*_role.yaml"
23+
# - name: Deploy cap-provider-metal-stack backing resources
24+
# k8s:
25+
# definition: "{{ lookup('file', item) }}"
26+
# namespace: "{{ cluster_api_provider_metal_stack_namespace }}"
27+
# with_fileglob:
28+
# - "{{ playbook_dir }}/../config/crd/bases/*.yaml"
29+
# - "{{ playbook_dir }}/../config/rbac/*_role.yaml"
3030

31-
- name: Deploy cap-provider-metal-stack
32-
k8s:
33-
definition: "{{ lookup('template', 'controller.yaml') }}"
34-
namespace: "{{ cluster_api_provider_metal_stack_namespace }}"
31+
# - name: Deploy cap-provider-metal-stack
32+
# k8s:
33+
# definition: "{{ lookup('template', 'controller.yaml') }}"
34+
# namespace: "{{ cluster_api_provider_metal_stack_namespace }}"

config/crd/bases/infrastructure.cluster.x-k8s.io_inframachinetemplates.yaml renamed to config/crd/bases/infrastructure.cluster.x-k8s.io_metalstackmachinetemplates.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.16.4
7-
name: inframachinetemplates.infrastructure.cluster.x-k8s.io
7+
name: metalstackmachinetemplates.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
1010
names:
11-
categories:
12-
- cluster-api
1311
kind: MetalStackMachineTemplate
1412
listKind: MetalStackMachineTemplateList
15-
plural: inframachinetemplates
16-
shortNames:
17-
- imt
13+
plural: metalstackmachinetemplates
1814
singular: metalstackmachinetemplate
1915
scope: Namespaced
2016
versions:

config/crd/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
resources:
55
- bases/infrastructure.cluster.x-k8s.io_metalstackclusters.yaml
66
- bases/infrastructure.cluster.x-k8s.io_metalstackmachines.yaml
7+
- bases/infrastructure.cluster.x-k8s.io_metalstackmachinetemplates.yaml
78
# +kubebuilder:scaffold:crdkustomizeresource
89

910
labels:

config/rbac/role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ rules:
88
- cluster.x-k8s.io
99
resources:
1010
- clusters
11+
- machines
1112
verbs:
1213
- get
1314
- list

config/samples/example.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ spec:
77
clusterNetwork:
88
pods:
99
cidrBlocks: ["192.168.0.0/16"]
10+
controlPlaneRef:
11+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
12+
kind: KubeadmControlPlane
13+
name: metal-test-controlplane
1014
infrastructureRef:
1115
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
1216
kind: MetalStackCluster
@@ -24,3 +28,27 @@ spec:
2428
image: firewall-ubuntu-3.0
2529
networks:
2630
- internet-mini-lab
31+
---
32+
kind: KubeadmControlPlane
33+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
34+
metadata:
35+
name: metal-test-controlplane
36+
spec:
37+
machineTemplate:
38+
nodeDrainTimeout: 10m
39+
infrastructureRef:
40+
kind: MetalStackMachineTemplate
41+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
42+
name: metal-test-controlplane
43+
replicas: 1
44+
version: v1.30.6
45+
---
46+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
47+
kind: MetalStackMachineTemplate
48+
metadata:
49+
name: metal-test-controlplane
50+
spec:
51+
template:
52+
spec:
53+
image: ubuntu-24.04
54+
size: v1-small-x86

config/samples/infrastructure_v1alpha1_metalstackcluster.yaml

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

config/samples/infrastructure_v1alpha1_metalstackmachine.yaml

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

config/samples/kustomization.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Append samples of your project ##
2+
namespace: default
3+
24
resources:
3-
- infrastructure_v1alpha1_metalstackcluster.yaml
4-
- infrastructure_v1alpha1_metalstackmachine.yaml
5+
- example.yaml
56
# +kubebuilder:scaffold:manifestskustomizesamples

0 commit comments

Comments
 (0)