<p>I am trying to setup Kubernetes on AWS EC2 there are writeups from this website which is wonderful</p>

<p><a href="https://itnext.io/kubernetes-part-2-a-cluster-set-up-on-aws-with-aws-cloud-provider-and-aws-loadbalancer-f02c3509f2c2" rel="nofollow noreferrer">https://itnext.io/kubernetes-part-2-a-cluster-set-up-on-aws-with-aws-cloud-provider-and-aws-loadbalancer-f02c3509f2c2</a></p>

<p>I used the following config file for "kubeadm init"</p>

<pre><code>apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
apiServer:
  extraArgs:
    cloud-provider: "aws"
controllerManager:
  extraArgs:
    cloud-provider: "aws"
</code></pre>

<p>I got an error message saying that aws has been depreciated </p>

<p>I used the same file with the cloud-provider changed to "openstack"</p>

<p>Still I am getting errors; looks like the new version of Kubernetes I need to use another parameter "cloud-config" which has the configuration</p>

<p>Can anyone help me on how this needs to be done and how I can successfully configure a k8 cluster using EC2.</p>

DataGuru
<p>Referring from <a href="https://kubernetes.io/docs/concepts/cluster-administration/cloud-providers/" rel="nofollow noreferrer">here</a> You can use below config for AWS.</p>

<pre><code>apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
nodeRegistration:
  kubeletExtraArgs:
    cloud-provider: "openstack"
    cloud-config: "/etc/kubernetes/cloud.conf"
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
kubernetesVersion: v1.13.0
apiServer:
  extraArgs:
    cloud-provider: "openstack"
    cloud-config: "/etc/kubernetes/cloud.conf"
  extraVolumes:
  - name: cloud
    hostPath: "/etc/kubernetes/cloud.conf"
    mountPath: "/etc/kubernetes/cloud.conf"
controllerManager:
  extraArgs:
    cloud-provider: "openstack"
    cloud-config: "/etc/kubernetes/cloud.conf"
  extraVolumes:
  - name: cloud
    hostPath: "/etc/kubernetes/cloud.conf"
    mountPath: "/etc/kubernetes/cloud.conf
</code></pre>

<p>And then you can do <code>kubeadm init --config=kubeadm-config.yml</code></p>

<p><a href="https://kubernetes.io/blog/2020/02/07/deploying-external-openstack-cloud-provider-with-kubeadm/" rel="nofollow noreferrer">https://kubernetes.io/blog/2020/02/07/deploying-external-openstack-cloud-provider-with-kubeadm/</a></p>

<p>You could avoid all of these if you just used <a href="https://github.com/kubernetes/kops" rel="nofollow noreferrer">Kops</a> to install kubernetes on AWS.</p>
