aws-load-balancer-controller 在 Fargate 上无法启动

huangapple go评论127阅读模式
英文:

aws-load-balancer-controller will not start on Fargate

问题

我想在我的EKS集群上设置一个aws-load-balancer-controller。但是当它要启动时,它显示以下错误。

  1. Warning FailedScheduling 109s default-scheduler 0/2 nodes are available: 2 node(s) had untolerated taint {eks.amazonaws.com/compute-type: fargate}. preemption: 0/2 nodes are available: 2 Preemption is not helpful for scheduling.

在将默认调度器更改为fargate调度器之后,我得到了另一个错误。

  1. Events:
  2. Type Reason Age From Message
  3. ---- ------ ---- ---- -------
  4. Warning FailedScheduling 39s fargate-scheduler Misconfigured Fargate Profile: pod does not have profile label eks.amazonaws.com/fargate-profile

但是fargate配置文件似乎是正确的。Core-DNS在具有相同配置文件的相同命名空间中在Fargate上运行。

这是部署的yaml文件:

  1. # Please edit the object below. Lines beginning with a '#' will be ignored,
  2. # and an empty file will abort the edit. If an error occurs while saving this file will be
  3. # reopened with the relevant failures.
  4. #
  5. apiVersion: apps/v1
  6. kind: Deployment
  7. metadata:
  8. annotations:
  9. deployment.kubernetes.io/revision: "8"
  10. meta.helm.sh/release-name: aws-load-balancer-controller
  11. meta.helm.sh/release-namespace: kube-system
  12. creationTimestamp: "2023-07-13T10:14:08Z"
  13. generation: 7
  14. labels:
  15. app.kubernetes.io/instance: aws-load-balancer-controller
  16. app.kubernetes.io/managed-by: Helm
  17. app.kubernetes.io/name: aws-load-balancer-controller
  18. app.kubernetes.io/version: v2.5.3
  19. helm.sh/chart: aws-load-balancer-controller-1.5.4
  20. name: aws-load-balancer-controller
  21. namespace: kube-system
  22. resourceVersion: "40259"
  23. uid: abde0d23-8759-45a9-8bf9-a53089ec567f
  24. spec:
  25. progressDeadlineSeconds: 600
  26. replicas: 2
  27. revisionHistoryLimit: 10
  28. selector:
  29. matchLabels:
  30. app.kubernetes.io/instance: aws-load-balancer-controller
  31. app.kubernetes.io/name: aws-load-balancer-controller
  32. strategy:
  33. rollingUpdate:
  34. maxSurge: 25%
  35. maxUnavailable: 25%
  36. type: RollingUpdate
  37. template:
  38. metadata:
  39. annotations:
  40. kubectl.kubernetes.io/restartedAt: "2023-07-13T14:38:36+02:00"
  41. prometheus.io/port: "8080"
  42. prometheus.io/scrape: "true"
  43. creationTimestamp: null
  44. labels:
  45. app.kubernetes.io/instance: aws-load-balancer-controller
  46. app.kubernetes.io/name: aws-load-balancer-controller
  47. spec:
  48. affinity:
  49. podAntiAffinity:
  50. preferredDuringSchedulingIgnoredDuringExecution:
  51. - podAffinityTerm:
  52. labelSelector:
  53. matchExpressions:
  54. - key: app.kubernetes.io/name
  55. operator: In
  56. values:
  57. - aws-load-balancer-controller
  58. topologyKey: kubernetes.io/hostname
  59. weight: 100
  60. containers:
  61. - args:
  62. - --cluster-name=dsa-ph-dev-cluster
  63. - --ingress-class=alb
  64. image: public.ecr.aws/eks/aws-load-balancer-controller:v2.5.3
  65. imagePullPolicy: IfNotPresent
  66. livenessProbe:
  67. failureThreshold: 2
  68. httpGet:
  69. path: /healthz
  70. port: 61779
  71. scheme: HTTP
  72. initialDelaySeconds: 30
  73. periodSeconds: 10
  74. successThreshold: 1
  75. timeoutSeconds: 10
  76. name: aws-load-balancer-controller
  77. ports:
  78. - containerPort: 9443
  79. name: webhook-server
  80. protocol: TCP
  81. - containerPort: 8080
  82. name: metrics-server
  83. protocol: TCP
  84. resources: {}
  85. securityContext:
  86. allowPrivilegeEscalation: false
  87. readOnlyRootFilesystem: true
  88. runAsNonRoot: true
  89. terminationMessagePath: /dev/termination-log
  90. terminationMessagePolicy: File
  91. volumeMounts:
  92. - mountPath: /tmp/k8s-webhook-server/serving-certs
  93. name: cert
  94. readOnly: true
  95. dnsPolicy: ClusterFirst
  96. priorityClassName: system-cluster-critical
  97. restartPolicy: Always
  98. schedulerName: fargate-scheduler
  99. securityContext:
  100. fsGroup: 65534
  101. serviceAccount: aws-load-balancer-controller
  102. serviceAccountName: aws-load-balancer-controller
  103. terminationGracePeriodSeconds: 10
  104. volumes:
  105. - name: cert
  106. secret:
  107. defaultMode: 420
  108. secretName: aws-load-balancer-tls
  109. status:
  110. collisionCount: 1
  111. conditions:
  112. - lastTransitionTime: "2023-07-13T10:14:08Z"
  113. lastUpdateTime: "2023-07-13T10:14:08Z"
  114. message: Deployment does not have minimum availability.
  115. reason: MinimumReplicasUnavailable
  116. status: "False"
  117. type: Available
  118. - lastTransitionTime: "2023-07-13T12:48:38Z"
  119. lastUpdateTime: "2023-07-13T12:48:38Z"
  120. message: ReplicaSet "aws-load-balancer-controller-8dcdd998d" has timed out progressing.
  121. reason: ProgressDeadlineExceeded
  122. status: "False"
  123. type: Progressing
  124. observedGeneration: 7
  125. replicas: 3
  126. unavailableReplicas: 3
  127. updatedReplicas: 1

