eks_cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/README.md +34 -4
- data/eks_cli.gemspec +2 -1
- data/lib/eks_cli/cli.rb +20 -3
- data/lib/eks_cli/version.rb +3 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78d1ac1a9a28a095b8364a99e2c6025bbdf82aab
|
4
|
+
data.tar.gz: cd3872bd0c7b043af27f5158a6459f5b3c168026
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4286725d3526103ed2373364391b2f759ea2d7b0bf74768b42f8c67796b7332d211d8c9382162edd689225fad2b8d369088d1bf73ccb5cdce2f54b7ece5bb648
|
7
|
+
data.tar.gz: 132517e6b5e8cb935faad6da978d5f52a2ac9216b367c792862be202c2a7f12ef179daa1c9cb4c0b847b59f33afc9d659ed2f01c15de4ad0de54b311b99d7880
|
data/.gitignore
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
*.gem
|
data/README.md
CHANGED
@@ -2,18 +2,33 @@
|
|
2
2
|
|
3
3
|
EKS cluster bootstrap with batteries included
|
4
4
|
|
5
|
+
## Highlights
|
6
|
+
|
7
|
+
* Supports creation of various node groups of different types with communication between them
|
8
|
+
* Taint and label your nodegroups
|
9
|
+
* Manage IAM policies that will be attached to your nodes
|
10
|
+
* Easily configure docker repository secrets to allow pulling private images
|
11
|
+
* Manage Route53 DNS records to point at your Kubernetes services
|
12
|
+
* Even more...
|
13
|
+
|
5
14
|
## Usage
|
6
15
|
|
7
16
|
```
|
8
17
|
$ gem install eks_cli
|
9
|
-
$ eks
|
10
|
-
$ eks create-cluster-vpc --cluster-name=My-EKS-Cluster
|
11
|
-
$ eks create-cluster-security-group --cluster-name My-EKS-Cluster --open-ports=22
|
18
|
+
$ eks create us-west-2 --cluster-name=My-EKS-Cluster
|
12
19
|
$ eks create-nodegroup --cluster-name My-EKS-Cluster --group-name nodes --ssh-key-name my-ssh-key --min 1 --max 3
|
13
20
|
$ eks create-nodegroup --cluster-name My-EKS-Cluster --group-name other-nodes --ssh-key-name my-ssh-key --min 3 --max 3 --instance-type m5.2xlarge
|
14
21
|
$ eks create-nodegroup --all --cluster-name My-EKS-Cluster --yes
|
15
22
|
```
|
16
23
|
|
24
|
+
You can type `eks` in your shell to get the full synopsys of available commands
|
25
|
+
|
26
|
+
## Prerequisite
|
27
|
+
|
28
|
+
1. Ruby
|
29
|
+
2. `kubectl` with version > 10 on your `PATH`
|
30
|
+
3. `aws-iam-authenticator` on your `PATH`
|
31
|
+
|
17
32
|
## Extra Stuff
|
18
33
|
|
19
34
|
### Setting IAM policies to be attached to EKS nodes
|
@@ -41,7 +56,7 @@ Installs the nvidia device plugin required to have your GPUs exposed
|
|
41
56
|
|
42
57
|
### Adding Dockerhub Secrets
|
43
58
|
|
44
|
-
`$ eks set-docker-registry-credentials <dockerhub-user> <dockerhub-
|
59
|
+
`$ eks set-docker-registry-credentials <dockerhub-user> <dockerhub-password> <dockerhub-email> --cluster-name My-EKS-Cluster`
|
45
60
|
|
46
61
|
Adds your dockerhub credentials as a secret and attaches it to the default serviceaccount imagePullSecrets
|
47
62
|
|
@@ -50,3 +65,18 @@ Adds your dockerhub credentials as a secret and attaches it to the default servi
|
|
50
65
|
`$ eks create-default-storage-class --cluster-name My-EKS-Cluster`
|
51
66
|
|
52
67
|
Creates a standard gp2 default storage class named gp2
|
68
|
+
|
69
|
+
### Connecting to an existing VPC
|
70
|
+
|
71
|
+
`$ eks set-inter-vpc-networking VPC_ID SG_ID`
|
72
|
+
|
73
|
+
Assuming you have some resources shared on another VPC (an RDS instance for example) this command allows you to interact with from the new EKS cluster it by:
|
74
|
+
|
75
|
+
1. Creating and accepting a VPC peering connection from you EKS cluster VPC to the old VPC
|
76
|
+
2. Setting route tables on both directions to allow communication
|
77
|
+
3. Adding an ingress role to SG_ID to accept all communication from your new cluster nodes.
|
78
|
+
|
79
|
+
|
80
|
+
## Contributing
|
81
|
+
|
82
|
+
Is more than welcome! ;)
|
data/eks_cli.gemspec
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'eks_cli/version'
|
4
5
|
|
5
6
|
Gem::Specification.new do |s|
|
6
7
|
s.name = 'eks_cli'
|
7
|
-
s.version =
|
8
|
+
s.version = EksCli::VERSION
|
8
9
|
s.date = '2018-11-18'
|
9
10
|
s.summary = "Make EKS great again!"
|
10
11
|
s.description = "A utility to manage and create EKS (Kubernetes) cluster on Amazon Web Services"
|
data/lib/eks_cli/cli.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'thor'
|
2
|
+
require 'version'
|
2
3
|
|
3
4
|
autoload :JSON, 'json'
|
4
5
|
|
@@ -34,10 +35,20 @@ module EksCli
|
|
34
35
|
|
35
36
|
class_option :cluster_name, required: true, aliases: :c
|
36
37
|
|
37
|
-
desc "
|
38
|
-
|
38
|
+
desc "create REGION", "creates a new EKS cluster"
|
39
|
+
option :open_ports, type: :array, default: [], desc: "open ports on cluster nodes (eg 22 for SSH access)"
|
40
|
+
def create(region)
|
41
|
+
Config[cluster_name].bootstrap({region: region})
|
42
|
+
create_eks_role
|
43
|
+
create_cluster_vpc
|
44
|
+
create_eks_cluster
|
45
|
+
create_cluster_security_group
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "create-eks-role", "creates an IAM role for usage by EKS"
|
49
|
+
def create_eks_role
|
39
50
|
role = IAM::Client.new(cluster_name).create_eks_role
|
40
|
-
Config[cluster_name].
|
51
|
+
Config[cluster_name].write({eks_role_arn: role.arn})
|
41
52
|
end
|
42
53
|
|
43
54
|
desc "show-config", "print cluster configuration"
|
@@ -146,6 +157,12 @@ module EksCli
|
|
146
157
|
VPC::Client.new(cluster_name).set_inter_vpc_networking(to_vpc_id, to_sg_id)
|
147
158
|
end
|
148
159
|
|
160
|
+
disable_required_check! :version
|
161
|
+
desc "version", "prints eks_cli version"
|
162
|
+
def version
|
163
|
+
puts EksCli::VERSION
|
164
|
+
end
|
165
|
+
|
149
166
|
no_commands do
|
150
167
|
def cluster_name; options[:cluster_name]; end
|
151
168
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eks_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erez Rabih
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- lib/eks_cli/log.rb
|
156
156
|
- lib/eks_cli/nodegroup.rb
|
157
157
|
- lib/eks_cli/route53/client.rb
|
158
|
+
- lib/eks_cli/version.rb
|
158
159
|
- lib/eks_cli/vpc/client.rb
|
159
160
|
homepage: https://github.com/nanit/eks_cli
|
160
161
|
licenses:
|