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

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

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

问题

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

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调度器之后,我得到了另一个错误。

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

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

这是部署的yaml文件:

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "8"
    meta.helm.sh/release-name: aws-load-balancer-controller
    meta.helm.sh/release-namespace: kube-system
  creationTimestamp: "2023-07-13T10:14:08Z"
  generation: 7
  labels:
    app.kubernetes.io/instance: aws-load-balancer-controller
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: aws-load-balancer-controller
    app.kubernetes.io/version: v2.5.3
    helm.sh/chart: aws-load-balancer-controller-1.5.4
  name: aws-load-balancer-controller
  namespace: kube-system
  resourceVersion: "40259"
  uid: abde0d23-8759-45a9-8bf9-a53089ec567f
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: aws-load-balancer-controller
      app.kubernetes.io/name: aws-load-balancer-controller
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        kubectl.kubernetes.io/restartedAt: "2023-07-13T14:38:36+02:00"
        prometheus.io/port: "8080"
        prometheus.io/scrape: "true"
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: aws-load-balancer-controller
        app.kubernetes.io/name: aws-load-balancer-controller
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - aws-load-balancer-controller
              topologyKey: kubernetes.io/hostname
            weight: 100
      containers:
      - args:
        - --cluster-name=dsa-ph-dev-cluster
        - --ingress-class=alb
        image: public.ecr.aws/eks/aws-load-balancer-controller:v2.5.3
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 2
          httpGet:
            path: /healthz
            port: 61779
            scheme: HTTP
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
        name: aws-load-balancer-controller
        ports:
        - containerPort: 9443
          name: webhook-server
          protocol: TCP
        - containerPort: 8080
          name: metrics-server
          protocol: TCP
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /tmp/k8s-webhook-server/serving-certs
          name: cert
          readOnly: true
      dnsPolicy: ClusterFirst
      priorityClassName: system-cluster-critical
      restartPolicy: Always
      schedulerName: fargate-scheduler
      securityContext:
        fsGroup: 65534
      serviceAccount: aws-load-balancer-controller
      serviceAccountName: aws-load-balancer-controller
      terminationGracePeriodSeconds: 10
      volumes:
      - name: cert
        secret:
          defaultMode: 420
          secretName: aws-load-balancer-tls
status:
  collisionCount: 1
  conditions:
  - lastTransitionTime: "2023-07-13T10:14:08Z"
    lastUpdateTime: "2023-07-13T10:14:08Z"
    message: Deployment does not have minimum availability.
    reason: MinimumReplicasUnavailable
    status: "False"
    type: Available
  - lastTransitionTime: "2023-07-13T12:48:38Z"
    lastUpdateTime: "2023-07-13T12:48:38Z"
    message: ReplicaSet "aws-load-balancer-controller-8dcdd998d" has timed out progressing.
    reason: ProgressDeadlineExceeded
    status: "False"
    type: Progressing
  observedGeneration: 7
  replicas: 3
  unavailableReplicas: 3
  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:

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "8"
meta.helm.sh/release-name: aws-load-balancer-controller
meta.helm.sh/release-namespace: kube-system
creationTimestamp: "2023-07-13T10:14:08Z"
generation: 7
labels:
app.kubernetes.io/instance: aws-load-balancer-controller
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: aws-load-balancer-controller
app.kubernetes.io/version: v2.5.3
helm.sh/chart: aws-load-balancer-controller-1.5.4
name: aws-load-balancer-controller
namespace: kube-system
resourceVersion: "40259"
uid: abde0d23-8759-45a9-8bf9-a53089ec567f
spec:
progressDeadlineSeconds: 600
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/instance: aws-load-balancer-controller
app.kubernetes.io/name: aws-load-balancer-controller
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
kubectl.kubernetes.io/restartedAt: "2023-07-13T14:38:36+02:00"
prometheus.io/port: "8080"
prometheus.io/scrape: "true"
creationTimestamp: null
labels:
app.kubernetes.io/instance: aws-load-balancer-controller
app.kubernetes.io/name: aws-load-balancer-controller
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- aws-load-balancer-controller
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- --cluster-name=dsa-ph-dev-cluster
- --ingress-class=alb
image: public.ecr.aws/eks/aws-load-balancer-controller:v2.5.3
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 2
httpGet:
path: /healthz
port: 61779
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
name: aws-load-balancer-controller
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
- containerPort: 8080
name: metrics-server
protocol: TCP
resources: {}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
dnsPolicy: ClusterFirst
priorityClassName: system-cluster-critical
restartPolicy: Always
schedulerName: fargate-scheduler
securityContext:
fsGroup: 65534
serviceAccount: aws-load-balancer-controller
serviceAccountName: aws-load-balancer-controller
terminationGracePeriodSeconds: 10
volumes:
- name: cert
secret:
defaultMode: 420
secretName: aws-load-balancer-tls
status:
collisionCount: 1
conditions:
- lastTransitionTime: "2023-07-13T10:14:08Z"
lastUpdateTime: "2023-07-13T10:14:08Z"
message: Deployment does not have minimum availability.
reason: MinimumReplicasUnavailable
status: "False"
type: Available
- lastTransitionTime: "2023-07-13T12:48:38Z"
lastUpdateTime: "2023-07-13T12:48:38Z"
message: ReplicaSet "aws-load-balancer-controller-8dcdd998d" has timed out progressing.
reason: ProgressDeadlineExceeded
status: "False"
type: Progressing
observedGeneration: 7
replicas: 3
unavailableReplicas: 3
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:

确定