Skip to content

Commit c0f6b9d

Browse files
committed
Add clusterclass template for Tilt
1 parent 433c7d7 commit c0f6b9d

22 files changed

+756
-319
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ kind-create: $(KUBECTL) ## Create capz kind cluster if needed.
706706

707707
.PHONY: tilt-up
708708
tilt-up: install-tools kind-create ## Start tilt and build kind cluster if needed.
709-
EXP_CLUSTER_RESOURCE_SET=true EXP_MACHINE_POOL=true EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION=true tilt up
709+
CLUSTER_TOPOLOGY=true EXP_CLUSTER_RESOURCE_SET=true EXP_MACHINE_POOL=true EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION=true tilt up
710710

711711
.PHONY: delete-cluster
712712
delete-cluster: delete-workload-cluster ## Deletes the example kind cluster "capz".

Tiltfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def deploy_worker_templates(template, substitutions):
339339
"WORKER_MACHINE_COUNT": "2",
340340
"AZURE_NODE_MACHINE_TYPE": "Standard_B2s",
341341
"FLATCAR_VERSION": settings.get("flatcar_version"),
342+
"CLUSTER_CLASS_NAME": "default",
342343
}
343344

344345
if flavor == "aks":

templates/cluster-template-clusterclass.yaml

Lines changed: 281 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2+
kind: AzureClusterTemplate
3+
metadata:
4+
name: ${CLUSTER_NAME}-azure-cluster
5+
namespace: default
6+
spec:
7+
template:
8+
spec:
9+
subscriptionID: ${AZURE_SUBSCRIPTION_ID}
10+
identityRef:
11+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
12+
kind: AzureClusterIdentity
13+
name: ${CLUSTER_IDENTITY_NAME}
14+
location: ${AZURE_LOCATION}
15+
networkSpec:
16+
subnets:
17+
- name: control-plane-subnet
18+
role: control-plane
19+
- name: node-subnet
20+
natGateway:
21+
name: node-natgateway
22+
role: node
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2+
kind: AzureMachineTemplate
3+
metadata:
4+
name: ${CLUSTER_NAME}-control-plane
5+
namespace: default
6+
spec:
7+
template:
8+
spec:
9+
dataDisks:
10+
- diskSizeGB: 256
11+
lun: 0
12+
nameSuffix: etcddisk
13+
osDisk:
14+
diskSizeGB: 128
15+
osType: Linux
16+
sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
17+
vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2+
kind: AzureMachineTemplate
3+
metadata:
4+
name: ${CLUSTER_NAME}-md-0
5+
namespace: default
6+
spec:
7+
template:
8+
spec:
9+
osDisk:
10+
diskSizeGB: 128
11+
osType: Linux
12+
sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
13+
vmSize: ${AZURE_NODE_MACHINE_TYPE}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: cluster.x-k8s.io/v1beta1
2+
kind: Cluster
3+
metadata:
4+
labels:
5+
containerd-logger: enabled
6+
csi-proxy: enabled
7+
name: ${CLUSTER_NAME}
8+
namespace: default
9+
spec:
10+
clusterNetwork:
11+
pods:
12+
cidrBlocks:
13+
- 192.168.0.0/16
14+
topology:
15+
class: ${CLUSTER_CLASS_NAME}
16+
version: ${KUBERNETES_VERSION}
17+
controlPlane:
18+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
19+
workers:
20+
machineDeployments:
21+
- class: ${CLUSTER_NAME}-worker
22+
name: md-0
23+
replicas: ${WORKER_MACHINE_COUNT}

0 commit comments

Comments
 (0)