1

几周前,我在 AKS 集群上设置了负载均衡器。我正在使用以下脚本将.cloudapp.azure.com域指向负载均衡器:

#!/bin/bash

# Public IP address of your ingress controller
IP="<MY_IP>"

# Name to associate with public IP address
DNSNAME="<MY_DNS_NAME>"

# Get the resource-id of the public ip
PUBLICIPID=$(az network public-ip list --query "[?ipAddress!=null]|[?contains(ipAddress, '$IP')].[id]" --output tsv)

# Update public ip address with DNS name
az network public-ip update --ids $PUBLICIPID --dns-name $DNSNAME

问题是 FQDN 不断消失,大约每 24 小时一次。每天我都必须再次运行脚本,然后一切又好了。为什么会发生这种情况?

我已经为我的负载均衡器分配了一个静态IP,它也没有重新启动。我使用以下命令分配静态 ip:

az network public-ip create --resource-group <MY_RG> --name <IP_NAME> --sku Standard --allocation-method static --query publicIp.ipAddress -o tsv

并在我的图表中将此 IP 用于 nginx 控制器。IP 一直指向正确的位置,但域名不断消失。

提前感谢您的任何建议,非常感谢。

4

0 回答 0