简体   繁体   English

AWS上的kubernetes guesbook示例

[英]kubernetes guesbook example on aws

I'm trying to run through the kubernetes example in AWS. 我正在尝试通过AWS中的kubernetes示例运行。 I created the master and 4 nodes with the kube-up.sh script and trying to get the frontend exposed via a load balancer. 我使用kube-up.sh脚本创建了主节点和4个节点,并尝试通过负载均衡器公开前端。

Here are the pods 这是豆荚

root@ip-172-20-0-9:~/kubernetes# kubectl get pods
NAME                 READY     STATUS    RESTARTS   AGE
frontend-2q0at       1/1       Running   0          5m
frontend-5hmxq       1/1       Running   0          5m
frontend-s7i0r       1/1       Running   0          5m
redis-master-y6160   1/1       Running   0          53m
redis-slave-49gya    1/1       Running   0          24m
redis-slave-85u1r    1/1       Running   0          24m

Here are the services 这是服务

root@ip-172-20-0-9:~/kubernetes# kubectl get services
NAME           CLUSTER_IP    EXTERNAL_IP   PORT(S)    SELECTOR            AGE
kubernetes     10.0.0.1      <none>        443/TCP    <none>              1h
redis-master   10.0.90.210   <none>        6379/TCP   name=redis-master   37m
redis-slave    10.0.205.92   <none>        6379/TCP   name=redis-slave    24m

I edited the yml for the frontend service to try to add a load balancer but its not showing up 我为前端服务编辑了yml,以尝试添加负载均衡器,但未显示

root@ip-172-20-0-9:~/kubernetes# cat examples/guestbook/frontend-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: frontend
  labels:
    name: frontend
spec:
  # if your cluster supports it, uncomment the following to automatically create
  # an external load-balanced IP for the frontend service.
  type: LoadBalancer
  ports:
    # the port that this service should serve on
    - port: 80
  selector:
    name: frontend

Here the commands i ran 我在这里运行的命令

root@ip-172-20-0-9:~/kubernetes# kubectl create -f examples/guestbook/frontend-controller.yaml
replicationcontroller "frontend" created
root@ip-172-20-0-9:~/kubernetes# kubectl get services
NAME           CLUSTER_IP    EXTERNAL_IP   PORT(S)    SELECTOR            AGE
kubernetes     10.0.0.1      <none>        443/TCP    <none>              1h
redis-master   10.0.90.210   <none>        6379/TCP   name=redis-master   39m
redis-slave    10.0.205.92   <none>        6379/TCP   name=redis-slave    26m

If I remove the loadbalancer it loads up but with no external IP 如果我卸下负载均衡器,它将加载但没有外部IP

Looks like the external IP might only be there for Google's platform. 看起来外部IP可能仅适用于Google的平台。 in AWS it creates a ELB and doesn't show the external IP of the ELB. 在AWS中,它会创建一个ELB,而不显示ELB的外部IP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM