eks_cli 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 360ab8081657ef9ae917e4ce3226150ba715d28c
4
- data.tar.gz: da04cf638c11b7d7edc8b73b3c749e11fead278f
3
+ metadata.gz: 50585476099aa020424c90d5eb6ad32e5d19c29c
4
+ data.tar.gz: b1ff683504ec2367c90052de3deb26a68f8af015
5
5
  SHA512:
6
- metadata.gz: 0881f4b4473b880cc8269d20a6982d4fa113ed0df31f6e8162859e8d986369e4c10513b47c903fa385a51b80ec38b802e17417bbe1bb689359e80dfd61801370
7
- data.tar.gz: 4b6ab2bd8c7f47cde7b8312c09e129ccebb0b78fd762040e228529d849488d606fd0d261db6c22ce23a8cc10cf67f375196d67a69fa06d8923b36f379e7a90dc
6
+ metadata.gz: a143b01e227eb884cd2bbf27f310773f35b69ce84407c92d6be3ba04d6b2513f133194eb5d29f98edc3f699a1e89ca558da1a0fad02c68a048e55115cdc5924d
7
+ data.tar.gz: f7d0209784c21b0d19286fc112a7db914ddc4de2bc171db8169e4327e703f1149a5b5fcc8c967c036498166dce84c69b675bc7b12a5ca44cb08b27e3e847219c
data/README.md CHANGED
@@ -14,7 +14,7 @@ EKS cluster bootstrap with batteries included
14
14
  ## Usage
15
15
 
16
16
  ```
17
- $ gem install eks_cli -v 0.1.3
17
+ $ gem install eks_cli -v 0.1.4
18
18
  $ eks create us-west-2 --cluster-name=My-EKS-Cluster
19
19
  $ eks create-nodegroup --cluster-name My-EKS-Cluster --group-name nodes --ssh-key-name my-ssh-key --min 1 --max 3
20
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
@@ -66,6 +66,12 @@ Adds your dockerhub credentials as a secret and attaches it to the default servi
66
66
 
67
67
  Creates a standard gp2 default storage class named gp2
68
68
 
69
+ ### Installing DNS autosclaer
70
+
71
+ `$ eks create-dns-autoscaler --cluster-name My-EKS-Cluster`
72
+
73
+ Creates kube-dns autoscaler with sane defaults
74
+
69
75
  ### Connecting to an existing VPC
70
76
 
71
77
  `$ eks set-inter-vpc-networking VPC_ID SG_ID`
@@ -0,0 +1,31 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: dns-autoscaler
5
+ namespace: kube-system
6
+ labels:
7
+ k8s-app: dns-autoscaler
8
+ spec:
9
+ selector:
10
+ matchLabels:
11
+ k8s-app: dns-autoscaler
12
+ template:
13
+ metadata:
14
+ labels:
15
+ k8s-app: dns-autoscaler
16
+ spec:
17
+ containers:
18
+ - name: autoscaler
19
+ image: k8s.gcr.io/cluster-proportional-autoscaler-amd64:1.1.1
20
+ resources:
21
+ requests:
22
+ cpu: "20m"
23
+ memory: "10Mi"
24
+ command:
25
+ - /cluster-proportional-autoscaler
26
+ - --namespace=kube-system
27
+ - --configmap=dns-autoscaler
28
+ - --target=Deployment/kube-dns
29
+ - --default-params={"linear":{"coresPerReplica":64,"nodesPerReplica":4,"min":3}}
30
+ - --logtostderr=true
31
+ - --v=2
data/lib/eks_cli/cli.rb CHANGED
@@ -37,12 +37,18 @@ module EksCli
37
37
 
38
38
  desc "create REGION", "creates a new EKS cluster"
39
39
  option :open_ports, type: :array, default: [], desc: "open ports on cluster nodes (eg 22 for SSH access)"
40
+ option :enable_gpu, type: :boolean, default: false, desc: "installs nvidia device plugin daemon set"
41
+ option :create_default_storage_class, type: :boolean, default: true, desc: "creates a default gp2 storage class"
42
+ option :create_dns_autoscaler, type: :boolean, default: true, desc: "creates dns autoscaler on the cluster"
40
43
  def create(region)
41
44
  Config[cluster_name].bootstrap({region: region})
42
45
  create_eks_role
43
46
  create_cluster_vpc
44
47
  create_eks_cluster
45
48
  create_cluster_security_group
49
+ enable_gpu if options[:enable_gpu]
50
+ create_default_storage_class if options[:create_default_storage_class]
51
+ create_dns_autoscaler if options[:create_dns_autoscaler]
46
52
  end
47
53
 
48
54
  desc "create-eks-role", "creates an IAM role for usage by EKS"
@@ -157,6 +163,11 @@ module EksCli
157
163
  VPC::Client.new(cluster_name).set_inter_vpc_networking(to_vpc_id, to_sg_id)
158
164
  end
159
165
 
166
+ desc "create-dns-autoscaler", "creates kube dns autoscaler"
167
+ def create_dns_autoscaler
168
+ K8s::Client.new(cluster_name).create_dns_autoscaler
169
+ end
170
+
160
171
  disable_required_check! :version
161
172
  desc "version", "prints eks_cli version"
162
173
  def version
@@ -34,6 +34,11 @@ module EksCli
34
34
  Log.info self.create_storage_class(resource_from_yaml("default_storage_class.yaml"))
35
35
  end
36
36
 
37
+ def create_dns_autoscaler
38
+ Log.info "creating kube-dns autoscaler"
39
+ Log.info self.create_deployment(resource_from_yaml("dns_autoscaler.dep.yaml"))
40
+ end
41
+
37
42
  private
38
43
 
39
44
  def resource_from_yaml(filename)
@@ -1,3 +1,3 @@
1
1
  module EksCli
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erez Rabih
@@ -137,6 +137,7 @@ files:
137
137
  - bin/eks
138
138
  - eks_cli.gemspec
139
139
  - lib/assets/default_storage_class.yaml
140
+ - lib/assets/dns_autoscaler.dep.yaml
140
141
  - lib/assets/nodegroup_cf_template.yaml
141
142
  - lib/assets/nvidia_device_plugin.yaml
142
143
  - lib/eks_cli.rb