簡體   English   中英

無法在亞馬遜 eks 上創建 ALB 入口控制器

[英]failing to create ALB ingress controller on amazon eks

我正在嘗試在亞馬遜 eks 上創建 ALB 入口控制器,當我運行 kubectl apply -f alb-ingress-controller 時,我正在關注https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html文檔.yaml 命令我得到以下錯誤。 請幫我解決這個問題。 我參考了許多文檔,但仍然無法創建 ALB 入口控制器。 PF alb-ingress-controller.yaml 文件如下

錯誤:

部署“alb-ingress-controller”無效:spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/name":"alb-ingress-controller"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}:字段不可變

 # Application Load Balancer (ALB) Ingress Controller Deployment Manifest. # This manifest details sensible defaults for deploying an ALB Ingress Controller. # GitHub: https://github.com/kubernetes-sigs/aws-alb-ingress-controller apiVersion: apps/v1 kind: Deployment metadata: labels: app.kubernetes.io/name: alb-ingress-controller name: alb-ingress-controller # Namespace the ALB Ingress Controller should run in. Does not impact which # namespaces it's able to resolve ingress resource for. For limiting ingress # namespace scope, see --watch-namespace. namespace: kube-system spec: selector: matchLabels: app.kubernetes.io/name: alb-ingress-controller template: metadata: labels: app.kubernetes.io/name: alb-ingress-controller spec: containers: - name: alb-ingress-controller args: # Limit the namespace where this ALB Ingress Controller deployment will # resolve ingress resources. If left commented, all namespaces are used. # - --watch-namespace=your-k8s-namespace # Setting the ingress-class flag below ensures that only ingress resources with the # annotation kubernetes.io/ingress.class: "alb" are respected by the controller. You may # choose any class you'd like for this controller to respect. - --ingress-class=alb # REQUIRED # Name of your cluster. Used when naming resources created # by the ALB Ingress Controller, providing distinction between # clusters. - --cluster-name=Cluster-name # AWS VPC ID this ingress controller will use to create AWS resources. # If unspecified, it will be discovered from ec2metadata. - --aws-vpc-id=vpc-id # AWS region this ingress controller will operate in. # If unspecified, it will be discovered from ec2metadata. # List of regions: http://docs.aws.amazon.com/general/latest/gr/rande.html#vpc_region - --aws-region=ap-south-1 # Enables logging on all outbound requests sent to the AWS API. # If logging is desired, set to true. # - --aws-api-debug # Maximum number of times to retry the aws calls. # defaults to 10. # - --aws-max-retries=10 # env: # AWS key id for authenticating with the AWS API. # This is only here for examples. It's recommended you instead use # a project like kube2iam for granting access. #- name: AWS_ACCESS_KEY_ID # value: KEYVALUE # AWS key secret for authenticating with the AWS API. # This is only here for examples. It's recommended you instead use # a project like kube2iam for granting access. #- name: AWS_SECRET_ACCESS_KEY # value: SECRETVALUE # Repository location of the ALB Ingress Controller. image: docker.io/amazon/aws-alb-ingress-controller:v1.1.3 serviceAccountName: alb-ingress-controller

刪除舊部署並創建新部署后出現上述錯誤 在此處輸入圖片說明

在此處輸入圖片說明

我遇到了同樣的錯誤,我不得不刪除舊的部署然后重新申請。

kubectl get deployments --all-namespaces

列出所有部署。

如果你能看到 alb-ingress-controller:

kubectl -n [namespace] delete deploy alb-ingress-controller

將刪除舊部署,然后重試。

我可以通過將實例類型增加到兩個 t3.Xlarge Linux 節點來修復 ALB 入口控制器問題。 我的集群包含 2 個 Linux 節點和 1 個 Windows 節點。這是我參考的文檔。

https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html https://docs.aws.amazon.com/eks/latest/userguide/launch-windows-workers.html https://medium.com/faun/aws-eks-and-pods-sizing-per-node-thinkations-964b08dcfad3

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM