Setting CloudProvider after installation

4/14/2016

I'm using Kubernetes on AWS, and for various reasons I needed to set up the cluster myself instead of using kube-up or kube-aws. This is working fine, but now I would really like to be able to create a NodePort service and have Kubernetes use ELB for external load balancing.

Is there either a way to configure my existing Kubernetes cluster to use the AWS CloudProvider, or to manually create a new cluster with the AWS CloudProvider without using kube-up or kube-aws?

-- tbrox
kubernetes

2 Answers

4/18/2016

There are a few places where you'd need to add the --cloud-provider=aws flag to your existing cluster: all kubelets, the apiserver, and the controller manager. You may also need to configure IAM roles to ensure that the VMs can make successful calls to the cloud provider (check the errors logs for 403 responses).

-- Robert Bailey
Source: StackOverflow

1/25/2017

For RHEL7, edit the following files on the master:

  • /etc/kubernetes/config
    • Add AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  • /etc/kubernetes/apiserver
    • Add '--cloud-provider=aws' to KUBE_API_ARGS variable
  • controller-manager
    • Add '--cloud-provider=aws' to KUBE_CONTROLLER_MANAGER_ARGS

On minions, edit the following files:

  • /etc/kubernetes/config
    • Add AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  • /etc/kubernetes/kubelet
    • Add '--cloud-provider=aws' to KUBELET_ARGS
-- dustman9000
Source: StackOverflow