有人在此之前遇到过这个错误吗?

谢谢。

英文:

I want to setup an aws-load-balancer-controller on my EKS Cluster. But when it want to start up it shows the following error.

Warning FailedScheduling 109s default-scheduler 0/2 nodes are available: 2 node(s) had untolerated taint {eks.amazonaws.com/compute-type: fargate}. preemption: 0/2 nodes are available: 2 Preemption is not helpful for scheduling..

After changing the default scheduler to fargate scheduler i got another error.

`Events:
Type Reason Age From Message


Warning FailedScheduling 39s fargate-scheduler Misconfigured Fargate Profile: pod does not have profile label eks.amazonaws.com/fargate-profile`

But the fargate profile seems to be right. Core-DNS is working on Fargate with the same profile in the same namespace.

This is the deployment yaml:

  1. # Please edit the object below. Lines beginning with a '#' will be ignored,
  2. # and an empty file will abort the edit. If an error occurs while saving this file will be
  3. # reopened with the relevant failures.
  4. #
  5. apiVersion: apps/v1
  6. kind: Deployment
  7. metadata:
  8. annotations:
  9. deployment.kubernetes.io/revision: "8"
  10. meta.helm.sh/release-name: aws-load-balancer-controller
  11. meta.helm.sh/release-namespace: kube-system
  12. creationTimestamp: "2023-07-13T10:14:08Z"
  13. generation: 7
  14. labels:
  15. app.kubernetes.io/instance: aws-load-balancer-controller
  16. app.kubernetes.io/managed-by: Helm
  17. app.kubernetes.io/name: aws-load-balancer-controller
  18. app.kubernetes.io/version: v2.5.3
  19. helm.sh/chart: aws-load-balancer-controller-1.5.4
  20. name: aws-load-balancer-controller
  21. namespace: kube-system
  22. resourceVersion: "40259"
  23. uid: abde0d23-8759-45a9-8bf9-a53089ec567f
  24. spec:
  25. progressDeadlineSeconds: 600
  26. replicas: 2
  27. revisionHistoryLimit: 10
  28. selector:
  29. matchLabels:
  30. app.kubernetes.io/instance: aws-load-balancer-controller
  31. app.kubernetes.io/name: aws-load-balancer-controller
  32. strategy:
  33. rollingUpdate:
  34. maxSurge: 25%
  35. maxUnavailable: 25%
  36. type: RollingUpdate
  37. template:
  38. metadata:
  39. annotations:
  40. kubectl.kubernetes.io/restartedAt: "2023-07-13T14:38:36+02:00"
  41. prometheus.io/port: "8080"
  42. prometheus.io/scrape: "true"
  43. creationTimestamp: null
  44. labels:
  45. app.kubernetes.io/instance: aws-load-balancer-controller
  46. app.kubernetes.io/name: aws-load-balancer-controller
  47. spec:
  48. affinity:
  49. podAntiAffinity:
  50. preferredDuringSchedulingIgnoredDuringExecution:
  51. - podAffinityTerm:
  52. labelSelector:
  53. matchExpressions:
  54. - key: app.kubernetes.io/name
  55. operator: In
  56. values:
  57. - aws-load-balancer-controller
  58. topologyKey: kubernetes.io/hostname
  59. weight: 100
  60. containers:
  61. - args:
  62. - --cluster-name=dsa-ph-dev-cluster
  63. - --ingress-class=alb
  64. image: public.ecr.aws/eks/aws-load-balancer-controller:v2.5.3
  65. imagePullPolicy: IfNotPresent
  66. livenessProbe:
  67. failureThreshold: 2
  68. httpGet:
  69. path: /healthz
  70. port: 61779
  71. scheme: HTTP
  72. initialDelaySeconds: 30
  73. periodSeconds: 10
  74. successThreshold: 1
  75. timeoutSeconds: 10
  76. name: aws-load-balancer-controller
  77. ports:
  78. - containerPort: 9443
  79. name: webhook-server
  80. protocol: TCP
  81. - containerPort: 8080
  82. name: metrics-server
  83. protocol: TCP
  84. resources: {}
  85. securityContext:
  86. allowPrivilegeEscalation: false
  87. readOnlyRootFilesystem: true
  88. runAsNonRoot: true
  89. terminationMessagePath: /dev/termination-log
  90. terminationMessagePolicy: File
  91. volumeMounts:
  92. - mountPath: /tmp/k8s-webhook-server/serving-certs
  93. name: cert
  94. readOnly: true
  95. dnsPolicy: ClusterFirst
  96. priorityClassName: system-cluster-critical
  97. restartPolicy: Always
  98. schedulerName: fargate-scheduler
  99. securityContext:
  100. fsGroup: 65534
  101. serviceAccount: aws-load-balancer-controller
  102. serviceAccountName: aws-load-balancer-controller
  103. terminationGracePeriodSeconds: 10
  104. volumes:
  105. - name: cert
  106. secret:
  107. defaultMode: 420
  108. secretName: aws-load-balancer-tls
  109. status:
  110. collisionCount: 1
  111. conditions:
  112. - lastTransitionTime: "2023-07-13T10:14:08Z"
  113. lastUpdateTime: "2023-07-13T10:14:08Z"
  114. message: Deployment does not have minimum availability.
  115. reason: MinimumReplicasUnavailable
  116. status: "False"
  117. type: Available
  118. - lastTransitionTime: "2023-07-13T12:48:38Z"
  119. lastUpdateTime: "2023-07-13T12:48:38Z"
  120. message: ReplicaSet "aws-load-balancer-controller-8dcdd998d" has timed out progressing.
  121. reason: ProgressDeadlineExceeded
  122. status: "False"
  123. type: Progressing
  124. observedGeneration: 7
  125. replicas: 3
  126. unavailableReplicas: 3
  127. updatedReplicas: 1

Had someone had this error before?

Thanks.

答案1

得分: 1

一个Fargate配置文件具有一个选择器,例如命名空间、标签或两者兼有。如果您想在Fargate上运行一个应用程序,它需要一个匹配的选择器。例如,如果您的Fargate配置文件具有一个用于名为Fargate的命名空间的选择器,那么部署到该命名空间的所有Pod将作为Fargate Pod运行。您的部署正试图将负载均衡控制器部署到kube-system命名空间中。您的Fargate配置文件是否配置为将kube-system作为其命名空间选择器?错误似乎表明您的Pod缺少一个名为eks.amazonaws.com/fargate-profile的标签。

英文:

A Fargate profile has a selector, e.g. a namespace, label, or both. If you want to run an application with Fargate, it needs a matching selector. For example, if your Fargate profile has a namespace selector for a namespace called Fargate, all pods deployed to that namespace will run as Fargate pods. Your deployment is trying to deploy the load balancer controller into the kube-system namespace. Is your Fargate profile configured to use kube-system as its namespace selector? The error appears to indicate that a label, eks.amazonaws.com/fargate-profile, is missing from your pod.

huangapple
  • 本文由 发表于 2023年7月13日 20:34:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76679446.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定