【问题标题】:AWS EKS Guestbook url not accessibleAWS EKS 留言簿 URL 无法访问
【发布时间】:2020-11-17 01:53:45
【问题描述】:

我在 Win10 上使用 cygwin 和其他一些 choco 东西,一切都已安装并运行良好。我能够安装和运行 ecs-cli 和 fargate 教程中的东西,也可以编写。

现在我正在尝试 EKS,并从此处的 ekstcl 入门设置集群和留言簿: https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html

然后在此处设置集群后: https://docs.aws.amazon.com/eks/latest/userguide/eks-guestbook.html

我创建了 AWS Fargate-only 集群。 我只是一步一步地跟随,最后当我在浏览器中打开 url 时显示

This page isn’t working
a8b3bb2e121f511ea82cb1294ea943ee-1408939369.us-east-1.elb.amazonaws.com didn’t send any data.
ERR_EMPTY_RESPONSE

一步一步:

$ eksctl version
[ℹ]  version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.11.1"}

$ eksctl create cluster --name eks-snafu --version 1.14 --region us-east-1 --fargate
[ℹ]  eksctl version 0.11.1
[ℹ]  using region us-east-1
[ℹ]  setting availability zones to [us-east-1f us-east-1b]
[ℹ]  subnets for us-east-1f - public:192.168.0.0/19 private:192.168.64.0/19
[ℹ]  subnets for us-east-1b - public:192.168.32.0/19 private:192.168.96.0/19
[ℹ]  using Kubernetes version 1.14
[ℹ]  creating EKS cluster "eks-snafu" in "us-east-1" region with Fargate profile
[ℹ]  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-east-1 --cluster=eks-snafu'
[ℹ]  CloudWatch logging will not be enabled for cluster "eks-snafu" in "us-east-1"
[ℹ]  you can enable it with 'eksctl utils update-cluster-logging --region=us-east-1 --cluster=eks-snafu'
[ℹ]  Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "eks-snafu" in "us-east-1"
[ℹ]  1 task: { create cluster control plane "eks-snafu" }
[ℹ]  building cluster stack "eksctl-eks-snafu-cluster"
[ℹ]  deploying stack "eksctl-eks-snafu-cluster"
[✔]  all EKS cluster resources for "eks-snafu" have been created
[✔]  saved kubeconfig as "<MY WIN HOME>/.kube/config"
[ℹ]  creating Fargate profile "fp-default" on EKS cluster "eks-snafu"
[ℹ]  created Fargate profile "fp-default" on EKS cluster "eks-snafu"
[ℹ]  "coredns" is now schedulable onto Fargate
[ℹ]  "coredns" is now scheduled onto Fargate
[ℹ]  "coredns" pods are now scheduled onto Fargate
[ℹ]  kubectl command should work with "<MY WIN HOME>/.kube/config", try 'kubectl get nodes'
[✔]  EKS cluster "eks-snafu" in "us-east-1" region is ready

$ kubectl get svc -o wide
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE    SELECTOR
kubernetes   ClusterIP   10.100.0.1   <none>        443/TCP   7m7s   <none>

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/redis-master-controller.json
replicationcontroller/redis-master created

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/redis-master-service.json
service/redis-master created

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/redis-slave-controller.json
replicationcontroller/redis-slave created

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/redis-slave-service.json
service/redis-slave created

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/guestbook-controller.json
replicationcontroller/guestbook created

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/guestbook-service.json
service/guestbook created

$ kubectl get services -o wide
NAME           TYPE           CLUSTER-IP       EXTERNAL-IP                                                               PORT(S)          AGE   SELECTOR
guestbook      LoadBalancer   10.100.201.159   a8b3bb2e121f511ea82cb1294ea943ee-1408939369.us-east-1.elb.amazonaws.com   3000:32600/TCP   12s   app=guestbook
kubernetes     ClusterIP      10.100.0.1       <none>                                                                    443/TCP          14m   <none>
redis-master   ClusterIP      10.100.133.248   <none>                                                                    6379/TCP         43s   app=redis,role=master
redis-slave    ClusterIP      10.100.198.154   <none>                                                                    6379/TCP         26s   app=redis,role=slave

现在我打开这个: http://a8b3bb2e121f511ea82cb1294ea943ee-1408939369.us-east-1.elb.amazonaws.com:3000

什么也得不到:(

我做错了什么?

【问题讨论】:

    标签: amazon-web-services amazon-eks aws-fargate


    【解决方案1】:

    你没有做错任何事。但是,在 Fargate 上使用 EKS 时,您必须consider 某些事情。这包括在撰写本文时仅支持 ALB。留言簿示例 ​​uses 服务类型 LoadBalancer,导致创建经典负载均衡器,即 ATM,在 Fargate 上的 EKS 中不支持。

    【讨论】:

    • 谢谢迈克尔!运行此示例需要做什么建议?我对这些东西很陌生,还有很多东西要学。
    • 不幸的是,除非您使用 Ingress 资源,否则此示例将不起作用。我建议你从 hub.helm.sh 中挑选一些东西(不使用 CLB 或持久卷)。
    【解决方案2】:

    Michael Hausenblas 是正确的:留言簿示例不适用于 Fargate 集群。

    要设置仅限 Linux 的集群,您可以按照链接页面 (https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html) 中的说明进行操作。当您进入“创建您的 Amazon EKS 集群和工作程序节点”时,只需选择“仅包含 Linux 工作负载的集群”而不是“仅 AWS Fargate 集群”。为了方便,我复制了下面的命令。

    eksctl 创建集群 \

    --产品名称 \

    --区域区域代码\

    --nodegroup-name 标准工作者 \

    --节点类型 t3.medium \

    --节点 3 \

    --nodes-min 1 \

    --nodes-max 4 \

    --ssh-访问 \

    --ssh-public-key my-public-key.pub \

    --托管

    附:意识到这个问题是几个月前的问题,并被标记为已接受,但我遇到了同样的问题,并且认为其他初学者可能需要更明确的说明。

    附言这可能作为评论更好,但我还没有足够的声誉来评论!

    【讨论】:

      猜你喜欢
      • 2021-03-15
      • 1970-01-01
      • 2015-12-07
      • 1970-01-01
      • 2021-10-16
      • 2021-12-22
      • 2020-09-27
      • 2020-08-06
      • 2019-05-03
      相关资源
      最近更新 更多