krane 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/{ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md} +0 -0
- data/{pull_request_template.md → .github/pull_request_template.md} +0 -0
- data/.rubocop-http---shopify-github-io-ruby-style-guide-rubocop-yml +24 -30
- data/.rubocop.yml +0 -12
- data/.shopify-build/krane.yml +20 -6
- data/1.0-Upgrade.md +2 -2
- data/CHANGELOG.md +61 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +14 -16
- data/bin/ci +1 -1
- data/bin/test +2 -2
- data/dev.yml +1 -1
- data/krane.gemspec +7 -5
- data/lib/krane/annotation.rb +11 -0
- data/lib/krane/cli/deploy_command.rb +3 -4
- data/lib/krane/cli/global_deploy_command.rb +3 -3
- data/lib/krane/cli/render_command.rb +3 -3
- data/lib/krane/cluster_resource_discovery.rb +10 -6
- data/lib/krane/concerns/template_reporting.rb +0 -6
- data/lib/krane/container_logs.rb +1 -1
- data/lib/krane/container_overrides.rb +33 -0
- data/lib/krane/deploy_task.rb +16 -13
- data/lib/krane/ejson_secret_provisioner.rb +1 -2
- data/lib/krane/global_deploy_task.rb +4 -7
- data/lib/krane/kubectl.rb +11 -1
- data/lib/krane/kubernetes_resource.rb +19 -46
- data/lib/krane/kubernetes_resource/custom_resource.rb +2 -2
- data/lib/krane/kubernetes_resource/custom_resource_definition.rb +13 -10
- data/lib/krane/kubernetes_resource/deployment.rb +5 -7
- data/lib/krane/kubernetes_resource/pod.rb +12 -8
- data/lib/krane/psych_k8s_compatibility.rb +36 -0
- data/lib/krane/render_task.rb +2 -2
- data/lib/krane/renderer.rb +2 -0
- data/lib/krane/resource_deployer.rb +7 -2
- data/lib/krane/resource_watcher.rb +1 -1
- data/lib/krane/restart_task.rb +2 -2
- data/lib/krane/runner_task.rb +16 -17
- data/lib/krane/statsd.rb +2 -2
- data/lib/krane/template_sets.rb +1 -1
- data/lib/krane/version.rb +1 -1
- metadata +27 -17
- data/lib/krane/kubernetes_resource/cloudsql.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57338bf07bebe1b05ce6701e0c89f2c91db5bd083818b35bd9f307aa669de5ba
|
4
|
+
data.tar.gz: 94850854c314bb1f05bbc43baa2759dc10e53ee9845c8f3d9b0d33e1a2d7dfd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0414c56878acd433ef3fabf36dd71920ab887adef61ce6b88c3a9dd298fedfb98c8cea39f0a2dfee1d789144ee3b175274e5ecccfd9ff08aad97322cc709463
|
7
|
+
data.tar.gz: 4f12d3be973fafb33dbbeb5f1f036afc6aa0cd5013b28a063c957befe34a0b65247e1a6b2390de49b52f5f6a9285de2206d5bbda819549a1a82e70e426c61a39
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @Shopify/krane
|
File without changes
|
File without changes
|
@@ -20,7 +20,7 @@ Style/Alias:
|
|
20
20
|
- prefer_alias
|
21
21
|
- prefer_alias_method
|
22
22
|
|
23
|
-
Layout/
|
23
|
+
Layout/HashAlignment:
|
24
24
|
EnforcedHashRocketStyle: key
|
25
25
|
EnforcedColonStyle: key
|
26
26
|
EnforcedLastArgumentHashStyle: ignore_implicit
|
@@ -30,7 +30,7 @@ Layout/AlignHash:
|
|
30
30
|
- ignore_implicit
|
31
31
|
- ignore_explicit
|
32
32
|
|
33
|
-
Layout/
|
33
|
+
Layout/ParameterAlignment:
|
34
34
|
EnforcedStyle: with_fixed_indentation
|
35
35
|
SupportedStyles:
|
36
36
|
- with_first_parameter
|
@@ -76,13 +76,6 @@ Style/BlockDelimiters:
|
|
76
76
|
- proc
|
77
77
|
- it
|
78
78
|
|
79
|
-
Style/BracesAroundHashParameters:
|
80
|
-
EnforcedStyle: no_braces
|
81
|
-
SupportedStyles:
|
82
|
-
- braces
|
83
|
-
- no_braces
|
84
|
-
- context_dependent
|
85
|
-
|
86
79
|
Layout/CaseIndentation:
|
87
80
|
EnforcedStyle: end
|
88
81
|
SupportedStyles:
|
@@ -172,7 +165,7 @@ Naming/FileName:
|
|
172
165
|
Regex:
|
173
166
|
IgnoreExecutableScripts: true
|
174
167
|
|
175
|
-
Layout/
|
168
|
+
Layout/FirstArgumentIndentation:
|
176
169
|
EnforcedStyle: consistent
|
177
170
|
SupportedStyles:
|
178
171
|
- consistent
|
@@ -225,7 +218,7 @@ Layout/IndentationConsistency:
|
|
225
218
|
Layout/IndentationWidth:
|
226
219
|
Width: 2
|
227
220
|
|
228
|
-
Layout/
|
221
|
+
Layout/FirstArrayElementIndentation:
|
229
222
|
EnforcedStyle: consistent
|
230
223
|
SupportedStyles:
|
231
224
|
- special_inside_parentheses
|
@@ -233,10 +226,10 @@ Layout/IndentFirstArrayElement:
|
|
233
226
|
- align_brackets
|
234
227
|
IndentationWidth:
|
235
228
|
|
236
|
-
Layout/
|
229
|
+
Layout/AssignmentIndentation:
|
237
230
|
IndentationWidth:
|
238
231
|
|
239
|
-
Layout/
|
232
|
+
Layout/FirstHashElementIndentation:
|
240
233
|
EnforcedStyle: consistent
|
241
234
|
SupportedStyles:
|
242
235
|
- special_inside_parentheses
|
@@ -340,9 +333,9 @@ Style/PercentQLiterals:
|
|
340
333
|
Naming/PredicateName:
|
341
334
|
NamePrefix:
|
342
335
|
- is_
|
343
|
-
|
336
|
+
ForbiddenPrefixes:
|
344
337
|
- is_
|
345
|
-
|
338
|
+
AllowedMethods:
|
346
339
|
- is_a?
|
347
340
|
Exclude:
|
348
341
|
- 'spec/**/*'
|
@@ -467,7 +460,7 @@ Style/TernaryParentheses:
|
|
467
460
|
- require_no_parentheses
|
468
461
|
AllowSafeAssignment: true
|
469
462
|
|
470
|
-
Layout/
|
463
|
+
Layout/TrailingEmptyLines:
|
471
464
|
EnforcedStyle: final_newline
|
472
465
|
SupportedStyles:
|
473
466
|
- final_newline
|
@@ -478,7 +471,7 @@ Style/TrivialAccessors:
|
|
478
471
|
AllowPredicates: true
|
479
472
|
AllowDSLWriters: false
|
480
473
|
IgnoreClassMethods: false
|
481
|
-
|
474
|
+
AllowedMethods:
|
482
475
|
- to_ary
|
483
476
|
- to_a
|
484
477
|
- to_c
|
@@ -509,7 +502,7 @@ Style/WhileUntilModifier:
|
|
509
502
|
Metrics/BlockNesting:
|
510
503
|
Max: 3
|
511
504
|
|
512
|
-
|
505
|
+
Layout/LineLength:
|
513
506
|
Max: 120
|
514
507
|
AllowHeredoc: true
|
515
508
|
AllowURI: true
|
@@ -561,7 +554,7 @@ Lint/UnusedMethodArgument:
|
|
561
554
|
Naming/AccessorMethodName:
|
562
555
|
Enabled: true
|
563
556
|
|
564
|
-
Layout/
|
557
|
+
Layout/ArrayAlignment:
|
565
558
|
Enabled: true
|
566
559
|
|
567
560
|
Style/ArrayJoin:
|
@@ -584,6 +577,7 @@ Layout/BlockEndNewline:
|
|
584
577
|
|
585
578
|
Style/CaseEquality:
|
586
579
|
Enabled: true
|
580
|
+
AllowOnConstant: true
|
587
581
|
|
588
582
|
Style/CharacterLiteral:
|
589
583
|
Enabled: true
|
@@ -666,6 +660,9 @@ Style/IfWithSemicolon:
|
|
666
660
|
Style/IdenticalConditionalBranches:
|
667
661
|
Enabled: true
|
668
662
|
|
663
|
+
Layout/IndentationStyle:
|
664
|
+
Enabled: true
|
665
|
+
|
669
666
|
Style/InfiniteLoop:
|
670
667
|
Enabled: true
|
671
668
|
|
@@ -810,9 +807,6 @@ Layout/SpaceInsideRangeLiteral:
|
|
810
807
|
Style/SymbolLiteral:
|
811
808
|
Enabled: true
|
812
809
|
|
813
|
-
Layout/Tab:
|
814
|
-
Enabled: true
|
815
|
-
|
816
810
|
Layout/TrailingWhitespace:
|
817
811
|
Enabled: true
|
818
812
|
|
@@ -840,8 +834,8 @@ Style/WhileUntilDo:
|
|
840
834
|
Style/ZeroLengthPredicate:
|
841
835
|
Enabled: true
|
842
836
|
|
843
|
-
Layout/
|
844
|
-
|
837
|
+
Layout/HeredocIndentation:
|
838
|
+
Enabled: true
|
845
839
|
|
846
840
|
Lint/AmbiguousOperator:
|
847
841
|
Enabled: true
|
@@ -864,7 +858,7 @@ Lint/DeprecatedClassMethods:
|
|
864
858
|
Lint/DuplicateMethods:
|
865
859
|
Enabled: true
|
866
860
|
|
867
|
-
Lint/
|
861
|
+
Lint/DuplicateHashKey:
|
868
862
|
Enabled: true
|
869
863
|
|
870
864
|
Lint/EachWithObjectArgument:
|
@@ -879,9 +873,6 @@ Lint/EmptyEnsure:
|
|
879
873
|
Lint/EmptyInterpolation:
|
880
874
|
Enabled: true
|
881
875
|
|
882
|
-
Lint/EndInMethod:
|
883
|
-
Enabled: true
|
884
|
-
|
885
876
|
Lint/EnsureReturn:
|
886
877
|
Enabled: true
|
887
878
|
|
@@ -891,7 +882,7 @@ Lint/FloatOutOfRange:
|
|
891
882
|
Lint/FormatParameterMismatch:
|
892
883
|
Enabled: true
|
893
884
|
|
894
|
-
Lint/
|
885
|
+
Lint/SuppressedException:
|
895
886
|
AllowComments: true
|
896
887
|
|
897
888
|
Lint/ImplicitStringConcatenation:
|
@@ -947,7 +938,7 @@ Lint/ShadowedException:
|
|
947
938
|
Lint/ShadowingOuterLocalVariable:
|
948
939
|
Enabled: true
|
949
940
|
|
950
|
-
Lint/
|
941
|
+
Lint/RedundantStringCoercion:
|
951
942
|
Enabled: true
|
952
943
|
|
953
944
|
Lint/UnderscorePrefixedVariableName:
|
@@ -1025,3 +1016,6 @@ Style/ModuleFunction:
|
|
1025
1016
|
|
1026
1017
|
Lint/OrderedMagicComments:
|
1027
1018
|
Enabled: true
|
1019
|
+
|
1020
|
+
Lint/DeprecatedOpenSSLConstant:
|
1021
|
+
Enabled: true
|
data/.rubocop.yml
CHANGED
data/.shopify-build/krane.yml
CHANGED
@@ -1,21 +1,36 @@
|
|
1
1
|
containers:
|
2
2
|
default:
|
3
|
-
docker: circleci/ruby:2.
|
3
|
+
docker: circleci/ruby:2.5.7
|
4
4
|
|
5
5
|
steps:
|
6
6
|
- label: Lint
|
7
7
|
timeout: 5m
|
8
8
|
run:
|
9
|
+
- bundle: ~
|
9
10
|
- bundle exec rubocop
|
10
|
-
|
11
|
-
- bundler
|
12
|
-
- label: 'Run Test Suite (:kubernetes: 1.16-latest)'
|
11
|
+
- label: 'Run Test Suite (:kubernetes: 1.18-latest :ruby: 2.7)'
|
13
12
|
command: bin/ci
|
14
13
|
agents:
|
15
14
|
queue: k8s-ci
|
16
15
|
env:
|
17
16
|
LOGGING_LEVEL: "4"
|
18
|
-
KUBERNETES_VERSION: v1.
|
17
|
+
KUBERNETES_VERSION: v1.18-latest
|
18
|
+
RUBY_VERSION: "2.7"
|
19
|
+
- label: 'Run Test Suite (:kubernetes: 1.17-latest)'
|
20
|
+
command: bin/ci
|
21
|
+
agents:
|
22
|
+
queue: k8s-ci
|
23
|
+
env:
|
24
|
+
LOGGING_LEVEL: "4"
|
25
|
+
KUBERNETES_VERSION: v1.17-latest
|
26
|
+
- label: 'Run Test Suite (:kubernetes: 1.16.12)'
|
27
|
+
command: bin/ci
|
28
|
+
agents:
|
29
|
+
queue: k8s-ci
|
30
|
+
env:
|
31
|
+
LOGGING_LEVEL: "4"
|
32
|
+
# Flip this back to v1.16-latest when 1.16.14 comes out (see #733)
|
33
|
+
KUBERNETES_VERSION: v1.16.12
|
19
34
|
- label: 'Run Test Suite (:kubernetes: 1.15-latest)'
|
20
35
|
command: bin/ci
|
21
36
|
agents:
|
@@ -51,4 +66,3 @@ steps:
|
|
51
66
|
env:
|
52
67
|
LOGGING_LEVEL: "4"
|
53
68
|
KUBERNETES_VERSION: v1.11-latest
|
54
|
-
|
data/1.0-Upgrade.md
CHANGED
@@ -119,7 +119,7 @@ Old flag | New flag | Comments
|
|
119
119
|
--skip-wait | --verify-result=true |
|
120
120
|
--allow-protected-ns | --protected-namespaces=default,kube-system,kube-public | Added the ability to specify which namespaces are protected
|
121
121
|
--no-prune | --prune=true |
|
122
|
-
--template-dir | -f, --
|
122
|
+
--template-dir | -f, --filenames | Makes all krane commands accept this argument, which is now required for the deploy task
|
123
123
|
--verbose-log-prefix | --verbose-log-prefix |
|
124
124
|
--max-watch-seconds=seconds | --global-timeout=300s | Changed flag name and default value to be a duration (expressed using strings like "300s" or "1h")
|
125
125
|
--selector | --selector |
|
@@ -153,7 +153,7 @@ Old flag | New flag | Comments
|
|
153
153
|
Old flag | New flag | Comments
|
154
154
|
--- | --- | ---
|
155
155
|
--bindings=BINDINGS | --bindings=BINDINGS |
|
156
|
-
--template-dir | -f, --
|
156
|
+
--template-dir | -f, --filenames | Changed to be more aligned with `kubectl apply` and other krane tasks
|
157
157
|
$REVISION | --current-sha | The environment variable REVISION was dropped in favour of an explicit flag
|
158
158
|
[none] | --stdin | Allow template filenames given from stdin stream
|
159
159
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,60 @@
|
|
1
1
|
## next
|
2
2
|
|
3
|
+
## 2.0.0
|
4
|
+
|
5
|
+
*Breaking Changes*
|
6
|
+
- Remove kubernetes deploy annotation prefix [#738](https://github.com/Shopify/krane/pull/738)
|
7
|
+
|
8
|
+
*Bug Fixes*
|
9
|
+
- Always set a deployment_id, even if the current_sha isn't set [#730](https://github.com/Shopify/krane/pull/730)
|
10
|
+
- YAML string scalars with scientific/e-notation numeric format not properly quoted. [#740](https://github.com/Shopify/krane/pull/740)
|
11
|
+
|
12
|
+
## 1.1.4
|
13
|
+
|
14
|
+
*Bug Fixes*
|
15
|
+
- Properly look up constant on Krane namespace. [#720](https://github.com/Shopify/krane/pull/720)
|
16
|
+
|
17
|
+
*Enhancements*
|
18
|
+
- Allow to configure `image_tag` when using task runner. [#719](https://github.com/Shopify/krane/pull/719)
|
19
|
+
|
20
|
+
## 1.1.3
|
21
|
+
|
22
|
+
*Bug Fixes*
|
23
|
+
- Retry dry-run validation when no error is returned. [#705](https://github.com/Shopify/krane/pull/705)
|
24
|
+
- Stop deploys if ClusterResourceDiscovery's kubectl calls fail. [#701](https://github.com/Shopify/krane/pull/701)
|
25
|
+
|
26
|
+
*Other*
|
27
|
+
- Dropped support for Ruby 2.4 since it will be EoL shortly. [#693](https://github.com/Shopify/krane/pull/693).
|
28
|
+
- Ruby 2.7 support: fix deprecation warnings, add testing. [#710](https://github.com/Shopify/krane/pull/705)
|
29
|
+
|
30
|
+
## 1.1.2
|
31
|
+
*Enhancements*
|
32
|
+
- Don't treat `containerCannotRun` termination reason as a fatal deploy failure, since it is usually transient. [#694](https://github.com/Shopify/krane/pull/694)
|
33
|
+
|
34
|
+
*Bug Fixes*
|
35
|
+
- Help ruby correctly identify kubectl output encoding. [#646](https://github.com/Shopify/krane/pull/646)
|
36
|
+
- Add an override for Job kind for version `batch/v2alpha1` [#696](https://github.com/Shopify/krane/pull/696)
|
37
|
+
|
38
|
+
*Other*
|
39
|
+
- `--stdin` flag is deprecated. To read from STDIN, use `-f -` (can be combined with other files/directories) [#684](https://github.com/Shopify/krane/pull/684).
|
40
|
+
- Reduces the number of container logs printed for failures from 250 to 25 to reduce noise. [#676](https://github.com/Shopify/krane/pull/676)
|
41
|
+
- Remove hardcoded cloudsql class. [#680](https://github.com/Shopify/krane/pull/680)
|
42
|
+
|
43
|
+
## 1.1.1
|
44
|
+
|
45
|
+
*Enhancements*
|
46
|
+
- Detect and handle case when webhook prevents server-dry-run. [#663](https://github.com/Shopify/krane/pull/663)
|
47
|
+
- Deploy CustomResources after most other resources in the priority deploy phase. [#672](https://github.com/Shopify/krane/pull/672)
|
48
|
+
|
49
|
+
*Bug Fixes*
|
50
|
+
- Prints the correct argument name in error message. [#660](https://github.com/Shopify/krane/pull/660)
|
51
|
+
- Fix mistakes in README.md [#664](https://github.com/Shopify/krane/pull/664), [#659](https://github.com/Shopify/krane/pull/659), & [#668](https://github.com/Shopify/krane/pull/668)
|
52
|
+
- Restores the default value of the `--verbose-log-prefix` flag on `krane deploy` to false. [#673](https://github.com/Shopify/krane/pull/673)
|
53
|
+
|
54
|
+
*Other*
|
55
|
+
|
56
|
+
- Relax dependency requirements. [#657](https://github.com/Shopify/krane/pull/657)
|
57
|
+
|
3
58
|
## 1.1.0
|
4
59
|
|
5
60
|
*Bug Fixes*
|
@@ -13,6 +68,12 @@
|
|
13
68
|
We've renamed the gem and cli to Krane.
|
14
69
|
See our [migration guide](https://github.com/Shopify/krane/blob/master/1.0-Upgrade.md) to help navigate the breaking changes.
|
15
70
|
|
71
|
+
## 1.0.0.pre.2
|
72
|
+
|
73
|
+
*Enhancements*
|
74
|
+
- Relax thor version requirement. ([#731](https://github.com/Shopify/krane/pull/731))
|
75
|
+
- Relax googleauth restriction. ([#731](https://github.com/Shopify/krane/pull/731))
|
76
|
+
|
16
77
|
## 1.0.0.pre.1
|
17
78
|
|
18
79
|
*Important!*
|
data/CONTRIBUTING.md
CHANGED
@@ -151,7 +151,7 @@ To see the full-color output of a specific integration test, you can use `PRINT_
|
|
151
151
|
1. Make sure CHANGELOG.md includes all user-facing changes since the last release. Things like test changes or refactors do not need to be included.
|
152
152
|
1. Update the version number in `version.rb`.
|
153
153
|
1. Commit your changes with message "Version x.y.z" and open a PR.
|
154
|
-
1. After merging your PR, deploy via [Shipit](https://shipit.shopify.io/shopify/
|
154
|
+
1. After merging your PR, deploy via [Shipit](https://shipit.shopify.io/shopify/krane/rubygems). Shipit will automatically tag the release and upload the gem to [rubygems.org](https://rubygems.org/gems/krane).
|
155
155
|
|
156
156
|
## CI (External contributors)
|
157
157
|
|
@@ -159,6 +159,6 @@ Please make sure you run the tests locally before submitting your PR (see [Runni
|
|
159
159
|
|
160
160
|
#### Employees: Triggering CI for a contributed PR
|
161
161
|
|
162
|
-
Go to the [krane pipeline](https://buildkite.com/shopify/
|
162
|
+
Go to the [krane pipeline](https://buildkite.com/shopify/krane) and click "New Build". Use branch `external_contrib_ci` and the specific sha of the commit you want to build. Add `BUILDKITE_REFSPEC="refs/pull/${PR_NUM}/head"` in the Environment Variables section. Since CI is only visible to Shopify employees, you will need to provide any failing tests and output to the the contributor.
|
163
163
|
|
164
164
|
<img width="350" alt="build external contrib PR" src="https://screenshot.click/2017-11-07--163728_7ovek-wrpwq.png">
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# krane [![Build status](https://badge.buildkite.com/35c56e797c3bbd6ba50053aefdded0715898cd8e8c86f7e462.svg)](https://buildkite.com/shopify/krane) [![codecov](https://codecov.io/gh/Shopify/kubernetes-deploy/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/kubernetes-deploy)
|
1
|
+
# krane [![Build status](https://badge.buildkite.com/35c56e797c3bbd6ba50053aefdded0715898cd8e8c86f7e462.svg?branch=master)](https://buildkite.com/shopify/krane) [![codecov](https://codecov.io/gh/Shopify/kubernetes-deploy/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/kubernetes-deploy)
|
2
2
|
|
3
3
|
> This project used to be called `kubernetes-deploy`. Check out our [migration guide](https://github.com/Shopify/krane/blob/master/1.0-Upgrade.md) for more information including details about breaking changes.
|
4
4
|
|
@@ -73,7 +73,7 @@ If you need the ability to render dynamic values in templates before deploying,
|
|
73
73
|
|
74
74
|
## Prerequisites
|
75
75
|
|
76
|
-
* Ruby 2.
|
76
|
+
* Ruby 2.5+
|
77
77
|
* Your cluster must be running Kubernetes v1.11.0 or higher<sup>1</sup>
|
78
78
|
|
79
79
|
<sup>1</sup> We run integration tests against these Kubernetes versions. You can find our
|
@@ -103,7 +103,7 @@ official compatibility chart below.
|
|
103
103
|
|
104
104
|
*Environment variables:*
|
105
105
|
|
106
|
-
- `$KUBECONFIG`: points to one or multiple valid kubeconfig files that include the context you want to deploy to. File names are separated by colon for Linux and Mac, and semi-colon for Windows. If
|
106
|
+
- `$KUBECONFIG`: points to one or multiple valid kubeconfig files that include the context you want to deploy to. File names are separated by colon for Linux and Mac, and semi-colon for Windows. If omitted, Krane will use the Kubernetes default of `~/.kube/config`.
|
107
107
|
- `$GOOGLE_APPLICATION_CREDENTIALS`: points to the credentials for an authenticated service account (required if your kubeconfig `user`'s auth provider is GCP)
|
108
108
|
|
109
109
|
|
@@ -112,8 +112,7 @@ official compatibility chart below.
|
|
112
112
|
Refer to `krane help` for the authoritative set of options.
|
113
113
|
|
114
114
|
|
115
|
-
- `--filenames / -f [PATHS]`: Accepts a list of directories and/or filenames to specify the set of directories/files that will be deployed.
|
116
|
-
- `--stdin`: Read from STDIN. Can be combined with `-f` Example: `cat templates_from_stdin/*.yml | krane deploy ns ctx -f path/to/dir path/to/file.yml --stdin`
|
115
|
+
- `--filenames / -f [PATHS]`: Accepts a list of directories and/or filenames to specify the set of directories/files that will be deployed, use `-` to specify reading from STDIN.
|
117
116
|
- `--no-prune`: Skips pruning of resources that are no longer in your Kubernetes template set. Not recommended, as it allows your namespace to accumulate cruft that is not reflected in your deploy directory.
|
118
117
|
- `--global-timeout=duration`: Raise a timeout error if it takes longer than _duration_ for any
|
119
118
|
resource to deploy.
|
@@ -138,7 +137,7 @@ If you need to share a namespace with resources which are managed by other tools
|
|
138
137
|
All templates must be YAML formatted.
|
139
138
|
We recommended storing each app's templates in a single directory, `{app root}/config/deploy/{env}`. However, you may use multiple directories.
|
140
139
|
|
141
|
-
If you want dynamic templates, you may render ERB with `krane render` and then pipe that result to `krane deploy
|
140
|
+
If you want dynamic templates, you may render ERB with `krane render` and then pipe that result to `krane deploy -f -`.
|
142
141
|
|
143
142
|
### Customizing behaviour with annotations
|
144
143
|
- `krane.shopify.io/timeout-override`: Override the tool's hard timeout for one specific resource. Both full ISO8601 durations and the time portion of ISO8601 durations are valid. Value must be between 1 second and 24 hours.
|
@@ -329,7 +328,7 @@ Let's walk through what happens when you run the `deploy` task with [this direct
|
|
329
328
|
You can test this out for yourself by running the following command:
|
330
329
|
|
331
330
|
```bash
|
332
|
-
krane render -f test/fixtures/hello-cloud --current-sha 1 | krane deploy my-namespace my-k8s-cluster
|
331
|
+
krane render -f test/fixtures/hello-cloud --current-sha 1 | krane deploy my-namespace my-k8s-cluster -f -
|
333
332
|
```
|
334
333
|
|
335
334
|
As soon as you run this, you'll start seeing some output being streamed to STDERR.
|
@@ -434,8 +433,7 @@ $ krane global-deploy my-k8s-context -f my-template.yml --selector app=krane
|
|
434
433
|
|
435
434
|
Refer to `krane global-deploy help` for the authoritative set of options.
|
436
435
|
|
437
|
-
- `--filenames / -
|
438
|
-
- `--stdin`: Read from STDIN. Can be combined with `-f`
|
436
|
+
- `--filenames / -f [PATHS]`: Accepts a list of directories and/or filenames to specify the set of directories/files that will be deployed. Use `-` to specify STDIN.
|
439
437
|
- `--no-prune`: Skips pruning of resources that are no longer in your Kubernetes template set. Not recommended, as it allows your namespace to accumulate cruft that is not reflected in your deploy directory.
|
440
438
|
- `--selector`: Instructs krane to only prune resources which match the specified label selector, such as `environment=staging`. By using this option, all resource templates must specify matching labels. See [Sharing a namespace](#sharing-a-namespace) below.
|
441
439
|
- `--global-timeout=duration`: Raise a timeout error if it takes longer than _duration_ for any
|
@@ -503,7 +501,7 @@ Based on this specification `krane run` will create a new pod with the entrypoin
|
|
503
501
|
|
504
502
|
*Options:*
|
505
503
|
|
506
|
-
* `--template=TEMPLATE`:
|
504
|
+
* `--template=TEMPLATE`: Specifies the name of the PodTemplate to use.
|
507
505
|
* `--env-vars=ENV_VARS`: Accepts a list of environment variables to be added to the pod template. For example, `--env-vars="ENV=VAL ENV2=VAL2"` will make `ENV` and `ENV2` available to the container.
|
508
506
|
* `--command=`: Override the default command in the container image.
|
509
507
|
* `--no-verify-result`: Skip verification of pod success
|
@@ -542,20 +540,17 @@ krane render -f ./path/to/template/dir/template.yaml.erb > template.yaml
|
|
542
540
|
|
543
541
|
*Options:*
|
544
542
|
|
545
|
-
- `--filenames / -f [PATHS]`: Accepts a list of directories and/or filenames to specify the set of directories/files that will be deployed.
|
546
|
-
- `--stdin`: Read from STDIN. Can be combined with `-f` Example: `cat templates_from_stdin/*.yml | krane render -f path/to/dir path/to/file.yml --stdin`
|
543
|
+
- `--filenames / -f [PATHS]`: Accepts a list of directories and/or filenames to specify the set of directories/files that will be deployed. Use `-` to specify STDIN.
|
547
544
|
- `--bindings=BINDINGS`: Makes additional variables available to your ERB templates. For example, `krane render --bindings=color=blue size=large -f some-template.yaml.erb` will expose `color` and `size` to `some-template.yaml.erb`.
|
548
545
|
- `--current-sha`: Expose SHA `current_sha` in ERB bindings
|
549
546
|
|
550
|
-
You can add additional variables using the `--bindings=BINDINGS` option which can be
|
551
|
-
file path prefixed with an `@` sign. An argument error will be raised if the string argument cannot be parsed, the referenced file does not include a
|
552
|
-
valid extension (`.json`, `.yaml` or `.yml`) or the referenced file does not exist.
|
547
|
+
You can add additional variables using the `--bindings=BINDINGS` option which can be formatted as a string, JSON string or path to a JSON or YAML file. Complex JSON or YAML data will be converted to a Hash for use in templates. To load a file, the argument should include the relative file path prefixed with an `@` sign. An argument error will be raised if the string argument cannot be parsed, the referenced file does not include a valid extension (`.json`, `.yaml` or `.yml`) or the referenced file does not exist.
|
553
548
|
|
554
549
|
#### Bindings examples
|
555
550
|
|
556
551
|
```
|
557
552
|
# Comma separated string. Exposes, 'color' and 'size'
|
558
|
-
$ krane render --bindings=color=blue
|
553
|
+
$ krane render --bindings=color=blue,size=large
|
559
554
|
|
560
555
|
# JSON string. Exposes, 'color' and 'size'
|
561
556
|
$ krane render --bindings='{"color":"blue","size":"large"}'
|
@@ -565,6 +560,9 @@ $ krane render --bindings='@config/production.json'
|
|
565
560
|
|
566
561
|
# Load YAML file from ./config (.yaml or yml supported)
|
567
562
|
$ krane render --bindings='@config/production.yaml'
|
563
|
+
|
564
|
+
# Load multiple files via a space separated string
|
565
|
+
$ krane render --bindings='@config/production.yaml' '@config/common.yaml'
|
568
566
|
```
|
569
567
|
|
570
568
|
#### Using partials
|