mina-kubernetes 2.7.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d0cb0ebf48a37d31792f0ca82d8062d6fd7d05f10c1471c20d12dd2ddc817a4
4
- data.tar.gz: 95b2d369aaca5bba72c26baea74620b1ac3a947d3d915686156ce33790fb1d35
3
+ metadata.gz: c9e6f3074267ba8ee5a81ea32236f2710b7cd5279cca64ca2307fb14002d4f8f
4
+ data.tar.gz: e08d008d5f4994b0159548146df2e94dfc0e993dd3c2808f1c63ab7a83d5df74
5
5
  SHA512:
6
- metadata.gz: d868d76497cc86754c60abc9f5580c5fc4e58b8eea0b5c9c2876d323536a3fb308439015bfbea490bce63539974e3b8c20bc5f8d015559308413e41269bf345b
7
- data.tar.gz: ef139d07bd7056f0dd779b6171f19e726b714d40c45f323bf883aa6c0b19ffb71c694df7d9518f7572210aa1ba5ac8c9beffcf81fc0b66fc5f40b8d1935176f3
6
+ metadata.gz: d2435a682a59c5d1bca7a6257eb352a34b92900dfea28ef975e9b85b7fece25e14b99f0b2af751d191539b90ac286bd13f075a4be0177c7a98fde6297e3ead49
7
+ data.tar.gz: 760d3d1981dc80c48fb7652a7f97fd142bacbf616a3d8e45da7ac91b412842fcde3cbf0738a6e73abd57180847dbec916ed5c6ccf72cc59be6455e34107473c0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.0.0
2
+
3
+ *Breaking change*
4
+
5
+ - Depend on [Krane 3.0.0](https://github.com/Shopify/krane/blob/master/CHANGELOG.md#300)
6
+
1
7
  ## 2.7.1
2
8
 
3
9
  *Fixes*
data/README.md CHANGED
@@ -32,16 +32,6 @@ If `set :image_tag, "my_image_tag"` is also defined, it'll be used to deploy the
32
32
 
33
33
  Then add `*.yml.erb` Kubernetes resource definition files in the stage folder, for instance `config/deploy/production/webserver.yml.erb` and `config/deploy/production/backgroundjobs.yml.erb`. Occurences of `<%= image_repo %>` and `<%= current_sha %>` in these files will be dynamically replaced on deploy by the image repository URL and the latest commit hash of the selected branch on its git origin.
34
34
 
35
- You can also get the RAILS_MASTER_KEY for encrypted credentials deployed as a Kubernetes secrets by adding a secrets.yml.erb like below:
36
- ```yml
37
- apiVersion: v1
38
- kind: Secret
39
- metadata:
40
- name: secrets
41
- data:
42
- RAILS_MASTER_KEY: <%= Base64.strict_encode64(File.read("#{Dir.pwd}/config/credentials/production.key").strip) %>
43
- ```
44
-
45
35
  When running `mina production deploy`, it'll check the image is available on the repository and then call the `krane` executable to fill in the variables in the resource templates and apply them all to the cluster under the given namespace (see https://github.com/Shopify/krane#deploy-walkthrough for more details)
46
36
 
47
37
  ### EJSON Encrypted secrets
@@ -59,15 +49,15 @@ Refer to https://github.com/Shopify/krane#usage for a complete set of options
59
49
 
60
50
  ## Tasks available
61
51
 
62
- #### `kubernetes:deploy`
52
+ ### `kubernetes:deploy`
63
53
 
64
54
  Creates the namespace on cluster if it doesn't exist, prompts for a git branch if no image tag is already specified in stage file, then applies all resources to cluster after checking tagged image is available.
65
55
 
66
- #### `kubernetes:bash`
56
+ ### `kubernetes:bash`
67
57
 
68
58
  Prompts for branch unless image tag is set, then spins up a temporary pod with the image and opens up a remote bash terminal.
69
59
 
70
- #### `kubernetes:command`
60
+ ### `kubernetes:command`
71
61
 
72
62
  Prompts for branch unless image tag is set, then spins up a temporary pod with the image and runs the command given in the task variable `command`, for instance with `set :command, "rails console"`. Environment variables can also be passed by defining`env_hash`, i.e. `set :env_hash, {"RAILS_ENV" => "production", "MY_VAR" => "abcd123"}`
73
63
 
@@ -79,7 +69,23 @@ A `kubectl_pod_overrides` task option is available to pass a value to the `overr
79
69
 
80
70
  Confirms and delete all resources on cluster under namespace.
81
71
 
82
- ## Example use: run rails console on non-preemptible GKE node
72
+ ## Advanced usage examples
73
+
74
+ ### Deploy environment variable(s) as secret
75
+
76
+ Using Rails and its encrypted credentials feature, the `RAILS_MASTER_KEY` environment variable can be deployed as a Kubernetes secrets by adding a `secrets.yml.erb` file like below:
77
+ ```yml
78
+ apiVersion: v1
79
+ kind: Secret
80
+ metadata:
81
+ name: secrets
82
+ data:
83
+ RAILS_MASTER_KEY: <%= Base64.strict_encode64(File.read("#{Dir.pwd}/config/credentials/production.key").strip) %>
84
+ ```
85
+
86
+ Krane will deploy it before other resources so it's already available when running pods/jobs/deployments which reference this variable such as Rails migrations.
87
+
88
+ ### Run an interactive rails console on non-preemptible GKE node
83
89
 
84
90
  Add the following to your `deploy.rb`
85
91
  ``` ruby
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Kubernetes
3
- VERSION = "2.7.1"
3
+ VERSION = "3.0.0"
4
4
  end
5
5
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_runtime_dependency 'mina', '~> 1.0'
26
26
  spec.add_runtime_dependency 'mina-multistage', '~> 1.0'
27
- spec.add_runtime_dependency 'krane', '~> 2.1'
27
+ spec.add_runtime_dependency 'krane', '~> 3'
28
28
  spec.add_runtime_dependency 'tty-prompt'
29
29
  spec.add_runtime_dependency 'tty-spinner'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-kubernetes
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine Sabourin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-22 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.1'
75
+ version: '3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.1'
82
+ version: '3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: tty-prompt
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ homepage: https://github.com/streemau/mina-kubernetes
126
126
  licenses:
127
127
  - MIT
128
128
  metadata: {}
129
- post_install_message:
129
+ post_install_message:
130
130
  rdoc_options: []
131
131
  require_paths:
132
132
  - lib
@@ -141,8 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  requirements: []
144
- rubygems_version: 3.1.2
145
- signing_key:
144
+ rubygems_version: 3.2.15
145
+ signing_key:
146
146
  specification_version: 4
147
147
  summary: Mina plugin to streamline deployment of resources to Kubernetes cluster
148
148
  test_files: []