Kops: unable to infer CloudProvider from Zones (is there a typo in --zones?)

Created on 7 Nov 2017  路  1Comment  路  Source: kubernetes/kops

What kops version are you running? use kops version

drpaneas@localhost:~> kops version
Version 1.7.1 (git-c69b811)

What Kubernetes version are you running? use kubectl version

drpaneas@localhost:~> kubectl --version
Kubernetes v1.7.7

What cloud provider are you using?

Amazon AWS

What commands did you execute (Please provide cluster manifest kops get --name my.example.com, if available) and what happened after commands executed?

kops create cluster --name=sinefaki.de --state=s3://kops-state-djh3 --zones=eu-central-1 --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=sinefaki.de
What you expected to happen:

To deploy a kubernetes cluster, with 1 master and 2 workers.

How can we to reproduce it (as minimally and precisely as possible):

  1. Create an account to amazon AWS.
  2. Go to AWS and create a user for kops, generate the keys and give the appropriate permissions:

Go to: Security, Identity & Compliance > IAM (Identity Access Management)
Go to: Users (from the left column) and click Add user: username: kops
You also need to generate an access key for both:

[x] Programmatic Access
[x] AWS Management Console Access

The kops user will require the following IAM permissions to function properly: Either give to our user: AdministratorAccess as the attached policy or if you are kind of concerned about giving all the permissions for free you can also give less:

    AmazonRoute53FullAccess
    AmazonS3FullAccess
    IAMFullAccess
    AmazonVPCFullAccess
  1. Configure your local aws-cli

Come back to the command line and configure aws-cli

drpaneas@localhost:~/Downloads> aws configure
AWS Access Key ID [None]: <YOURKEY>
AWS Secret Access Key [None]: <YOURSECRET>
Default region name [None]:   <--- not necessarry but I can use mine: eu-central-1 (this is for Frankfurt)
Default output format [None]: <--- not necessarry (you can use either 'json' or 'text')
  1. Create a S3 Bucket
    Click on the button Create Bucket. Here's my configuration:
Bucket Name: kops-state-djh3  (just a random string -- makes sure it's unique in Amazon in that region)
Region: EU (Frankfurt) <-- the region where you are going to deploy the cluster.
  1. Create DNS with Route 53

Next thing is the DNS. kops will setup the DNS but we need a domain. Let's use Route 53 for that.
Go to: Networking & Content Delivery > Route 53

There I bought a new domain, and it gets your Hosted Zone configured automatically with the appropriate NS and SOA. You can use your own, but make sure you provide the amazon's NS in your domain registrar.

  1. Make sure that your aws-cli credentials are correct

Try to execute: aws ec2 describe-regions

This worked and it returned a JSON with all the available zones.

  1. Then try to deploy a k8s cluster:

kops create cluster --name=sinefaki.de --state=s3://kops-state-djh3 --zones=eu-central-1 --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=sinefaki.de

It fails with:
unable to infer CloudProvider from Zones (is there a typo in --zones?)

Most helpful comment

My bad, I've just had to use the full zone and not just the region name.

e.g.

kops create cluster --name=sinefaki.de --state=s3://kops-state-djh3 --zones=eu-central-1a --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=sinefaki.de

to find your full zone name for your region:
aws ec2 describe-availability-zones --region eu-central-1

The k8s deployment works fine. I am closing this issue.

>All comments

My bad, I've just had to use the full zone and not just the region name.

e.g.

kops create cluster --name=sinefaki.de --state=s3://kops-state-djh3 --zones=eu-central-1a --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=sinefaki.de

to find your full zone name for your region:
aws ec2 describe-availability-zones --region eu-central-1

The k8s deployment works fine. I am closing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yetanotherchris picture yetanotherchris  路  3Comments

rot26 picture rot26  路  5Comments

chrislovecnm picture chrislovecnm  路  3Comments

DocValerian picture DocValerian  路  4Comments

chrislovecnm picture chrislovecnm  路  3Comments