geerlingguy/ansible-role-kubernetes

Configure K8 with Cloud Provider

zeknox opened this issue · 1 comments

Thanks for this wonderful playbook. It works great for getting a cluster up and operational. I'm wondering if it's possible in the current playbook implementation to configure the cluster to work with a specific cloud provider like GCP or AWS?

Currently I run into conditions where K8 is unable to provision EBS volumes and other AWS resources even though the proper IAM permissions seemed to be applied to the EC2 instance.

Similar situation: https://stackoverflow.com/questions/56064860/failed-to-get-aws-cloud-provider-getcloudprovider-returned-nil-instead

Here is a specific example of the error encountered when attempting to create a Persistent Volume via AWS EBS.

Deployed K8 Storage Class:

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: ssd
annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2
encrypted: "true"
fsType: "xfs"
reclaimPolicy: Delete
allowVolumeExpansion: true

K8 Error displayed when describing the PVC

Warning ProvisioningFailed 2m9s (x11 over 10m) persistentvolume-controller Failed to provision volume with StorageClass "ssd": Failed to get AWS Cloud Provider. GetCloudProvider returned instead

Any insight on how I might accomplish this using the playbook?

@zeknox - Unfortunately that's something that something a little outside the scope of this role—for setups on AWS or GKE, I sometimes recommend kubespray, other times EKS/GKS, just because the little details are worked out.

For your particular case, though, you might just need to modify the kubelet flags—see https://stackoverflow.com/a/56065210/100134