Skip to content

Commit

Permalink
update default template
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Nov 13, 2024
1 parent 726d405 commit 196dc2d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
15 changes: 13 additions & 2 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,23 @@ spec:
publicIP:
dnsName: ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com
name: ${CLUSTER_NAME}-api-lb
- name: ${CLUSTER_NAME}-internal-lb-ip
privateIP: 10.0.0.100
subnets:
- name: control-plane-subnet
- cidrBlocks:
- 10.0.0.0/24
- 10.0.1.0/24
name: control-plane-subnet
role: control-plane
- name: node-subnet
- cidrBlocks:
- 10.0.2.0/24
- 10.0.3.0/24
- 10.0.4.0/24
name: node-subnet
role: node
vnet:
cidrBlocks:
- 10.0.0.0/16
name: ${AZURE_VNET_NAME:=${CLUSTER_NAME}-vnet}
resourceGroup: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}
subscriptionID: ${AZURE_SUBSCRIPTION_ID}
Expand Down
4 changes: 2 additions & 2 deletions templates/flavors/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ resources:

patches:
- path: ../../azure-cluster-identity/azurecluster-identity-ref.yaml
- path: ../../internal-load-balancer/azure-cluster-frontend-ip.yaml
- path: ../../internal-load-balancer/kubeadm-config-template-worker-node.yaml
- path: patches/azure-cluster-vnet-subnet-cidrs.yaml
- path: patches/kubeadm-config-template-worker-node.yaml

sortOptions:
order: fifo
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureCluster
metadata:
name: ${CLUSTER_NAME}
spec:
networkSpec:
apiServerLB:
# We pre-create this public IP and the DNS name to use it in the
# worker node's /etc/hosts.
frontendIPs:
- name: ${CLUSTER_NAME}-api-lb
publicIP:
name: ${CLUSTER_NAME}-api-lb
dnsName: ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com
- name: ${CLUSTER_NAME}-internal-lb-ip
privateIP: 10.0.0.100
vnet:
cidrBlocks:
- 10.0.0.0/16
subnets:
- name: control-plane-subnet
role: control-plane
cidrBlocks:
- 10.0.0.0/24
- 10.0.1.0/24
- name: node-subnet
role: node
cidrBlocks:
- 10.0.2.0/24
- 10.0.3.0/24
- 10.0.4.0/24
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
spec:
template:
spec:
# /etc/hosts file is updated with a pre-created DNS name of the API server and internal load-balancer's IP.
# This custom DNS Resolution of the API server ensures that the worker nodes can reach the API server when
# the public IP of the API server is not accessible.
# 10.0.0.100 is the default IP that gets assigned to an internal load balancer.
preKubeadmCommands:
- echo '10.0.0.100 ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com' >> /etc/hosts

0 comments on commit 196dc2d

Please sign in to comment.