<p>I installed CentOS Atomic Host as operating system for kubernetes on AWS.</p>

<p>Everything works fine, but it seems I missed something.</p>

<p>I did not configure cloud provider and can not find any documentation on that.</p>

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

<p><strong>UPD 1</strong>: external load balancer does not work; I have not tested <code>awsElasticBlockStore</code> yet, but I also suspect it does not work.</p>

<p><strong>UPD 2</strong>:
Service details:</p>

<pre><code>$ 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: {}
</code></pre>

<p>I can't speak to the ProjectAtomic bits, nor to the <code>KUBERNETES_PROVIDER</code> 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.</p>

<p>Foremost, it is absolutely essential that the controller EC2 and the worker EC2 machines have the correct <a href="https://github.com/coreos/coreos-kubernetes/blob/11e75bf/multi-node/aws/pkg/cluster/stack_template.go#L346" rel="noreferrer">IAM role</a> 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 <code>.go</code> files, which are hard to read, but that's the quickest link I had handy to show what's needed.</p>

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

<p>Both the <a href="https://github.com/coreos/coreos-kubernetes/blob/adcbe533/multi-node/aws/artifacts/manifests/controller/kube-apiserver.yaml#L26" rel="noreferrer">apiserver</a> and the <a href="https://github.com/coreos/coreos-kubernetes/blob/adcbe533/multi-node/aws/artifacts/manifests/controller/kube-controller-manager.yaml#L16" rel="noreferrer">controller-manager</a> have an argument that points to an on-disk cloud configuration file that regrettably isn't documented anywhere except for <a href="https://github.com/kubernetes/kubernetes/blob/v1.1.5/pkg/cloudprovider/providers/aws/aws.go#L192" rel="noreferrer">the source</a>. That <code>Zone</code> field is, in my experience, optional (just like they say in the comments). However, it was seeing the <code>KubernetesClusterTag</code> that led me to follow that field around in the code to see what it does.</p>

<p>If your experience is anything like mine, you'll see in the docker logs of the <code>controller-manager</code> 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).</p>

<p>Once I attached a <code>Tag</code> named <code>KubernetesCluster</code> and set every instance of the <code>Tag</code> to the same string (it can be anything, AFAIK), then the <code>aws_loadbalancer</code> 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 <em>Internet facing</em> ELBs, right now. :-(</p>

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

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