Skip to content

Commit

Permalink
Add templates for clusterclass machinepool
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Oct 24, 2023
1 parent e6610eb commit b80750f
Show file tree
Hide file tree
Showing 25 changed files with 837 additions and 26 deletions.
155 changes: 155 additions & 0 deletions templates/cluster-template-aks-clusterclass.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions templates/cluster-template-aks-topology.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions templates/cluster-template-clusterclass.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions templates/cluster-template-topology.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedClusterTemplate
metadata:
name: ${CLUSTER_NAME}
namespace: default
spec:
template:
spec: {}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedControlPlaneTemplate
metadata:
name: ${CLUSTER_NAME}-control-plane
namespace: default
spec:
template:
spec:
identityRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureClusterIdentity
name: ${CLUSTER_IDENTITY_NAME}
location: ${AZURE_LOCATION}
subscriptionID: ${AZURE_SUBSCRIPTION_ID}
version: ${KUBERNETES_VERSION}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedMachinePoolTemplate
metadata:
name: ${CLUSTER_NAME}-pool0
namespace: default
spec:
template:
spec:
mode: System
name: pool0
sku: ${AZURE_NODE_MACHINE_TYPE}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedMachinePoolTemplate
metadata:
name: ${CLUSTER_NAME}-pool1
namespace: default
spec:
template:
spec:
mode: User
name: pool1
sku: ${AZURE_NODE_MACHINE_TYPE}
43 changes: 43 additions & 0 deletions templates/flavors/aks-clusterclass/clusterclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: ClusterClass
metadata:
name: ${CLUSTER_CLASS_NAME}
namespace: default
spec:
controlPlane:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedControlPlaneTemplate
name: ${CLUSTER_NAME}-control-plane
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedClusterTemplate
name: ${CLUSTER_NAME}
workers:
machinePools:
- class: default-system
template:
bootstrap:
ref:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: ${CLUSTER_NAME}-pool0
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedMachinePoolTemplate
name: ${CLUSTER_NAME}-pool0
- class: default-worker
template:
bootstrap:
ref:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: ${CLUSTER_NAME}-pool1
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedMachinePoolTemplate
name: ${CLUSTER_NAME}-pool1

47 changes: 47 additions & 0 deletions templates/flavors/aks-clusterclass/kubeadm-config-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: ${CLUSTER_NAME}-pool0
namespace: default
spec:
template:
spec:
files:
- contentFrom:
secret:
key: worker-node-azure.json
name: replace_me
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-provider: external
name: '{{ ds.meta_data["local_hostname"] }}'
preKubeadmCommands: []
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: ${CLUSTER_NAME}-pool1
namespace: default
spec:
template:
spec:
files:
- contentFrom:
secret:
key: worker-node-azure.json
name: replace_me
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-provider: external
name: '{{ ds.meta_data["local_hostname"] }}'
preKubeadmCommands: []
10 changes: 10 additions & 0 deletions templates/flavors/aks-clusterclass/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
resources:
- clusterclass.yaml
- azure-managed-controlplane-template.yaml
- azure-managed-cluster-template.yaml
- azure-managed-machinepool-template.yaml
- ../../azure-cluster-identity
- kubeadm-config-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureManagedControlPlaneTemplate
metadata:
name: ${CLUSTER_NAME}-control-plane
spec:
identityRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureClusterIdentity
name: "${CLUSTER_IDENTITY_NAME}"
Loading

0 comments on commit b80750f

Please sign in to comment.