azure-aks - 不能使用节点资源组之外的静态 IP 地址
问题描述
我正在尝试按照此处的指南为在节点资源组之外创建的仪表板使用静态 IP 地址,但它不起作用。(这适用于受防火墙保护的仅开发集群,不会投入生产。)
到目前为止我做了什么:
- 在 resourcegroup1 中创建了一个公共 IP 地址
- 在与 Azure 广告应用程序绑定的资源组 1 中创建 AKS 群集。
- 将 azure 广告应用程序的服务主体添加为 resourcegroup1 中的“网络参与者”。
- 添加
service.beta.kubernetes.io/azure-load-balancer-resource-group: resourcegroup1
到我的 service.yaml 文件中。 - 使用步骤 1 中的 IP 地址添加了 loadBalancerIP。
每当我应用 service.yaml 时,服务都会说它处于挂起状态。当我运行时kubectl describe service
,它显示以下输出:
Name: kubernetes-dashboard
Namespace: kube-system
Labels: <none>
Annotations: externalTrafficPolicy=Local
service.beta.kubernetes.io/azure-load-balancer-resource-group=resourcegroup1
Selector: k8s-app=kubernetes-dashboard
Type: LoadBalancer
IP: 10.0.42.112
IP: <IP FROM STEP 1>
Port: <unset> 80/TCP
TargetPort: 9090/TCP
NodePort: <unset> 31836/TCP
Endpoints: 10.244.0.6:9090
Session Affinity: None
External Traffic Policy: Cluster
LoadBalancer Source Ranges: <SNIPPED>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal EnsuringLoadBalancer 38s (x6 over 3m) service-controller Ensuring load balancer
Warning CreatingLoadBalancerFailed 38s (x6 over 3m) service-controller Error creating load balancer (will retry): failed to ensure load balancer for service kube-system/kubernetes-dashboard: user supplied IP Address <IP FROM STEP 1> was not found
这是我的 service.yaml
apiVersion: v1
kind: Service
metadata:
name: kubernetes-dashboard
namespace: kube-system
annotations:
service.beta.kubernetes.io/azure-load-balancer-resource-group: resourcegroup1
spec:
type: LoadBalancer
loadBalancerIP: <IP FROM STEP 1>
ports:
- port: 80
protocol: TCP
targetPort: 9090
selector:
k8s-app: kubernetes-dashboard
loadBalancerSourceRanges:
- <SNIP>
- <SNIP>
解决方案
推荐阅读
- mysql - 如何使用 MySQL 查询从表中选择除一列之外的所有内容?
- javascript - 使用 JS + CSS 的主动字体粗细
- python - 根据':'拆分txt,但不包括python中的时间戳
- javascript - 具有数据库数据的材质 UI 选择组件
- database - Redis 6 会保证客户端请求的顺序吗?
- matrix - 将此解决方案扩展到 Julia 中的高维矩阵
- python-3.x - 将用户的输入写入 if 语句中的文件。(Python)
- c# - Xamarin CollectionView 缓慢滚动
- flutter - 无法在颤振应用程序中使用contacts_service添加联系人
- excel - 插入值后保护任何单元格