Creating a Kubernetes cluster using the AWS CLI and eksctl
Creating an AWS Kubernetes Cluster
Bunnyshell makes it easy to connect an AWS EKS cluster to your Organization, deploy your application on it, and manage environments.
1. Install the AWS CLI. Instructions on how to do that are available on the AWS documentation website.
You can configure the AWS CLI using the aws configure command.
2. Install eksctl. Read more on how you can do this on the eksctl website.
3. Create a cluster definition yaml file by following the instructions provided in this documentation.
4. Connect your kubectl by downloading the config from AWS using the following command:
aws eks update-kubeconfig --region region-code --name cluster-nameReplace the region-code and cluster-name with the newly created clusters details.
5. By default the configuration will be downloaded to ~/.kube/config-file-name. View this file and extract the relevant information provided below:
When connecting the cluster to Bunnyshell, you have to provide the following credentials:
Cluster name
AWS Cluster name
Cluster URL
Certificate
Access Key ID and Secret Access Key
AWS Cluster name: Corresponds to the name of the cluster . Do not add the subdomains added in the config file.
Cluster URL: Corresponds to the
serverkey in the below example.
Certificate: Corresponds to the
certificate-authority-datain the below example.
Access Key ID and Secret Access Key: These two credentials are needed to programmatically obtain a token for cluster access. These can be found in the
~/.aws/credentialsfile after you have run theaws configurecommand suggested earlier.
You might face the following error on Step 2 while creating the cluster:
Unable to connect to the server: getting credentials: exec plugin is configured to use API version client.authentication.k8s.io/v1alpha1, plugin returned version client.authentication.k8s.io/v1beta1.
In such cases, you can install the AWS EKS vended kubectl (linked here), then run the command cat ~/.kube/config and update the API version line respectively.
Last updated
Was this helpful?
