Skip to content

Commit b66e8fe

Browse files
Add e2e test for RKE2 ClusterClass
Signed-off-by: Danil-Grigorev <[email protected]>
1 parent cf4c84b commit b66e8fe

19 files changed

+1370
-4
lines changed

azure/scope/cluster.go

-4
Original file line numberDiff line numberDiff line change
@@ -1031,13 +1031,10 @@ func (s *ClusterScope) SetControlPlaneSecurityRules() {
10311031
subnet := s.ControlPlaneSubnet()
10321032

10331033
if subnet.SecurityGroup.SecurityRules == nil {
1034-
subnet := s.ControlPlaneSubnet()
1035-
10361034
s.AzureCluster.Spec.NetworkSpec.UpdateControlPlaneSubnet(subnet)
10371035
}
10381036

10391037
if subnet.GetSecurityRuleByDestination("22") == nil {
1040-
subnet := s.ControlPlaneSubnet()
10411038
subnet.SecurityGroup.SecurityRules = append(s.ControlPlaneSubnet().SecurityGroup.SecurityRules,
10421039
infrav1.SecurityRule{
10431040
Name: "allow_ssh",
@@ -1057,7 +1054,6 @@ func (s *ClusterScope) SetControlPlaneSecurityRules() {
10571054

10581055
port := strconv.Itoa(int(s.APIServerPort()))
10591056
if subnet.GetSecurityRuleByDestination(port) == nil {
1060-
subnet := s.ControlPlaneSubnet()
10611057
subnet.SecurityGroup.SecurityRules = append(s.ControlPlaneSubnet().SecurityGroup.SecurityRules, infrav1.SecurityRule{
10621058
Name: "allow_apiserver",
10631059
Description: "Allow K8s API Server",

templates/cluster-template-clusterclass-rke2.yaml

+231
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2+
kind: AzureClusterTemplate
3+
metadata:
4+
name: ${CLUSTER_NAME}-azure-cluster
5+
spec:
6+
template:
7+
spec:
8+
identityRef:
9+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
10+
kind: AzureClusterIdentity
11+
name: ${CLUSTER_IDENTITY_NAME}
12+
networkSpec:
13+
additionalControlPlaneLBPorts:
14+
- name: rke2
15+
port: 9345
16+
subnets:
17+
- name: control-plane-subnet
18+
role: control-plane
19+
securityGroup:
20+
securityRules:
21+
- name: "allow_port_9345"
22+
description: "Allow port 9345 for RKE2"
23+
direction: "Inbound"
24+
priority: 2203
25+
protocol: "Tcp"
26+
destination: "*"
27+
destinationPorts: "9345"
28+
source: "*"
29+
sourcePorts: "*"
30+
action: "Allow"
31+
- name: node-subnet
32+
natGateway:
33+
name: node-natgateway
34+
role: node
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2+
kind: AzureMachineTemplate
3+
metadata:
4+
name: ${CLUSTER_NAME}-control-plane
5+
spec:
6+
template:
7+
spec:
8+
osDisk:
9+
diskSizeGB: 128
10+
osType: Linux
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2+
kind: AzureMachineTemplate
3+
metadata:
4+
name: ${CLUSTER_NAME}-worker
5+
spec:
6+
template:
7+
spec:
8+
osDisk:
9+
diskSizeGB: 30
10+
osType: Linux

0 commit comments

Comments
 (0)