mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-15 17:28:58 +03:00
fixed load balancer config
This commit is contained in:
@@ -156,35 +156,28 @@ In this section you will provision an external load balancer to front the Kubern
|
|||||||
Create the external load balancer network resources:
|
Create the external load balancer network resources:
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
az network lb create \
|
||||||
KUBERNETES_PUBLIC_ADDRESS=$(az network public-ip show -g kubernetes-the-hard-way -n kubernetes-the-hard-way-ip --output tsv | cut -f6)
|
--name kubernetes-the-hard-way-lb \
|
||||||
|
--resource-group kubernetes-the-hard-way \
|
||||||
|
--backend-pool-name kubernetes-the-hard-way-lb-pool \
|
||||||
|
--public-ip-address kubernetes-the-hard-way-ip
|
||||||
|
|
||||||
az network lb create \
|
az network lb probe create \
|
||||||
--name kubernetes-the-hard-way-lb \
|
--lb-name kubernetes-the-hard-way-lb \
|
||||||
--resource-group kubernetes-the-hard-way \
|
--resource-group kubernetes-the-hard-way \
|
||||||
--backend-pool-name kubernetes-the-hard-way-lb-pool \
|
--name kubernetes-the-hard-way-lb-probe \
|
||||||
--public-ip-address kubernetes-the-hard-way-ip \
|
--port 80 \
|
||||||
--vent-name kubernetes-the-hard-way-vnet \
|
--protocol tcp
|
||||||
--subnet kubernetes-the-hard-way-subnet \
|
|
||||||
|
|
||||||
az network lb probe create \
|
az network lb rule create \
|
||||||
--lb-name kubernetes-the-hard-way-lb \
|
--resource-group kubernetes-the-hard-way \
|
||||||
--resource-group kubernetes-the-hard-way \
|
--lb-name kubernetes-the-hard-way-lb \
|
||||||
--name kubernetes-the-hard-way-lb-probe \
|
--name kubernetes-the-hard-way-lb-rule \
|
||||||
--port 80 \
|
--protocol tcp \
|
||||||
--protocol tcp
|
--frontend-port 6443 \
|
||||||
|
--backend-port 6443 \
|
||||||
az network lb rule create \
|
--backend-pool-name kubernetes-the-hard-way-lb-pool \
|
||||||
--resource-group kubernetes-the-hard-way \
|
--probe-name kubernetes-the-hard-way-lb-probe
|
||||||
--lb-name kubernetes-the-hard-way-lb \
|
|
||||||
--name kubernetes-the-hard-way-lb-rule \
|
|
||||||
--protocol tcp \
|
|
||||||
--frontend-port 6443 \
|
|
||||||
--backend-port 6443 \
|
|
||||||
--frontend-ip-name kubernetes-the-hard-way-ip \
|
|
||||||
--backend-pool-name kubernetes-the-hard-way-lb-pool \
|
|
||||||
--probe-name kubernetes-the-hard-way-lb-probe
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Compute Instances
|
## Compute Instances
|
||||||
@@ -199,7 +192,7 @@ Create three network interfaces and three compute instances which will host the
|
|||||||
for i in 0 1 2; do
|
for i in 0 1 2; do
|
||||||
az network nic create \
|
az network nic create \
|
||||||
--resource-group kubernetes-the-hard-way \
|
--resource-group kubernetes-the-hard-way \
|
||||||
--name controller-${i}-nic
|
--name controller-${i}-nic \
|
||||||
--vnet-name kubernetes-the-hard-way-vnet \
|
--vnet-name kubernetes-the-hard-way-vnet \
|
||||||
--subnet kubernetes-the-hard-way-subnet \
|
--subnet kubernetes-the-hard-way-subnet \
|
||||||
--network-security-group kubernetes-the-hard-way-nsg \
|
--network-security-group kubernetes-the-hard-way-nsg \
|
||||||
@@ -213,13 +206,14 @@ done
|
|||||||
for i in 0 1 2; do
|
for i in 0 1 2; do
|
||||||
az vm create \
|
az vm create \
|
||||||
--name controller-${i} \
|
--name controller-${i} \
|
||||||
--resource-group kubernetes-the-hard-way
|
--resource-group kubernetes-the-hard-way \
|
||||||
--no-wait \
|
--no-wait \
|
||||||
--nics controller-${i}-nic
|
--nics controller-${i}-nic \
|
||||||
--image Canonical:UbuntuServer:18.04-LTS:latest
|
--public-ip-address-allocation Static
|
||||||
--admin-username azureuser
|
--image Canonical:UbuntuServer:18.04-LTS:latest \
|
||||||
--generate-ssh-keys
|
--admin-username azureuser \
|
||||||
--size Standard_B2s
|
--generate-ssh-keys \
|
||||||
|
--size Standard_B2s \
|
||||||
--data-disk-sizes-gb 200
|
--data-disk-sizes-gb 200
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
@@ -241,8 +235,6 @@ for i in 0 1 2; do
|
|||||||
--subnet kubernetes-the-hard-way-subnet \
|
--subnet kubernetes-the-hard-way-subnet \
|
||||||
--network-security-group kubernetes-the-hard-way-nsg \
|
--network-security-group kubernetes-the-hard-way-nsg \
|
||||||
--private-ip-address 10.240.0.2${i} \
|
--private-ip-address 10.240.0.2${i} \
|
||||||
--lb-name kubernetes-the-hard-way-lb \
|
|
||||||
--lb-address-pools kubernetes-the-hard-way-lb-pool \
|
|
||||||
--ip-forwarding true
|
--ip-forwarding true
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
@@ -253,6 +245,7 @@ for i in 0 1 2; do
|
|||||||
--resource-group kubernetes-the-hard-way
|
--resource-group kubernetes-the-hard-way
|
||||||
--no-wait \
|
--no-wait \
|
||||||
--nics worker-${i}-nic
|
--nics worker-${i}-nic
|
||||||
|
--public-ip-address-allocation Static
|
||||||
--image Canonical:UbuntuServer:18.04-LTS:latest
|
--image Canonical:UbuntuServer:18.04-LTS:latest
|
||||||
--admin-username azureuser
|
--admin-username azureuser
|
||||||
--generate-ssh-keys
|
--generate-ssh-keys
|
||||||
|
|||||||
Reference in New Issue
Block a user