I am trying to setup Kubernetes on AWS EC2 there are writeups from this website which is wonderful
I used the following config file for "kubeadm init"
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
apiServer:
extraArgs:
cloud-provider: "aws"
controllerManager:
extraArgs:
cloud-provider: "aws"
I got an error message saying that aws has been depreciated
I used the same file with the cloud-provider changed to "openstack"
Still I am getting errors; looks like the new version of Kubernetes I need to use another parameter "cloud-config" which has the configuration
Can anyone help me on how this needs to be done and how I can successfully configure a k8 cluster using EC2.
Based on the suggestion provided I installed the Kubernetes cluster using kops. The Full instructions can be found here
Referring from here You can use below config for AWS.
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
And then you can do kubeadm init --config=kubeadm-config.yml
https://kubernetes.io/blog/2020/02/07/deploying-external-openstack-cloud-provider-with-kubeadm/
You could avoid all of these if you just used Kops to install kubernetes on AWS.