All Projects → nanit → eks_cli

nanit / eks_cli

Licence: other
Make EKS great again!

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to eks cli

Terraform Aws Eks
Terraform module to create an Elastic Kubernetes (EKS) cluster and associated worker instances on AWS
Stars: ✭ 2,464 (+11633.33%)
Mutual labels:  eks
awesome-aws-research
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources for Academic Researchers new to AWS
Stars: ✭ 41 (+95.24%)
Mutual labels:  eks
eks-cluster
Quickly spin up an AWS EKS Kubernetes cluster using AWS CloudFormation
Stars: ✭ 41 (+95.24%)
Mutual labels:  eks
youtube-10k-pods
10,000 Kubernetes Pods for 10,000 Subscribers
Stars: ✭ 73 (+247.62%)
Mutual labels:  eks
k8s-harbor
Harbor in Kubernetes
Stars: ✭ 36 (+71.43%)
Mutual labels:  eks
kube-tools-aws
A lightweight Docker image with various CLI tooling for working with Kubernetes.
Stars: ✭ 26 (+23.81%)
Mutual labels:  eks
Eksctl
The official CLI for Amazon EKS
Stars: ✭ 3,550 (+16804.76%)
Mutual labels:  eks
aws-eks-accelerator-for-terraform
Configure and deploy complete EKS clusters.
Stars: ✭ 1,220 (+5709.52%)
Mutual labels:  eks
Networking-and-Kubernetes
This is the code repo for Networking and Kubernetes: A Layered Approach. https://learning.oreilly.com/library/view/networking-and-kubernetes/9781492081647/
Stars: ✭ 103 (+390.48%)
Mutual labels:  eks
devops-tf-eks
terraform baked AWS kubernetes cluster (EKS) - 1.18 compatible
Stars: ✭ 16 (-23.81%)
Mutual labels:  eks
terraform-aws-eks-workers
Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers
Stars: ✭ 82 (+290.48%)
Mutual labels:  eks
kconnect
Kubernetes Connection Manager CLI
Stars: ✭ 168 (+700%)
Mutual labels:  eks
k8s-istio-webinar
Istio webinar
Stars: ✭ 18 (-14.29%)
Mutual labels:  eks
terraform-aws-eks-fargate-cluster
Source code of my AWS EKS with fargate cluster setup
Stars: ✭ 26 (+23.81%)
Mutual labels:  eks
eks-deep-dive-2019
Amazon EKS Deep Dive 2019
Stars: ✭ 61 (+190.48%)
Mutual labels:  eks
Containers Roadmap
This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
Stars: ✭ 4,132 (+19576.19%)
Mutual labels:  eks
multicloud
A multicloud demonstration presented at KubeCon 2019 EU featuring the Hipster Shop across AKS, GKE, and On-Premises
Stars: ✭ 13 (-38.1%)
Mutual labels:  eks
terraform-modules
Terraform Modules by Peak
Stars: ✭ 16 (-23.81%)
Mutual labels:  eks
django-cdk
A CDK library that provides high-level constructs for hosting Django applications on AWS
Stars: ✭ 31 (+47.62%)
Mutual labels:  eks
eks-distro-build-tooling
This repository contains tooling used to build the EKS Distro, and all the projects contained in https://github.com/aws/eks-distro.
Stars: ✭ 55 (+161.9%)
Mutual labels:  eks

EKS-CLI

EKS cluster bootstrap with batteries included

Highlights

  • Supports creation of multiple node groups of different types with communication enabled between them
  • Taint and label your nodegroups
  • Authorize IAM users for cluster access
  • Manage IAM policies that will be attached to your nodes
  • Easily configure docker repository secrets to allow pulling private images
  • Manage Route53 DNS records to point at your Kubernetes services
  • Export nodegroups to SpotInst Elastigroups
  • Auto resolving AMIs by region & instance types (GPU enabled AMIs)
  • Supports both kubernetes 1.12 and 1.13
  • Configuration is saved on S3 for easy collaboration

Usage

$ gem install eks_cli
$ eks create --kubernetes-version 1.13 --cluster-name my-eks-cluster --s3-bucket my-eks-config-bucket
$ eks create-nodegroup --cluster-name my-eks-cluster --group-name nodes --ssh-key-name <my-ssh-key> --s3-bucket my-eks-config-bucket --yes
$ eks delete-cluster --cluster-name my-eks-cluster --s3-bucket my-eks-config-bucket

You can type eks in your shell to get the full synopsis of available commands

