Skip to content

Commit

Permalink
make private IP of the ILB configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Dec 27, 2024
1 parent 2be2adc commit 66e5b0d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions templates/cluster-template-apiserver-ilb.yaml

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

6 changes: 3 additions & 3 deletions templates/cluster-template-windows-apiserver-ilb.yaml

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

2 changes: 1 addition & 1 deletion templates/flavors/apiserver-ilb/patches/control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
name: ${CLUSTER_NAME}-api-lb
dnsName: ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com
- name: ${CLUSTER_NAME}-internal-lb-private-ip
privateIP: 30.0.0.100
privateIP: ${AZURE_INTERNAL_LB_PRIVATE_IP:-30.0.0.100}
vnet:
cidrBlocks:
- 30.0.0.0/8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ spec:
# 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.
preKubeadmCommands:
- echo '30.0.0.100 ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com' >> /etc/hosts
- echo '${AZURE_INTERNAL_LB_PRIVATE_IP:-30.0.0.100} ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com' >> /etc/hosts
6 changes: 3 additions & 3 deletions templates/flavors/windows-apiserver-ilb/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ patches:
patch: |-
- op: replace
path: /spec/template/spec/preKubeadmCommands/0
value: echo '40.0.0.100 ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com' >> /etc/hosts
value: echo '${AZURE_INTERNAL_LB_PRIVATE_IP:-40.0.0.100} ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com' >> /etc/hosts
- target:
kind: AzureCluster
patch: |-
- op: replace
path: /spec/networkSpec/apiServerLB/frontendIPs/1/privateIP
value: 40.0.11.100
value: ${AZURE_INTERNAL_LB_PRIVATE_IP:-40.0.0.100}
- target:
kind: AzureCluster
patch: |-
Expand All @@ -46,7 +46,7 @@ patches:
- op: replace
path: /spec/template/spec/preKubeadmCommands/0
value:
powershell -Command "Add-Content -Path 'C:\\Windows\\System32\\drivers\\etc\\hosts' -Value '40.0.0.100 ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com'"
powershell -Command "Add-Content -Path 'C:\\Windows\\System32\\drivers\\etc\\hosts' -Value '${AZURE_INTERNAL_LB_PRIVATE_IP:-40.0.0.100} ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com'"
sortOptions:
order: fifo
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ spec:
# so that worker nodes can access the API server using the internal IP.
# 10.0.0.100 is the default IP that gets assigned to a internal load balancer.
preKubeadmCommands:
- powershell -Command "Add-Content -Path 'C:\\Windows\\System32\\drivers\\etc\\hosts' -Value '10.0.0.100 ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com'"
- powershell -Command "Add-Content -Path 'C:\\Windows\\System32\\drivers\\etc\\hosts' -Value '${AZURE_INTERNAL_LB_PRIVATE_IP:-40.0.0.100} ${CLUSTER_NAME}-${APISERVER_LB_DNS_SUFFIX}.${AZURE_LOCATION}.cloudapp.azure.com'"

0 comments on commit 66e5b0d

Please sign in to comment.