AKS 似乎忽略了 Kubernetes 负载均衡器注释
AKS seems to ignore Kubernetes load balancer annotations
我需要为 LoadBalancer 类型的服务关闭 LB 上的一些探测器。由于这是不可能的,我回过头来尝试设置长探测间隔。这可以通过在此 documentation page.
上定义的注释来完成
但我无法更新运行状况探测值,注释不起作用。我验证它适用于设置内部 LB,但我无法通过注释影响探测器。除了 kubernetes 版本高于 1.21 之外,还有其他要求吗?
更新
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver
labels:
app: echoserver
spec:
replicas: 3
selector:
matchLabels:
app: echoserver
template:
metadata:
labels:
app: echoserver
spec:
containers:
- name: echoserver
image: mbodenhamer/echoserver:latest
env:
- name: LISTEN_PORTS
value: "5000,5001,5002"
ports:
- containerPort: 5000
- containerPort: 5001
- containerPort: 5002
---
apiVersion: v1
kind: Service
metadata:
name: echoserver
namespace: echoserver
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
service.beta.kubernetes.io/port_5000_health-probe_interval: "13"
service.beta.kubernetes.io/port_5001_health-probe_interval: "14"
service.beta.kubernetes.io/port_5002_health-probe_interval: "15"
spec:
type: LoadBalancer
ports:
- port: 5000
targetPort: 5000
protocol: TCP
name: port5000
- port: 5001
targetPort: 5001
protocol: TCP
name: port5001
- port: 5002
targetPort: 5002
protocol: TCP
name: port5002
selector:
app: echoserver
注释未被拾取的原因描述为here。您需要启用云控制器或将 AKS 版本升至 1.22
我需要为 LoadBalancer 类型的服务关闭 LB 上的一些探测器。由于这是不可能的,我回过头来尝试设置长探测间隔。这可以通过在此 documentation page.
上定义的注释来完成但我无法更新运行状况探测值,注释不起作用。我验证它适用于设置内部 LB,但我无法通过注释影响探测器。除了 kubernetes 版本高于 1.21 之外,还有其他要求吗?
更新
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver
labels:
app: echoserver
spec:
replicas: 3
selector:
matchLabels:
app: echoserver
template:
metadata:
labels:
app: echoserver
spec:
containers:
- name: echoserver
image: mbodenhamer/echoserver:latest
env:
- name: LISTEN_PORTS
value: "5000,5001,5002"
ports:
- containerPort: 5000
- containerPort: 5001
- containerPort: 5002
---
apiVersion: v1
kind: Service
metadata:
name: echoserver
namespace: echoserver
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
service.beta.kubernetes.io/port_5000_health-probe_interval: "13"
service.beta.kubernetes.io/port_5001_health-probe_interval: "14"
service.beta.kubernetes.io/port_5002_health-probe_interval: "15"
spec:
type: LoadBalancer
ports:
- port: 5000
targetPort: 5000
protocol: TCP
name: port5000
- port: 5001
targetPort: 5001
protocol: TCP
name: port5001
- port: 5002
targetPort: 5002
protocol: TCP
name: port5002
selector:
app: echoserver
注释未被拾取的原因描述为here。您需要启用云控制器或将 AKS 版本升至 1.22