kuby-azure 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: 005be68800cb10ba770e629b590f8a28351f0ff3486341bac289c8e1b1294b52
4
- data.tar.gz: 9b9d4d95f9dbc7f2142cd85a5a77a29a338bd9f3abe77e9b779845e62e5074ab
3
+ metadata.gz: da523bdedfeffea5c364555a1217b9a5712a371ab67f07574553e68e7a769b1a
4
+ data.tar.gz: 78a1551643822f38a596bc32525677b5e9d5d21024ddcb0d0f7370a4c14fce6b
5
5
  SHA512:
6
- metadata.gz: b28395e1dc1fea92e5eaf98627ae0eb2f83373372b426485e8b222288aed86d866b632dc0978bf455125062f85a822c86d5072322a330c2324d51db37df06fe0
7
- data.tar.gz: c9ebb9d52f0850b780f0d3ac95e33c2ac7911fb77c707630ea48c774484582f1b2d0b25532263a044c3fb8fd204d02c339383da581e461439315062ec929c3a8
6
+ metadata.gz: d75d1f261e418dbf0f2ea8cc0048d4d97b0c57a9226f692e71d2b7b7156e96d878ea6ff22e070d0d380089249fa93fa242a1a56006f8ca0e7a52ac79dda32c49
7
+ data.tar.gz: b734007a3fe96779d33d296b3f48221ce6b69f92efa808f5cc12485a61846d78ddcbed0deeffcaeeee4792762b7f573259d75bf78fbeaec05d1546838733c51d
@@ -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,52 @@
1
+ ## kuby-azure
2
+
3
+ Azure 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 Microsoft's [Azure](https://azure.microsoft.com/), specifically their managed Kubernetes offering.
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 Azure provider like so:
14
+
15
+ ```ruby
16
+ Kuby.define(:production) do
17
+ kubernetes do
18
+
19
+ provider :azure do
20
+ # Visible in the subscription overview.
21
+ subscription_id 'my-subscription-id'
22
+
23
+ # Visible in Azure Active Directory.
24
+ tenant_id 'my-tenant-id'
25
+
26
+ # These must be configured in Azure Active Directory -> App
27
+ # Registrations. It's easiest to generate a client id and
28
+ # secret for the service principal.
29
+ client_id 'my-client-id'
30
+ client_secret 'my-client-secret'
31
+
32
+ # Your cluster should have been created inside a resource group.
33
+ # Put its name here.
34
+ resource_group_name 'my-resource-group-name'
35
+
36
+ # The name of your cluster.
37
+ resource_name 'my-resource-name'
38
+ end
39
+
40
+ end
41
+ end
42
+ ```
43
+
44
+ Once configured, you should be able to run all the Kuby rake tasks as you would with any provider.
45
+
46
+ ## License
47
+
48
+ Licensed under the MIT license. See LICENSE for details.
49
+
50
+ ## Authors
51
+
52
+ * Cameron C. Dutro: http://github.com/camertron
@@ -12,7 +12,6 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.platform = Gem::Platform::RUBY
14
14
 
15
- s.add_dependency 'faraday', '~> 0.17'
16
15
  s.add_dependency 'kube-dsl', '~> 0.1'
17
16
  s.add_dependency 'azure_mgmt_container_service', '~> 0.20'
18
17
 
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'azure_mgmt_container_service'
3
+ require 'tmpdir'
3
4
 
4
5
  module Kuby
5
6
  module Azure
@@ -13,23 +14,31 @@ module Kuby
13
14
  end
14
15
 
15
16
  def kubeconfig_path
16
- @kubeconfig_path ||= kubeconfig_dir.join(
17
- "#{definition.app_name.downcase}-kubeconfig.yaml"
18
- ).to_s
17
+ @kubeconfig_path ||= File.join(
18
+ kubeconfig_dir, "#{definition.app_name.downcase}-kubeconfig.yaml"
19
+ )
20
+ end
21
+
22
+ def storage_class_name
23
+ STORAGE_CLASS_NAME
19
24
  end
20
25
 
21
- def after_configuration
26
+ def before_setup
22
27
  refresh_kubeconfig
23
28
  end
24
29
 
25
- def storage_class_name
26
- STORAGE_CLASS_NAME
30
+ def before_deploy(*)
31
+ refresh_kubeconfig
27
32
  end
28
33
 
29
34
  private
30
35
 
31
36
  def after_initialize
32
37
  @config = Config.new
38
+
39
+ kubernetes_cli.before_execute do
40
+ refresh_kubeconfig
41
+ end
33
42
  end
34
43
 
35
44
  def client
@@ -70,8 +79,8 @@ module Kuby
70
79
  end
71
80
 
72
81
  def kubeconfig_dir
73
- @kubeconfig_dir ||= definition.app.root.join(
74
- 'tmp', 'kuby-azure'
82
+ @kubeconfig_dir ||= File.join(
83
+ Dir.tmpdir, 'kuby-azure'
75
84
  )
76
85
  end
77
86
  end
@@ -1,5 +1,5 @@
1
1
  module Kuby
2
2
  module Azure
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuby-azure
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-11 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: faraday
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.17'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.17'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: kube-dsl
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -62,6 +48,7 @@ files:
62
48
  - CHANGELOG.md
63
49
  - Gemfile
64
50
  - LICENSE
51
+ - README.md
65
52
  - Rakefile
66
53
  - kuby-azure.gemspec
67
54
  - lib/kuby/azure.rb
@@ -71,7 +58,7 @@ files:
71
58
  homepage: http://github.com/getkuby/kuby-azure
72
59
  licenses: []
73
60
  metadata: {}
74
- post_install_message:
61
+ post_install_message:
75
62
  rdoc_options: []
76
63
  require_paths:
77
64
  - lib
@@ -86,8 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
73
  - !ruby/object:Gem::Version
87
74
  version: '0'
88
75
  requirements: []
89
- rubygems_version: 3.0.6
90
- signing_key:
76
+ rubygems_version: 3.1.4
77
+ signing_key:
91
78
  specification_version: 4
92
79
  summary: Azure provider for Kuby.
93
80
  test_files: []