AWS云提供商上的Kubernetes [英] Kubernetes on AWS cloud provider

查看:117
本文介绍了AWS云提供商上的Kubernetes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWS上安装了CentOS Atomic Host作为kubernetes的操作系统.

I installed CentOS Atomic Host as operating system for kubernetes on AWS.

一切正常,但似乎我错过了一些东西.

Everything works fine, but it seems I missed something.

我没有配置云提供商,也找不到关于它的任何文档.

I did not configure cloud provider and can not find any documentation on that.

在这个问题上,我想知道: 1.云提供商为kubernetes提供了哪些功能? 2.如何配置AWS云提供商?

In this question I want to know: 1. What features cloud provider gives to kubernetes? 2. How to configure AWS cloud provider?

UPD 1 :外部负载均衡器不起作用;我尚未测试awsElasticBlockStore,但我也怀疑它不起作用.

UPD 1: external load balancer does not work; I have not tested awsElasticBlockStore yet, but I also suspect it does not work.

UPD 2 : 服务详情:

$ kubectl get svc nginx-service-aws-lb -o yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: 2016-01-02T09:51:40Z
  name: nginx-service-aws-lb
  namespace: default
  resourceVersion: "74153"
  selfLink: /api/v1/namespaces/default/services/nginx-service-aws-lb
  uid: 6c28b718-b136-11e5-9bda-06c2feb29b0d
spec:
  clusterIP: 10.254.172.185
  ports:
  - name: http-proxy-protocol
    nodePort: 31385
    port: 8080
    protocol: TCP
    targetPort: 8080
  - name: https-proxy-protocol
    nodePort: 31370
    port: 8443
    protocol: TCP
    targetPort: 8443
  selector:
    app: nginx
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer: {}

推荐答案

我无法与ProjectAtomic位对话,也无法与KUBERNETES_PROVIDER env-var对话,因为我的经验是与CoreOS供应商合作.我将谈论我的经验,看看是否能帮助您进一步了解设置.

I can't speak to the ProjectAtomic bits, nor to the KUBERNETES_PROVIDER env-var, since my experience has been with the CoreOS provisioner. I will talk about my experiences and see if that helps you dig a little more into your setup.

首先,绝对重要的是控制器EC2和辅助EC2机器必须具有正确的

Foremost, it is absolutely essential that the controller EC2 and the worker EC2 machines have the correct IAM role that will enable the machines to make AWS calls on behalf of your account. This includes things like provisioning ELBs and working with EBS Volumes (or attaching an EBS Volume to themselves, in the case of the worker). Without that, your cloud-config experience will go nowhere. I'm pretty sure the IAM payloads are defined somewhere other than those .go files, which are hard to read, but that's the quickest link I had handy to show what's needed.

幸运的是,这个问题的答案以及我将要谈论的答案都围绕着apiservercontroller-manager.它们的配置以及它们输出的日志.

Fortunately, the answer to that question, and the one I'm about to talk about, are both centered around the apiserver and the controller-manager. The configuration of them and the logs they output.

apiserver

Both the apiserver and the controller-manager have an argument that points to an on-disk cloud configuration file that regrettably isn't documented anywhere except for the source. That Zone field is, in my experience, optional (just like they say in the comments). However, it was seeing the KubernetesClusterTag that led me to follow that field around in the code to see what it does.

如果您的经历像我的一样,您会在controller-manager的docker日志中看到一堆关于如何创建ELB的错误消息,但找不到要附加到其上的任何子网; (当然,"docker logs"位是推测,ProjectAtomic也使用docker运行Kubernetes守护程序.)

If your experience is anything like mine, you'll see in the docker logs of the controller-manager a bunch of error messages about how it created the ELB but could not find any subnets to attach to it; (that "docker logs" bit is presuming, of course, that ProjectAtomic also uses docker to run the Kubernetes daemons).

一旦我附加了一个名为KubernetesClusterTag并将Tag的每个实例设置为相同的字符串(可以是AFAIK,可以是任何东西),则aws_loadbalancer能够在VPC中找到该子网.并且将节点附加到ELB上,一切都很酷-除了有关它的部分,现在只能创建面向Internet的 ELB. :-(

Once I attached a Tag named KubernetesCluster and set every instance of the Tag to the same string (it can be anything, AFAIK), then the aws_loadbalancer was able to find the subnet in the VPC and it attached the Nodes to the ELB and everything was cool -- except for the part about it can only create Internet facing ELBs, right now. :-(

为清楚起见:aws.cfg包含一个名为KubernetesClusterTag的字段,可用于重新定义 Kubernetes将查找的Tag. 该文件中没有任何值,Kuberenetes将使用Tag名称KubernetesCluster.

Just for clarity: the aws.cfg contains a field named KubernetesClusterTag that allows you to redefine the Tag that Kubernetes will look for; without any value in that file, Kuberenetes will use the Tag name KubernetesCluster.

我希望这对您有所帮助,也希望对其他人有所帮助,因为一旦Kubernetes启动,它绝对令人惊叹.

I hope this helps you and I hope it helps others, because once Kubernetes is up, it's absolutely amazing.

这篇关于AWS云提供商上的Kubernetes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