kuby-azure 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +20 -18
- data/lib/kuby/azure/config.rb +10 -0
- data/lib/kuby/azure/provider.rb +4 -2
- data/lib/kuby/azure/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4027520ee2e9376cadfea437510c241d52302865a36d03892cc7f62bdd7f144d
|
4
|
+
data.tar.gz: 27c981836c7941d690d7180173398931ff8eef430f76b6e80d98b26553dee416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 109405ffc24f9a2907c12e52bd79bba0f0d187ae40ac3bb86a9b6453198afbf1d49f1c87b7ab313822b1543b4fe63c8ec249864c48b30a79bd14a5199288c570
|
7
|
+
data.tar.gz: adc4a21adca8cbd0472da690ae9213198d6cdabf0eb48a85ceff6faeb4738892703a564e05bb88a3b4533fd7046df70f67bf304b46e0fcb05e87e47a4fce4a6c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -13,30 +13,32 @@ All providers adhere to a specific interface, meaning you can swap out one provi
|
|
13
13
|
Enable the Azure provider like so:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
Kuby.define(
|
17
|
-
|
16
|
+
Kuby.define('MyApp') do
|
17
|
+
environment(:production) do
|
18
|
+
kubernetes do
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
provider :azure do
|
21
|
+
# Visible in the subscription overview.
|
22
|
+
subscription_id 'my-subscription-id'
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
# Visible in Azure Active Directory.
|
25
|
+
tenant_id 'my-tenant-id'
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
# These must be configured in Azure Active Directory -> App
|
28
|
+
# Registrations. It's easiest to generate a client id and
|
29
|
+
# secret for the service principal.
|
30
|
+
client_id 'my-client-id'
|
31
|
+
client_secret 'my-client-secret'
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
# Your cluster should have been created inside a resource group.
|
34
|
+
# Put its name here.
|
35
|
+
resource_group_name 'my-resource-group-name'
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
# The name of your cluster.
|
38
|
+
resource_name 'my-resource-name'
|
39
|
+
end
|
39
40
|
|
41
|
+
end
|
40
42
|
end
|
41
43
|
end
|
42
44
|
```
|
data/lib/kuby/azure/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'kube-dsl'
|
2
|
+
require 'digest'
|
2
3
|
|
3
4
|
module Kuby
|
4
5
|
module Azure
|
@@ -7,6 +8,15 @@ module Kuby
|
|
7
8
|
|
8
9
|
value_fields :tenant_id, :client_id, :client_secret, :subscription_id
|
9
10
|
value_fields :resource_group_name, :resource_name
|
11
|
+
|
12
|
+
def hash_value
|
13
|
+
parts = [
|
14
|
+
tenant_id, client_id, client_secret, subscription_id,
|
15
|
+
resource_group_name, resource_name
|
16
|
+
]
|
17
|
+
|
18
|
+
Digest::SHA256.hexdigest(parts.join(':'))
|
19
|
+
end
|
10
20
|
end
|
11
21
|
end
|
12
22
|
end
|
data/lib/kuby/azure/provider.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'azure_mgmt_container_service'
|
3
3
|
require 'tmpdir'
|
4
|
+
require 'digest'
|
4
5
|
|
5
6
|
module Kuby
|
6
7
|
module Azure
|
@@ -14,8 +15,9 @@ module Kuby
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def kubeconfig_path
|
17
|
-
|
18
|
-
kubeconfig_dir,
|
18
|
+
File.join(
|
19
|
+
kubeconfig_dir,
|
20
|
+
"#{environment.app_name.downcase}-#{config.hash_value}-kubeconfig.yaml"
|
19
21
|
)
|
20
22
|
end
|
21
23
|
|
data/lib/kuby/azure/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuby-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kube-dsl
|