无法在 EKS 上部署 Ingress 对象:调用 webhook vingress.elbv2.k8s.aws 失败:服务器找不到请求的资源

nol*_*w38 1 amazon-web-services kubernetes amazon-eks

我按照此 AWS 指南:https://aws.amazon.com/premiumsupport/knowledge-center/eks-alb-ingress-controller-fargate/在 ALB 下设置我的 kubernetes 集群。

在我的 EKS 集群上安装 AWS ALB 控制器后,请执行以下步骤:

helm repo add eks https://aws.github.io/eks-charts
kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller//crds?ref=master"

helm install aws-load-balancer-controller eks/aws-load-balancer-controller \
    --set clusterName=YOUR_CLUSTER_NAME \
    --set serviceAccount.create=false \
    --set region=YOUR_REGION_CODE \
    --set vpcId=<VPC_ID> \
    --set serviceAccount.name=aws-load-balancer-controller \
    -n kube-system
Run Code Online (Sandbox Code Playgroud)

我想部署我的入口配置:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/success-codes: 200,302
    alb.ingress.kubernetes.io/target-type: instance
    kubernetes.io/ingress.class: alb
  name: staging-ingress
  namespace: staging
  finalizers:
  - ingress.k8s.aws/resources
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: my-service
          servicePort: 80
        path: /api/v1/price
Run Code Online (Sandbox Code Playgroud)

一切看起来都很好。但是,当我运行以下命令来部署我的入口时:

kubectl apply -f ingress.staging.yaml -n staging
Run Code Online (Sandbox Code Playgroud)

我遇到以下错误:

Error from server (InternalError): error when creating "ingress.staging.yaml": Internal error occurred: failed calling webhook "vingress.elbv2.k8s.aws": the server could not find the requested resource
Run Code Online (Sandbox Code Playgroud)

谷歌上很少有类似的问题,没有一个对我有帮助。有什么想法吗?

K8s版本:1.18

Xun*_*Ren 5

安全组解决了我:

node_security_group_additional_rules = {
    ingress_allow_access_from_control_plane = {
      type                          = "ingress"
      protocol                      = "tcp"
      from_port                     = 9443
      to_port                       = 9443
      source_cluster_security_group = true
      description                   = "Allow access from control plane to webhook port of AWS load balancer controller"
    }
  }
Run Code Online (Sandbox Code Playgroud)