无法访问AWS EKS Guestbook网址

时间:2019-12-19 00:51:22

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

我在使用cygwin和其他choco东西的Win10上,一切都已安装并且运行正常。我能够安装和运行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的集群。 当我在浏览器中打开显示

的网址时,我将一步一步地进行操作,最后
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

一无所获:(

我在做什么错了?

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:1)

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-access \

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

-托管

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

P.S.S。作为评论可能会更好,但是我没有足够的声誉来发表评论!