【发布时间】:2020-10-14 11:47:33
【问题描述】:
我有一个在 AWS EKS(1.16 版)上运行的 kubernetes 集群,我的应用程序 pod 和 coredns pod 在集群上作为守护程序集运行。除了按比例缩小之外,一切似乎在所有条件下都运行良好。 当节点缩小时,应用程序给出“mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution”错误。 DNS 解析错误来自所有 pod,我之所以这么说是因为如果错误来自一个 pod,那么我可以说当应用缩减时,coredns pod 比同一节点上的应用程序 pod 更早关闭,因此应用程序无法解析数据库主机名。此外,dns 请求首先到达 kube-dns 服务,然后通过 dns pod。所以这是不可能的。
但另一方面,对于这种情况,我找不到任何合乎逻辑的表达方式。 是否有可能是我的集群自动扩缩器配置错误?
我的集群自动扩缩器配置如下:
labels:
app: cluster-autoscaler
spec:
containers:
- command:
- ./cluster-autoscaler
- --v=4
- --stderrthreshold=info
- --cloud-provider=aws
- --scan-interval=120s
- --max-empty-bulk-delete=1
- --scale-down-delay-after-delete=10m
- --scale-down-unneeded-time=14m
- --skip-nodes-with-local-storage=false
- --scale-down-utilization-threshold=0.85
- --skip-nodes-with-system-pods=false
- --nodes=8:16:nodegroup-1
- --nodes=3:10:nodegroup-2
env:
- name: AWS_REGION
value: eu-west-1
image: gcr.io/google-containers/cluster-autoscaler:v1.16.4
imagePullPolicy: Always
name: cluster-autoscaler
resources:
limits:
cpu: 100m
memory: 300Mi
requests:
cpu: 100m
memory: 300Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /etc/ssl/certs/ca-certificates.crt name: ssl-certs
readOnly: true
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: cluster-autoscaler
serviceAccountName: cluster-autoscaler
terminationGracePeriodSeconds: 30
volumes:
- hostPath:
path: /etc/ssl/certs/ca-bundle.crt
type: ""
name: ssl-certs
【问题讨论】:
标签: kubernetes autoscaling amazon-eks coredns