krane 1.1.1 → 2.1.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 +27 -33
- data/.rubocop.yml +0 -12
- data/.shopify-build/krane.yml +20 -6
- data/1.0-Upgrade.md +1 -1
- data/CHANGELOG.md +57 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +17 -14
- data/bin/ci +1 -1
- data/bin/test +2 -2
- data/dev.yml +3 -2
- data/krane.gemspec +6 -4
- data/lib/krane/annotation.rb +11 -0
- data/lib/krane/cli/deploy_command.rb +2 -3
- 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 +21 -18
- data/lib/krane/ejson_secret_provisioner.rb +1 -2
- data/lib/krane/global_deploy_task.rb +8 -14
- data/lib/krane/kubeclient_builder.rb +4 -2
- data/lib/krane/kubectl.rb +18 -5
- data/lib/krane/kubernetes_resource.rb +32 -42
- 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/persistent_volume_claim.rb +1 -0
- 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 +9 -5
- data/lib/krane/resource_watcher.rb +1 -1
- data/lib/krane/restart_task.rb +8 -8
- data/lib/krane/runner_task.rb +21 -24
- data/lib/krane/statsd.rb +2 -2
- data/lib/krane/task_config.rb +7 -2
- data/lib/krane/task_config_validator.rb +3 -3
- data/lib/krane/template_sets.rb +1 -1
- data/lib/krane/version.rb +1 -1
- metadata +17 -13
- 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: a3b3d47fb38961012857a5964baadcc19c6e5c147223383430f820af2029cf75
|
4
|
+
data.tar.gz: 94addb8d8743d249ec0437467c8eb5ccf075b41536a329e781ef80fad48dbad3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10038a1f57185f4d78fda538aadb71357f1c7d84b77b9a27873062b7bdd82e06e696666ab639384d84e25c010165bdfdd69533860fc50ce564fc419b09fc01a2
|
7
|
+
data.tar.gz: a12bf652e4503d37fd368f38d6219e48e1755ea688016094849d6558440b6db88aba22aaadfa807ac6e9f1ff1e3ceba171bfbf1cdcd07fe95bf7e2cc553a0e90
|
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
|
@@ -271,7 +264,7 @@ Style/MethodCallWithArgsParentheses:
|
|
271
264
|
- raise
|
272
265
|
- puts
|
273
266
|
Exclude:
|
274
|
-
- Gemfile
|
267
|
+
- '**/Gemfile'
|
275
268
|
|
276
269
|
Style/MethodDefParentheses:
|
277
270
|
EnforcedStyle: require_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
|
|
@@ -678,7 +675,7 @@ Style/LineEndConcatenation:
|
|
678
675
|
Style/MethodCallWithoutArgsParentheses:
|
679
676
|
Enabled: true
|
680
677
|
|
681
|
-
|
678
|
+
Lint/MissingSuper:
|
682
679
|
Enabled: true
|
683
680
|
|
684
681
|
Style/MissingRespondToMissing:
|
@@ -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:
|
@@ -974,7 +965,7 @@ Lint/UselessAccessModifier:
|
|
974
965
|
Lint/UselessAssignment:
|
975
966
|
Enabled: true
|
976
967
|
|
977
|
-
Lint/
|
968
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
978
969
|
Enabled: true
|
979
970
|
|
980
971
|
Lint/UselessElseWithoutRescue:
|
@@ -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 |
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,56 @@
|
|
1
1
|
## next
|
2
2
|
|
3
|
+
## 2.1.0
|
4
|
+
|
5
|
+
*Features*
|
6
|
+
- _(experimental)_ Override deploy method via annotation. This feature is considered alpha and should not be considered stable [#753](https://github.com/Shopify/krane/pull/753)
|
7
|
+
|
8
|
+
*Enhancements*
|
9
|
+
- Increased the number of attempts on kubectl commands during Initializing deploy phase [#749](https://github.com/Shopify/krane/pull/749)
|
10
|
+
- Increased attempts on kubectl apply command during deploy [#751](https://github.com/Shopify/krane/pull/751)
|
11
|
+
- Whitelist context deadline error during kubctl dry run [#754](https://github.com/Shopify/krane/pull/754)
|
12
|
+
- Allow specifying a kubeconfig per task in the internal API [#746](https://github.com/Shopify/krane/pull/746)
|
13
|
+
|
14
|
+
## 2.0.0
|
15
|
+
|
16
|
+
*Breaking Changes*
|
17
|
+
- Remove kubernetes deploy annotation prefix [#738](https://github.com/Shopify/krane/pull/738)
|
18
|
+
|
19
|
+
*Bug Fixes*
|
20
|
+
- Always set a deployment_id, even if the current_sha isn't set [#730](https://github.com/Shopify/krane/pull/730)
|
21
|
+
- YAML string scalars with scientific/e-notation numeric format not properly quoted. [#740](https://github.com/Shopify/krane/pull/740)
|
22
|
+
|
23
|
+
## 1.1.4
|
24
|
+
|
25
|
+
*Bug Fixes*
|
26
|
+
- Properly look up constant on Krane namespace. [#720](https://github.com/Shopify/krane/pull/720)
|
27
|
+
|
28
|
+
*Enhancements*
|
29
|
+
- Allow to configure `image_tag` when using task runner. [#719](https://github.com/Shopify/krane/pull/719)
|
30
|
+
|
31
|
+
## 1.1.3
|
32
|
+
|
33
|
+
*Bug Fixes*
|
34
|
+
- Retry dry-run validation when no error is returned. [#705](https://github.com/Shopify/krane/pull/705)
|
35
|
+
- Stop deploys if ClusterResourceDiscovery's kubectl calls fail. [#701](https://github.com/Shopify/krane/pull/701)
|
36
|
+
|
37
|
+
*Other*
|
38
|
+
- Dropped support for Ruby 2.4 since it will be EoL shortly. [#693](https://github.com/Shopify/krane/pull/693).
|
39
|
+
- Ruby 2.7 support: fix deprecation warnings, add testing. [#710](https://github.com/Shopify/krane/pull/705)
|
40
|
+
|
41
|
+
## 1.1.2
|
42
|
+
*Enhancements*
|
43
|
+
- Don't treat `containerCannotRun` termination reason as a fatal deploy failure, since it is usually transient. [#694](https://github.com/Shopify/krane/pull/694)
|
44
|
+
|
45
|
+
*Bug Fixes*
|
46
|
+
- Help ruby correctly identify kubectl output encoding. [#646](https://github.com/Shopify/krane/pull/646)
|
47
|
+
- Add an override for Job kind for version `batch/v2alpha1` [#696](https://github.com/Shopify/krane/pull/696)
|
48
|
+
|
49
|
+
*Other*
|
50
|
+
- `--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).
|
51
|
+
- Reduces the number of container logs printed for failures from 250 to 25 to reduce noise. [#676](https://github.com/Shopify/krane/pull/676)
|
52
|
+
- Remove hardcoded cloudsql class. [#680](https://github.com/Shopify/krane/pull/680)
|
53
|
+
|
3
54
|
## 1.1.1
|
4
55
|
|
5
56
|
*Enhancements*
|
@@ -28,6 +79,12 @@
|
|
28
79
|
We've renamed the gem and cli to Krane.
|
29
80
|
See our [migration guide](https://github.com/Shopify/krane/blob/master/1.0-Upgrade.md) to help navigate the breaking changes.
|
30
81
|
|
82
|
+
## 1.0.0.pre.2
|
83
|
+
|
84
|
+
*Enhancements*
|
85
|
+
- Relax thor version requirement. ([#731](https://github.com/Shopify/krane/pull/731))
|
86
|
+
- Relax googleauth restriction. ([#731](https://github.com/Shopify/krane/pull/731))
|
87
|
+
|
31
88
|
## 1.0.0.pre.1
|
32
89
|
|
33
90
|
*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.
|
@@ -160,6 +159,11 @@ before the deployment is considered successful.
|
|
160
159
|
- _Default_: `true`
|
161
160
|
- `true`: The custom resource will be deployed in the pre-deploy phase.
|
162
161
|
- All other values: The custom resource will be deployed in the main deployment phase.
|
162
|
+
- `krane.shopify.io/deploy-method-override`: Cause a resource to be deployed by the specified `kubectl` command, instead of the default `apply`.
|
163
|
+
- _Compatibility_: Cannot be used for `PodDisruptionBudget`, since it always uses `create/replace-force`
|
164
|
+
- _Accepted values_: `create`, `replace`, and `replace-force`
|
165
|
+
- _Warning_: Resources whose deploy method is overridden are no longer subject to pruning on deploy.
|
166
|
+
- This feature is _experimental_ and may be removed at any time.
|
163
167
|
|
164
168
|
|
165
169
|
### Running tasks at the beginning of a deploy
|
@@ -329,7 +333,7 @@ Let's walk through what happens when you run the `deploy` task with [this direct
|
|
329
333
|
You can test this out for yourself by running the following command:
|
330
334
|
|
331
335
|
```bash
|
332
|
-
krane render -f test/fixtures/hello-cloud --current-sha 1 | krane deploy my-namespace my-k8s-cluster
|
336
|
+
krane render -f test/fixtures/hello-cloud --current-sha 1 | krane deploy my-namespace my-k8s-cluster -f -
|
333
337
|
```
|
334
338
|
|
335
339
|
As soon as you run this, you'll start seeing some output being streamed to STDERR.
|
@@ -434,8 +438,7 @@ $ krane global-deploy my-k8s-context -f my-template.yml --selector app=krane
|
|
434
438
|
|
435
439
|
Refer to `krane global-deploy help` for the authoritative set of options.
|
436
440
|
|
437
|
-
- `--filenames / -
|
438
|
-
- `--stdin`: Read from STDIN. Can be combined with `-f`
|
441
|
+
- `--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
442
|
- `--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
443
|
- `--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
444
|
- `--global-timeout=duration`: Raise a timeout error if it takes longer than _duration_ for any
|
@@ -542,14 +545,11 @@ krane render -f ./path/to/template/dir/template.yaml.erb > template.yaml
|
|
542
545
|
|
543
546
|
*Options:*
|
544
547
|
|
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`
|
548
|
+
- `--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
549
|
- `--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
550
|
- `--current-sha`: Expose SHA `current_sha` in ERB bindings
|
549
551
|
|
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.
|
552
|
+
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
553
|
|
554
554
|
#### Bindings examples
|
555
555
|
|
@@ -565,6 +565,9 @@ $ krane render --bindings='@config/production.json'
|
|
565
565
|
|
566
566
|
# Load YAML file from ./config (.yaml or yml supported)
|
567
567
|
$ krane render --bindings='@config/production.yaml'
|
568
|
+
|
569
|
+
# Load multiple files via a space separated string
|
570
|
+
$ krane render --bindings='@config/production.yaml' '@config/common.yaml'
|
568
571
|
```
|
569
572
|
|
570
573
|
#### Using partials
|