You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In AKS hybrid, when a user specifies the LoadBalancerIP for a service as described in the Kubernetes service spec, this does not work.
Workaround
For now, we recommend using ExternalIPs as we work on a permanent fix in an upcoming release. You need to make sure the IP address is within the range of the VIP pool you used during cluster creation. Below is an example of how you would assign a static IP address to a service in AKS hybrid.
Step 1 - Create an application deployment. In this example I will use nginx.
kubectl create deployment nginx --image=nginx
Step 2 - Create a service of type=LoadBalancer and set the value externalIPs with the static IP address that you want to use to access the service. Note: You cannot specify an IP address that's outside the range that was when you created the cluster network.
Save the following example in a file named nginx-service.yaml
apiVersion: v1kind: Servicemetadata:
name: nginxannotations:
spec:
type: LoadBalancerports:
- port: 80protocol: TCPtargetPort: 80selector:
app: nginxexternalIPs:
- 192.168.248.15 # this IP address should be in the same range as your VIP pool
Open a terminal and run kubectl apply to create the service
kubectl apply -f nginx-service.yaml
You can verify that the externalIP has been assigned to the service by running the following command:
kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1<none>443/TCP 5d18h
nginx LoadBalancer 10.120.110.180192.168.248.1580:30304/TCP 7s
Step 3 - Test the service
Run curl to verify that the service is reachable:
curl 192.168.248.15
<!DOCTYPE html><html><head><title>Welcome to nginx!</title><style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style></head><body><h1>Welcome to nginx!</h1><p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p><p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p><p><em>Thank you for using nginx.</em></p></body></html>
The text was updated successfully, but these errors were encountered:
baziwane
added
the
Bug
A bug filed by an internal or external team that affects the customers
label
Jan 26, 2023
In AKS hybrid, when a user specifies the
LoadBalancerIP
for a service as described in the Kubernetes service spec, this does not work.Workaround
For now, we recommend using
ExternalIPs
as we work on a permanent fix in an upcoming release. You need to make sure the IP address is within the range of the VIP pool you used during cluster creation. Below is an example of how you would assign a static IP address to a service in AKS hybrid.Step 1 - Create an application deployment. In this example I will use nginx.
Step 2 - Create a service of
type=LoadBalancer
and set the valueexternalIPs
with the static IP address that you want to use to access the service.Note: You cannot specify an IP address that's outside the range that was when you created the cluster network.
Save the following example in a file named
nginx-service.yaml
Open a terminal and run
kubectl apply
to create the serviceYou can verify that the externalIP has been assigned to the service by running the following command:
Step 3 - Test the service
Run
curl
to verify that the service is reachable:The text was updated successfully, but these errors were encountered: