jx create cluster eks

Created on 23 Aug 2018  路  11Comments  路  Source: jenkins-x/jx

Summary

When I do a jx create cluster eks it fails and I end up with the below error message

Steps to reproduce the behavior

jx create cluster eks

Jx version

The output of jx version is:

Failed to find helm installs: failed to run 'helm list' command in directory '', output: 'Error: Get http://localhost:8080/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: dial tcp 127.0.0.1:8080: connect: connection refused': exit status 1
Failed to connect to kubernetes: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
Failed to get kubectl version: Command failed 'kubectl version --short': Client Version: v1.11.2
The connection to the server localhost:8080 was refused - did you specify the right host or port? exit status 1

Failed to get helm version: failed to run 'helm version --short' command in directory '', output: 'Client: v2.10.0+g9ad53aa
Error: Get http://localhost:8080/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: dial tcp 127.0.0.1:8080: connect: connection refused': exit status 1
NAME VERSION
jx   1.3.179
git  git version 2.7.4

A new jx version is available: 1.3.190
? Would you like to upgrade to the new jx version? [? for help] (Y/n)

Kubernetes cluster

What kind of Kubernetes cluster are you using & how did you create it?
EKS with jx create cluster eks

Operating system / Environment

Ubuntu

Expected behavior

Cluster should be created with no errors

Actual behavior

It fails with the error below

eksctl not found
heptio-authenticator-aws not found
kubectl not found
helm not found
? Missing required dependencies, deselect to avoid auto installing: eksctl, heptio-authenticator-aws, kubectl, helm
Downloading https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_Linux_amd64.tar.gz to /home/ubuntu/.jx/bin/eksctl.tar.gz...
Downloaded /home/ubuntu/.jx/bin/eksctl.tar.gz
Downloading https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-06-05/bin/linux/amd64/heptio-authenticator-aws to /home/ubuntu/.jx/bin/heptio-authenticator-aws...
Downloaded /home/ubuntu/.jx/bin/heptio-authenticator-aws
Downloading https://storage.googleapis.com/kubernetes-release/release/v1.11.2/bin/linux/amd64/kubectl to /home/ubuntu/.jx/bin/kubectl.tmp...
Downloaded /home/ubuntu/.jx/bin/kubectl.tmp
Downloading https://storage.googleapis.com/kubernetes-helm/helm-v2.10.0-linux-amd64.tar.gz to /home/ubuntu/.jx/bin/helm.tgz...
Downloaded /home/ubuntu/.jx/bin/helm.tgz
Creating EKS cluster - this can take a while so please be patient...
You can watch progress in the CloudFormation console: https://console.aws.amazon.com/cloudformation/

running command: eksctl create cluster --full-ecr-access --region us-west-2 --aws-api-timeout 20m0s
2018-08-23T20:47:52Z [鈩筣  setting availability zones to [us-west-2c us-west-2a us-west-2b]
2018-08-23T20:47:52Z [鉁朷  error decoding SSH public key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq6L7oPTMnD8d5j9akutP\nP+s+l9HrSjmZckkDtd2IdcOvMs6dPqjPo5AqkBJrMqMr+4uzpOO2eKOcpJrsE3R4\nVYFqLIQP9QU9W1TcIw3OBXljVVJObTvi5wN7T7py2wm68hojnPonpW0aEls1Jvf1\n-----END PUBLIC KEY-----\n" err: illegal base64 data at input byte 4
Error: Command failed  eksctl create cluster --full-ecr-access --region us-west-2 --aws-api-timeout 20m0s
error: exit status 1

Most helpful comment

I got the same error I was able to resolve it by adding
export PATH=$PATH:~/.jx/bin/

All 11 comments

So the problem is with the execution of eksctl create cluster --full-ecr-access --region us-west-2 --aws-api-timeout command. It looks like it is a problem with eksctl which for some reasons cannot upload your public SSH key.

For your information - jx EKS support works on my Fedora 28.

Are you sure your public SSH key is OK? Maybe you could generate new key for a test and verify if eksctl still generates the same error?

@hekonsek, thanks for your help! My SSH key is OK. I tried using a new one, and still encounter this error when I run jx create cluster eks:

Creating EKS cluster - this can take a while so please be patient...
You can watch progress in the CloudFormation console: https://console.aws.amazon.com/cloudformation/

running command: eksctl create cluster --full-ecr-access --region us-west-2 --aws-api-timeout 20m0s
Error: Command failed  eksctl create cluster --full-ecr-access --region us-west-2 --aws-api-timeout 20m0s
error: exec: "eksctl": executable file not found in $PATH

Anyone have any ideas?

@hekonsek, To give you further background, I have set up JenkinsX on an Ubuntu EC2 instance.
1) I created a Key Pair named "foo" in the EC2 dashboard
2) I then saved and renamed the foo.pem file as id_rsa.pem in the ~/.ssh directory of the Ubuntu instance.
3) I run openssl rsa -check -in id_rsa.pem -noout to check that the RSA key has not been corrupted in anyway and is working fine. It returns RSA key ok.
4) I then run openssl rsa -in id_rsa.pem -pubout > id_rsa.pub to get create the public key from the pem file and save it also in the ~/.ssh directory

Anyone see anything that I have mentioned, that I am doing wrong? Thanks!

Can you try to generate key pair using the following command - ssh-keygen -t rsa -b 4096 -C "[email protected]"? And then run eksctl again? If that works successfully then we know that the issue is one of these two:

  • way you generate your key from PEM file
  • eksctl which cannot read your key

I bet it is the latter. :)

@hekonsek I followed your instructions and this is my output:

ubuntu@ip-172-01-09-606:~$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubuntu/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ubuntu/.ssh/id_rsa.
Your public key has been saved in /home/ubuntu/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Pt3e3HrzU8J5wYA9lGOa89xkzxsDOLT [email protected]
The key's randomart image is:
+---[RSA 4096]----+
|            +..  |
|        .  o.B.  |
|         +.o*o=  |
|        o .B=..= |
|        S. o*o*+o|
|       .E. . ++B*|
|        o . . +o*|
|         . . o *.|
|            . +o*|
+----[SHA256]-----+
ubuntu@ip-172-01-09-606:~$ jx create cluster eks
Creating EKS cluster - this can take a while so please be patient...
You can watch progress in the CloudFormation console: https://console.aws.amazon.com/cloudformation/

running command: eksctl create cluster --full-ecr-access --region us-west-2 --aws-api-timeout 20m0s
Error: Command failed  eksctl create cluster --full-ecr-access --region us-west-2 --aws-api-timeout 20m0s
error: exec: "eksctl": executable file not found in $PATH

Any ideas? Thanks.

Can you send me output of which eksctl command?

From the home directory, which eksctl returns nothing.

Can you remove ~/.jx directory and try again?

After removing the ~/.jx directory, and trying again, which eksctl still returns nothing.

I got the same error I was able to resolve it by adding
export PATH=$PATH:~/.jx/bin/

@vishalraina Thanks! That resolved my issue!

Was this page helpful?
0 / 5 - 0 ratings