kuby-eks 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 535a85c908e83e1a62bb3fa0c51c5f61af955205c265f408bee09be7bd7ad328
4
- data.tar.gz: 137b6e800231b10e304e93d5ef723450320884571625c1e9ebb190c1ce801a92
3
+ metadata.gz: b2b107520f29c1ad512bd038afd7d858f9d123e8c68fe33a66d3dedb6b875e68
4
+ data.tar.gz: fc125dce08fe9c54b4186707d39337d921f62e5cc8ef26dca1a245ff634e3886
5
5
  SHA512:
6
- metadata.gz: aa451b6a7aa43879170b2e5d2c4d2ef3620348a005afcfc730cad536de0d4a67be93b01527eb988d2cc218fca59ba0c63bf2fe74adbf5622e5ced9a8cc84796a
7
- data.tar.gz: e5575e4f1c9f70ea62f450e32ace593e35889ed92ac2e5dc8cfe16c02cc9b7a392d40f9bb3091545188c19b37f5d62e70ecaf1670951dcb95214f6b8420e241b
6
+ metadata.gz: 233e51b62e6d37c13d2f57081535a6b0d4f2115251bd07c7be0e78006d4419fb9dd749c4c4303fc101bebac88cbaf04a5aa53d7ce02693cc90d5ba267c4d1694
7
+ data.tar.gz: 8962639730b2518f84e20c9a5bb2662e4b5088ce037f9345946f2037a5da9e31d6c67d5f721955acc3db7996de6cdc9ab4592af272289f411e4eb4bcd2c44e93
@@ -1,2 +1,8 @@
1
+ ## 0.2.0
2
+ * Remove dependency on rails app.
3
+ * Refresh kubeconfig in more places.
4
+ - Before setup
5
+ - Before deploy
6
+
1
7
  ## 0.1.0
2
8
  * Birthday!
@@ -0,0 +1,47 @@
1
+ ## kuby-eks
2
+
3
+ Amazon EKS provider for [Kuby](https://github.com/getkuby/kuby-core).
4
+
5
+ ## Intro
6
+
7
+ In Kuby parlance, a "provider" is an [adapter](https://en.wikipedia.org/wiki/Adapter_pattern) that enables Kuby to deploy apps to a specific cloud provider. In this case, we're talking about Amazon's [Elastic Kubernetes Service](https://aws.amazon.com/eks/), or EKS.
8
+
9
+ All providers adhere to a specific interface, meaning you can swap out one provider for another without having to change your code.
10
+
11
+ ## Usage
12
+
13
+ Enable the EKS provider like so:
14
+
15
+ ```ruby
16
+ require 'aws-sdk-eks'
17
+
18
+ Kuby.define(:production) do
19
+ kubernetes do
20
+
21
+ provider :eks do
22
+ region 'us-west-2'
23
+ cluster_name 'my-cluster'
24
+
25
+ credentials(
26
+ Aws::Credentials.new(
27
+ 'my-access-key-id',
28
+ 'my-secret-access-key'
29
+ )
30
+ )
31
+ end
32
+
33
+ end
34
+ end
35
+ ```
36
+
37
+ The `credentials` method should be passed an instance of [`Aws::Credentials`](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Credentials.html) or one of the other `Aws::CredentialProvider` subclasses, eg. [`Aws::SharedCredentials`](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SharedCredentials.html), [`Aws::InstanceProfileCredentials`](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/InstanceProfileCredentials.html), etc.
38
+
39
+ Once configured, you should be able to run all the Kuby rake tasks as you would with any provider.
40
+
41
+ ## License
42
+
43
+ Licensed under the MIT license. See LICENSE for details.
44
+
45
+ ## Authors
46
+
47
+ * Cameron C. Dutro: http://github.com/camertron
@@ -1,6 +1,7 @@
1
1
  require 'fileutils'
2
2
  require 'aws-sdk-eks'
3
3
  require 'aws-iam-authenticator-rb'
4
+ require 'tmpdir'
4
5
  require 'yaml'
5
6
 
6
7
  module Kuby
@@ -15,23 +16,31 @@ module Kuby
15
16
  end
16
17
 
17
18
  def kubeconfig_path
18
- @kubeconfig_path ||= kubeconfig_dir.join(
19
- "#{definition.app_name.downcase}-kubeconfig.yaml"
20
- ).to_s
19
+ @kubeconfig_path ||= File.join(
20
+ kubeconfig_dir, "#{definition.app_name.downcase}-kubeconfig.yaml"
21
+ )
22
+ end
23
+
24
+ def storage_class_name
25
+ STORAGE_CLASS_NAME
21
26
  end
22
27
 
23
- def after_configuration
28
+ def before_setup
24
29
  refresh_kubeconfig
25
30
  end
26
31
 
27
- def storage_class_name
28
- STORAGE_CLASS_NAME
32
+ def before_deploy(*)
33
+ refresh_kubeconfig
29
34
  end
30
35
 
31
36
  private
32
37
 
33
38
  def after_initialize
34
39
  @config = Config.new
40
+
41
+ kubernetes_cli.before_execute do
42
+ refresh_kubeconfig
43
+ end
35
44
  end
36
45
 
37
46
  # Double .credentials call here to convert instance into
@@ -115,8 +124,8 @@ module Kuby
115
124
  end
116
125
 
117
126
  def kubeconfig_dir
118
- @kubeconfig_dir ||= definition.app.root.join(
119
- 'tmp', 'kuby-eks'
127
+ @kubeconfig_dir ||= File.join(
128
+ Dir.tmpdir, 'kuby-eks'
120
129
  )
121
130
  end
122
131
  end
@@ -1,5 +1,5 @@
1
1
  module Kuby
2
2
  module EKS
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuby-eks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-13 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kube-dsl
@@ -62,6 +62,7 @@ files:
62
62
  - CHANGELOG.md
63
63
  - Gemfile
64
64
  - LICENSE
65
+ - README.md
65
66
  - Rakefile
66
67
  - kuby-eks.gemspec
67
68
  - lib/kuby/eks.rb
@@ -71,7 +72,7 @@ files:
71
72
  homepage: http://github.com/getkuby/kuby-eks
72
73
  licenses: []
73
74
  metadata: {}
74
- post_install_message:
75
+ post_install_message:
75
76
  rdoc_options: []
76
77
  require_paths:
77
78
  - lib
@@ -86,8 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  - !ruby/object:Gem::Version
87
88
  version: '0'
88
89
  requirements: []
89
- rubygems_version: 3.0.6
90
- signing_key:
90
+ rubygems_version: 3.1.4
91
+ signing_key:
91
92
  specification_version: 4
92
93
  summary: Amazon EKS provider for Kuby.
93
94
  test_files: []