Commands:
  eks add-iam-user IAM_ARN                                     # adds an IAM user as an authorized member on the EKS cluster
  eks create                                                   # creates a new EKS cluster
  eks create-default-storage-class                             # creates default storage class on a new k8s cluster
  eks create-dns-autoscaler                                    # creates kube dns autoscaler
  eks create-nodegroup                                         # creates all nodegroups on environment
  eks delete-cluster                                           # deletes a cluster, including nodegroups
  eks delete-nodegroup                                         # deletes cloudformation stack for nodegroup
  eks enable-gpu                                               # installs nvidia plugin as a daemonset on the cluster
  eks export-nodegroup                                         # exports nodegroup auto scaling group to spotinst
  eks help [COMMAND]                                           # Describe available commands or one specific command
  eks scale-nodegroup                                          # scales a nodegroup
  eks set-docker-registry-credentials USERNAME PASSWORD EMAIL  # sets docker registry credentials
  eks set-iam-policies --policies=one two three                # sets IAM policies to be attached to created nodegroups
  eks set-inter-vpc-networking TO_VPC_ID TO_SG_ID              # creates a vpc peering connection, sets route tables and allows network access on SG
  eks show-config                                              # print cluster configuration
  eks update-auth                                              # update aws auth configmap to allow all nodegroups to connect to control plane
  eks update-cluster-cni                                       # updates cni with warm ip target
  eks update-dns HOSTNAME K8S_SERVICE_NAME                     # alters route53 CNAME records to point to k8s service ELBs
  eks version                                                  # prints eks_cli version
  eks wait-for-cluster                                         # waits until cluster responds to HTTP requests

Options:
  c, [--cluster-name=CLUSTER_NAME]  # eks cluster name (env: EKS_CLI_CLUSTER_NAME)
  s3, [--s3-bucket=S3_BUCKET]       # s3 bucket name to save configurtaion and state (env: EKS_CLI_S3_BUCKET)

Prerequisites

  1. Ruby
  2. kubectl version >= 10 on your PATH
  3. aws-iam-authenticator on your PATH
  4. aws-cli version >= 1.16.18 on your PATH
  5. S3 bucket with write/read permissions to store configuration

Environment variables

You are encouraged to export both EKS_CLI_CLUSTER_NAME and EKS_CLI_S3_BUCKET environment variables instead of using the corresponding flags on each command. It makes the command clearer and reduces the chance for typos. The following selected commands assumes you have exported both environment variables:

export EKS_CLI_S3_BUCKET=my-eks-config-bucket
export EKS_CLI_CLUSTER_NAME=my-eks-cluster

EKS_CLI_S3_BUCKET can be safely put in your ~/.bash_profile and EKS_CLI_CLUSTER_NAME may be exported on a cluster basis

Selected Commands

Creating more than a single nodegroup

Nodegroups are created separately from the cluster.

You can use eks create-nodegroup multiple times to create several nodegroups with different instance types and number of workers. Nodes in different nodegroups may communicate freely thanks to a shared Security Group.

Scaling nodegroups

Scale nodegroups up and down using

$ eks scale-nodegroup --group-name nodes --min 1 --max 10

Authorize an IAM user to access the cluster

$ eks add-iam-user arn:aws:iam::XXXXXXXX:user/XXXXXXXX --yes

Edits aws-auth configmap and updates it on EKS to allow an IAM user access the cluster via kubectl

Setting IAM policies to be attached to EKS nodes

$ eks set-iam-policies --policies=AmazonS3FullAccess AmazonDynamoDBFullAccess

Sets IAM policies to be attached to nodegroups once created. This settings does not work retro-actively - only affects future eks create-nodegroup commands.

Routing Route53 hostnames to Kubernetes service

$ eks update-dns my-cool-service.my-company.com cool-service --route53-hosted-zone-id=XXXXX --elb-hosted-zone-id=XXXXXX

Takes the ELB endpoint from cool-service and puts it as an alias record of my-cool-service.my-company.com on Route53

Enabling GPU

$ eks enable-gpu

Installs the nvidia device plugin required to have your GPUs exposed

Assumptions:

  1. You have a nodegroup using EKS GPU AMI
  2. This nodegroup uses a GPU instance (p2.x / p3.x etc)

Adding Dockerhub Secrets

$ eks set-docker-registry-credentials <dockerhub-user> <dockerhub-password> <dockerhub-email>

Adds your dockerhub credentials as a secret and attaches it to the default ServiceAccount's imagePullSecrets

Creating Default Storage Class

$ eks create-default-storage-class

Creates a standard gp2 default storage class named gp2

Installing DNS autoscaler

$ eks create-dns-autoscaler

Creates coredns autoscaler with production defaults

Connecting to an existing VPC

$ eks set-inter-vpc-networking VPC_ID SG_ID

Assuming you have some shared resources on another VPC (an RDS instance for example), this command opens communication between your new EKS cluster and your old VPC:

  1. Creating and accepting a VPC peering connection from your EKS cluster VPC to the old VPC
  2. Setting route tables on both directions to allow communication
  3. Adding an ingress rule to SG_ID to accept all communication from your new cluster nodes.

Exporting nodegroups to Spotinst

$ eks export-nodegroup --group-name=other-nodes

Exports the corresponding Auto Scaling Group to a Spotinst Elastigroup

Requires the following environment variables to be set:

  • SPOTINST_ACCOUNT_ID
  • SPOTINST_API_TOKEN

Contributing

Is more than welcome! ;)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].