Skip to content

Commit 2ccc1cc

Browse files
authored
Merge pull request #225417 from schaffererin/load-balancer-deprecate
New PR for deprecate LoadBalancerIP field with new Service annotations
2 parents f9b20e5 + 95875e4 commit 2ccc1cc

File tree

2 files changed

+53
-19
lines changed

2 files changed

+53
-19
lines changed

articles/aks/internal-lb.md

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,50 @@ internal-app LoadBalancer 10.0.248.59 10.240.0.7 80:30555/TCP 2m
7171

7272
## Specify an IP address
7373

74-
If you want to use a specific IP address with the internal load balancer, add the *loadBalancerIP* property to the load balancer YAML manifest. In this scenario, the specified IP address must reside in the same subnet as the AKS cluster, but it can't already be assigned to a resource. For example, you shouldn't use an IP address in the range designated for the Kubernetes subnet within the AKS cluster.
75-
76-
> [!NOTE]
77-
> If you initially deploy the service without specifying an IP address and later you update its configuration to use a dynamically assigned IP address using the *loadBalancerIP* property, the IP address still shows as dynamically assigned.
74+
When you specify an IP address for the load balancer, the specified IP address must reside in the same subnet as the AKS cluster, but it can't already be assigned to a resource. For example, you shouldn't use an IP address in the range designated for the Kubernetes subnet within the AKS cluster.
7875

7976
For more information on subnets, see [Add a node pool with a unique subnet][unique-subnet].
8077

81-
```yaml
82-
apiVersion: v1
83-
kind: Service
84-
metadata:
85-
name: internal-app
86-
annotations:
87-
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
88-
spec:
89-
type: LoadBalancer
90-
loadBalancerIP: 10.240.0.25
91-
ports:
92-
- port: 80
93-
selector:
94-
app: internal-app
95-
```
78+
If you want to use a specific IP address with the load balancer, there are two ways:
79+
80+
> [!IMPORTANT]
81+
> Adding the *LoadBalancerIP* property to the load balancer YAML manifest is deprecating following [upstream Kubernetes](https://github.com/kubernetes/kubernetes/pull/107235). While current usage remains the same and existing services are expected to work without modification, we **highly recommend setting service annotations** instead.
82+
83+
* **Set service annotations**: Use `service.beta.kubernetes.io/azure-load-balancer-ipv4` for an IPv4 address and `service.beta.kubernetes.io/azure-load-balancer-ipv6` for an IPv6 address.
84+
85+
```yaml
86+
apiVersion: v1
87+
kind: Service
88+
metadata:
89+
name: internal-app
90+
annotations:
91+
service.beta.kubernetes.io/azure-load-balancer-ipv4: 10.240.0.25
92+
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
93+
spec:
94+
type: LoadBalancer
95+
ports:
96+
- port: 80
97+
selector:
98+
app: internal-app
99+
```
100+
101+
* **Add the *LoadBalancerIP* property to the load balancer YAML manifest**: Add the *Service.Spec.LoadBalancerIP* property to the load balancer YAML manifest. This field is deprecating following [upstream Kubernetes](https://github.com/kubernetes/kubernetes/pull/107235), and it can't support dual-stack. Current usage remains the same and existing services are expected to work without modification.
102+
103+
```yaml
104+
apiVersion: v1
105+
kind: Service
106+
metadata:
107+
name: internal-app
108+
annotations:
109+
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
110+
spec:
111+
type: LoadBalancer
112+
loadBalancerIP: 10.240.0.25
113+
ports:
114+
- port: 80
115+
selector:
116+
app: internal-app
117+
```
96118

97119
When you view the service details, the IP address in the *EXTERNAL-IP* column should reflect your specified IP address.
98120

articles/aks/load-balancer-standard.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ spec:
5555
app: public-app
5656
```
5757
58+
### Specify the load balancer IP address
59+
60+
If you want to use a specific IP address with the load balancer, there are two ways:
61+
62+
> [!IMPORTANT]
63+
> Adding the *LoadBalancerIP* property to the load balancer YAML manifest is deprecating following [upstream Kubernetes](https://github.com/kubernetes/kubernetes/pull/107235). While current usage remains the same and existing services are expected to work without modification, we **highly recommend setting service annotations** instead.
64+
65+
* **Set service annotations**: Use `service.beta.kubernetes.io/azure-load-balancer-ipv4` for an IPv4 address and `service.beta.kubernetes.io/azure-load-balancer-ipv6` for an IPv6 address.
66+
* **Add the *LoadBalancerIP* property to the load balancer YAML manifest**: Add the *Service.Spec.LoadBalancerIP* property to the load balancer YAML manifest. This field is deprecating following [upstream Kubernetes](https://github.com/kubernetes/kubernetes/pull/107235), and it can't support dual-stack. Current usage remains the same and existing services are expected to work without modification.
67+
68+
### Deploy the service manifest
69+
5870
Deploy the public service manifest using [`kubectl apply`][kubectl-apply] and specify the name of your YAML manifest.
5971

6072
```azurecli-interactive

0 commit comments

Comments
 (0)