kubernetes-deploy 0.27.0 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildkite/pipeline.nightly.yml +7 -7
- data/.shopify-build/kubernetes-deploy.yml +7 -7
- data/CHANGELOG.md +23 -0
- data/README.md +16 -11
- data/Rakefile +8 -1
- data/bin/setup +2 -2
- data/bin/test +3 -0
- data/exe/krane +5 -0
- data/exe/kubernetes-restart +1 -1
- data/kubernetes-deploy.gemspec +1 -0
- data/lib/krane.rb +5 -0
- data/lib/krane/cli/krane.rb +49 -0
- data/lib/krane/cli/restart_command.rb +34 -0
- data/lib/krane/cli/version_command.rb +13 -0
- data/lib/kubernetes-deploy/common.rb +1 -1
- data/lib/kubernetes-deploy/deploy_task.rb +11 -3
- data/lib/kubernetes-deploy/kubernetes_resource.rb +67 -12
- data/lib/kubernetes-deploy/kubernetes_resource/custom_resource_definition.rb +12 -14
- data/lib/kubernetes-deploy/kubernetes_resource/deployment.rb +7 -5
- data/lib/kubernetes-deploy/kubernetes_resource/secret.rb +1 -0
- data/lib/kubernetes-deploy/kubernetes_resource/service.rb +11 -0
- data/lib/kubernetes-deploy/render_task.rb +3 -3
- data/lib/kubernetes-deploy/restart_task.rb +22 -11
- data/lib/kubernetes-deploy/runner_task.rb +12 -34
- data/lib/kubernetes-deploy/runner_task_config_validator.rb +25 -0
- data/lib/kubernetes-deploy/version.rb +1 -1
- metadata +23 -6
- data/NO-BINAUTH +0 -0
- data/lib/kubernetes-deploy/kubernetes_resource/elasticsearch.rb +0 -12
- data/lib/kubernetes-deploy/kubernetes_resource/statefulservice.rb +0 -12
- data/lib/kubernetes-deploy/kubernetes_resource/topic.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 825f058c113d4ae975ee5937866b639ac4d705f5cf9493ab414b56a183bd862e
|
4
|
+
data.tar.gz: 2a6e43245a95f182e63d9f81d085f62aede3d16c74f4184d2f07bb6f0db55563
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbd772b8de088a986c62075c1443069be9fed802cf04958144ff377c26f3f594e9e2a6b5e64e1570452e936016e03fdc079b7dad986019cc27473e22ebf3bec1
|
7
|
+
data.tar.gz: ff2824c32e6421056842a190fe8658f0fc903b3c866919b0a83f4bb4446b76d5d5cffad739fcba0c1564bb5079c02c21eb2022df30f379f9876e190157fe1ece
|
@@ -1,4 +1,11 @@
|
|
1
1
|
steps:
|
2
|
+
- name: 'Run Test Suite (:kubernetes: 1.15-latest)'
|
3
|
+
command: bin/ci
|
4
|
+
agents:
|
5
|
+
queue: k8s-ci
|
6
|
+
env:
|
7
|
+
LOGGING_LEVEL: 4
|
8
|
+
KUBERNETES_VERSION: v1.15-latest
|
2
9
|
- name: 'Run Test Suite (:kubernetes: 1.14-latest)'
|
3
10
|
command: bin/ci
|
4
11
|
agents:
|
@@ -27,10 +34,3 @@ steps:
|
|
27
34
|
env:
|
28
35
|
LOGGING_LEVEL: 4
|
29
36
|
KUBERNETES_VERSION: v1.11-latest
|
30
|
-
- name: 'Run Test Suite (:kubernetes: 1.10-latest)'
|
31
|
-
command: bin/ci
|
32
|
-
agents:
|
33
|
-
queue: minikube-ci
|
34
|
-
env:
|
35
|
-
LOGGING_LEVEL: 4
|
36
|
-
KUBERNETES_VERSION: v1.10-latest
|
@@ -9,6 +9,13 @@ steps:
|
|
9
9
|
- bundle exec rubocop
|
10
10
|
dependencies:
|
11
11
|
- bundler
|
12
|
+
- label: 'Run Test Suite (:kubernetes: 1.15-latest)'
|
13
|
+
command: bin/ci
|
14
|
+
agents:
|
15
|
+
queue: k8s-ci
|
16
|
+
env:
|
17
|
+
LOGGING_LEVEL: "4"
|
18
|
+
KUBERNETES_VERSION: v1.15-latest
|
12
19
|
- label: 'Run Test Suite (:kubernetes: 1.14-latest)'
|
13
20
|
command: bin/ci
|
14
21
|
agents:
|
@@ -37,10 +44,3 @@ steps:
|
|
37
44
|
env:
|
38
45
|
LOGGING_LEVEL: "4"
|
39
46
|
KUBERNETES_VERSION: v1.11-latest
|
40
|
-
- label: 'Run Test Suite (:kubernetes: 1.10-latest)'
|
41
|
-
command: bin/ci
|
42
|
-
agents:
|
43
|
-
queue: minikube-ci
|
44
|
-
env:
|
45
|
-
LOGGING_LEVEL: "4"
|
46
|
-
KUBERNETES_VERSION: v1.10-latest
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
## next
|
2
2
|
|
3
|
+
*Important!*
|
4
|
+
- The next release will be 1.0.0, which means that master will contain breaking changes.
|
5
|
+
|
6
|
+
## 0.28.0
|
7
|
+
|
8
|
+
*Enhancements*
|
9
|
+
- Officially support Kubernetes 1.15 ([#546](https://github.com/Shopify/kubernetes-deploy/pull/546))
|
10
|
+
- Make sure that we only declare a Service of type LoadBalancer as deployed after its IP address is published. [#547](https://github.com/Shopify/kubernetes-deploy/pull/547)
|
11
|
+
- Add more validations to `RunnerTask`. [#554](https://github.com/Shopify/kubernetes-deploy/pull/554)
|
12
|
+
- Validate secrets with `--server-dry-run` on supported clusters. [#553](https://github.com/Shopify/kubernetes-deploy/pull/553)
|
13
|
+
*Bug Fixes*
|
14
|
+
- Fix a bug in rendering where we failed to add a yaml doc separator (`---`) to
|
15
|
+
an implicit document if there are multiple documents in the file.
|
16
|
+
([#551](https://github.com/Shopify/kubernetes-deploy/pull/551))
|
17
|
+
|
18
|
+
*Other*
|
19
|
+
- Kubernetes 1.10 is no longer officially supported as of this version ([#546](https://github.com/Shopify/kubernetes-deploy/pull/546))
|
20
|
+
- We've added a new Krane cli. This code is in alpha. We are providing
|
21
|
+
no warranty at this time and reserve the right to make major breaking changes including
|
22
|
+
removing it entirely at any time. ([#256](https://github.com/Shopify/kubernetes-deploy/issues/256))
|
23
|
+
- Deprecate `kubernetes-deploy.shopify.io` annotations in favour of `krane.shopify.io` ([#539](https://github.com/Shopify/kubernetes-deploy/pull/539))
|
24
|
+
|
3
25
|
## 0.27.0
|
26
|
+
|
4
27
|
*Enhancements*
|
5
28
|
- (alpha) Introduce a new `-f` flag for `kubernetes-deploy`. Allows passing in of multiple directories and/or filenames. Currently only usable by `kubernetes-deploy`, not `kubernetes-render`. [#514](https://github.com/Shopify/kubernetes-deploy/pull/514)
|
6
29
|
- Initial implementation of shared task validation objects. [#533](https://github.com/Shopify/kubernetes-deploy/pull/533)
|
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# krane
|
2
|
+
|
3
|
+
As this project approaches the v1.0 milestone, we're excited to announce that `kubernetes-deploy` will be [officially renamed as `krane`](https://github.com/Shopify/kubernetes-deploy/issues/30#issuecomment-468750341). Follow the [1.0 requirement label](https://github.com/Shopify/kubernetes-deploy/issues?q=is%3Aissue+is%3Aopen+label%3A%22%3Arocket%3A+1.0+requirement%22) to keep up with the progress.
|
4
|
+
|
1
5
|
# kubernetes-deploy [![Build status](https://badge.buildkite.com/61937e40a1fc69754d9d198be120543d6de310de2ba8d3cb0e.svg?branch=master)](https://buildkite.com/shopify/kubernetes-deploy) [![codecov](https://codecov.io/gh/Shopify/kubernetes-deploy/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/kubernetes-deploy)
|
2
6
|
|
3
7
|
`kubernetes-deploy` is a command line tool that helps you ship changes to a Kubernetes namespace and understand the result. At Shopify, we use it within our much-beloved, open-source [Shipit](https://github.com/Shopify/shipit-engine#kubernetes) deployment app.
|
@@ -68,7 +72,7 @@ This repo also includes related tools for [running tasks](#kubernetes-run) and [
|
|
68
72
|
## Prerequisites
|
69
73
|
|
70
74
|
* Ruby 2.3+
|
71
|
-
* Your cluster must be running Kubernetes v1.
|
75
|
+
* Your cluster must be running Kubernetes v1.11.0 or higher<sup>1</sup>
|
72
76
|
* Each app must have a deploy directory containing its Kubernetes templates (see [Templates](#using-templates-and-variables))
|
73
77
|
|
74
78
|
<sup>1</sup> We run integration tests against these Kubernetes versions. You can find our
|
@@ -81,10 +85,11 @@ official compatibility chart below.
|
|
81
85
|
| 1.7 | 0.20.6 |
|
82
86
|
| 1.8 | 0.21.1 |
|
83
87
|
| 1.9 | 0.24.0 |
|
88
|
+
| 1.10 | 0.27.0 |
|
84
89
|
|
85
90
|
## Installation
|
86
91
|
|
87
|
-
1. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl) (requires v1.
|
92
|
+
1. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl) (requires v1.11.0 or higher) and make sure it is available in your $PATH
|
88
93
|
2. Set up your [kubeconfig file](https://kubernetes.io/docs/tasks/access-application-cluster/authenticate-across-clusters-kubeconfig/) for access to your cluster(s).
|
89
94
|
3. `gem install kubernetes-deploy`
|
90
95
|
|
@@ -228,10 +233,10 @@ This is a limitation of the current implementation.
|
|
228
233
|
|
229
234
|
|
230
235
|
### Customizing behaviour with annotations
|
231
|
-
- `
|
236
|
+
- `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.
|
232
237
|
- _Example values_: 45s / 3m / 1h / PT0.25H
|
233
238
|
- _Compatibility_: all resource types
|
234
|
-
- `
|
239
|
+
- `krane.shopify.io/required-rollout`: Modifies how much of the rollout needs to finish
|
235
240
|
before the deployment is considered successful.
|
236
241
|
- _Compatibility_: Deployment
|
237
242
|
- `full`: The deployment is successful when all pods in the new `replicaSet` are ready.
|
@@ -242,11 +247,11 @@ before the deployment is considered successful.
|
|
242
247
|
that use the `RollingUpdate` strategy.
|
243
248
|
- Percent (e.g. 90%): The deploy is successful when the number of new pods that are ready is equal to
|
244
249
|
`spec.replicas` * Percent.
|
245
|
-
- `
|
250
|
+
- `krane.shopify.io/prunable`: Allows a Custom Resource to be pruned during deployment.
|
246
251
|
- _Compatibility_: Custom Resource Definition
|
247
252
|
- `true`: The custom resource will be pruned if the resource is not in the deploy directory.
|
248
253
|
- All other values: The custom resource will not be pruned.
|
249
|
-
- `
|
254
|
+
- `krane.shopify.io/predeployed`: Causes a Custom Resource to be deployed in the pre-deploy phase.
|
250
255
|
- _Compatibility_: Custom Resource Definition
|
251
256
|
- _Default_: `true`
|
252
257
|
- `true`: The custom resource will be deployed in the pre-deploy phase.
|
@@ -335,12 +340,12 @@ This feature is only available on clusters running Kubernetes 1.11+ since it rel
|
|
335
340
|
*Requirements:*
|
336
341
|
|
337
342
|
* The custom resource must expose a `status` subresource with an `observedGeneration` field.
|
338
|
-
* The `
|
339
|
-
* (optional) The `
|
343
|
+
* The `krane.shopify.io/instance-rollout-conditions` annotation must be present on the CRD that defines the custom resource.
|
344
|
+
* (optional) The `krane.shopify.io/instance-timeout` annotation can be added to the CRD that defines the custom resource to override the global default timeout for all instances of that resource. This annotation can use ISO8601 format or unprefixed ISO8601 time components (e.g. '1H', '60S').
|
340
345
|
|
341
346
|
#### Specifying pass/fail conditions
|
342
347
|
|
343
|
-
The presence of a valid `
|
348
|
+
The presence of a valid `krane.shopify.io/instance-rollout-conditions` annotation on a CRD will cause kubernetes-deploy to monitor the rollout of all instances of that custom resource. Its value can either be `"true"` (giving you the defaults described in the next section) or a valid JSON string with the following format:
|
344
349
|
```
|
345
350
|
'{
|
346
351
|
"success_conditions": [
|
@@ -364,7 +369,7 @@ You **must** ensure that your custom resource controller sets `.status.observedG
|
|
364
369
|
|
365
370
|
#### Example
|
366
371
|
|
367
|
-
As an example, the following is the default configuration that will be used if you set `
|
372
|
+
As an example, the following is the default configuration that will be used if you set `krane.shopify.io/instance-rollout-conditions: "true"` on the CRD that defines the custom resources you wish to monitor:
|
368
373
|
|
369
374
|
```
|
370
375
|
'{
|
@@ -462,7 +467,7 @@ Refer to `kubernetes-restart --help` for the authoritative set of options.
|
|
462
467
|
|
463
468
|
## Prerequisites
|
464
469
|
|
465
|
-
* You've already deployed a [`PodTemplate`](https://v1-10.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.
|
470
|
+
* You've already deployed a [`PodTemplate`](https://v1-10.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#podtemplate-v1-core) object with field `template` containing a `Pod` specification that does not include the `apiVersion` or `kind` parameters. An example is provided in this repo in `test/fixtures/hello-cloud/template-runner.yml`.
|
466
471
|
* The `Pod` specification in that template has a container named `task-runner`.
|
467
472
|
|
468
473
|
Based on this specification `kubernetes-run` will create a new pod with the entrypoint of the `task-runner ` container overridden with the supplied arguments.
|
data/Rakefile
CHANGED
@@ -23,7 +23,14 @@ Rake::TestTask.new(:unit_test) do |t|
|
|
23
23
|
t.test_files = FileList['test/unit/**/*_test.rb']
|
24
24
|
end
|
25
25
|
|
26
|
+
desc("Run cli tests")
|
27
|
+
Rake::TestTask.new(:cli_test) do |t|
|
28
|
+
t.libs << "test"
|
29
|
+
t.libs << "lib"
|
30
|
+
t.test_files = FileList['test/exe/**/*_test.rb']
|
31
|
+
end
|
32
|
+
|
26
33
|
desc("Run all tests")
|
27
|
-
task(test: %w(unit_test serial_integration_test integration_test))
|
34
|
+
task(test: %w(unit_test serial_integration_test integration_test cli_test))
|
28
35
|
|
29
36
|
task(default: :test)
|
data/bin/setup
CHANGED
@@ -9,8 +9,8 @@ if [ ! -x "$(which minikube)" ]; then
|
|
9
9
|
fi
|
10
10
|
|
11
11
|
if [ ! -x "$(which kubectl)" ]; then
|
12
|
-
echo -e "\n\033[0;33mPlease install kubectl version 1.
|
12
|
+
echo -e "\n\033[0;33mPlease install kubectl version 1.11.0 or higher:\nhttps://kubernetes.io/docs/user-guide/prereqs/\033[0m"
|
13
13
|
else
|
14
14
|
KUBECTL_VERSION=$(kubectl version --short --client | grep -oe "v[[:digit:]\.]\+")
|
15
|
-
echo -e "\n\033[0;32mKubectl version $KUBECTL_VERSION is already installed. This gem requires version v1.
|
15
|
+
echo -e "\n\033[0;32mKubectl version $KUBECTL_VERSION is already installed. This gem requires version v1.11.0 or greater.\033[0m"
|
16
16
|
fi
|
data/bin/test
CHANGED
data/exe/krane
ADDED
data/exe/kubernetes-restart
CHANGED
@@ -25,7 +25,7 @@ context = ARGV[1]
|
|
25
25
|
restart = KubernetesDeploy::RestartTask.new(namespace: namespace, context: context,
|
26
26
|
max_watch_seconds: max_watch_seconds)
|
27
27
|
begin
|
28
|
-
restart.
|
28
|
+
restart.run!(raw_deployments, selector: selector)
|
29
29
|
rescue KubernetesDeploy::DeploymentTimeoutError
|
30
30
|
exit(70)
|
31
31
|
rescue KubernetesDeploy::FatalDeploymentError
|
data/kubernetes-deploy.gemspec
CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency("oj", "~> 3.0")
|
33
33
|
spec.add_dependency("concurrent-ruby", "~> 1.1")
|
34
34
|
spec.add_dependency("jsonpath", "~> 0.9.6")
|
35
|
+
spec.add_dependency("thor", "~> 0.20.3")
|
35
36
|
|
36
37
|
spec.add_development_dependency("bundler")
|
37
38
|
spec.add_development_dependency("rake", "~> 10.0")
|
data/lib/krane.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'krane'
|
4
|
+
require 'thor'
|
5
|
+
require 'krane/cli/version_command'
|
6
|
+
require 'krane/cli/restart_command'
|
7
|
+
|
8
|
+
module Krane
|
9
|
+
module CLI
|
10
|
+
class Krane < Thor
|
11
|
+
TIMEOUT_EXIT_CODE = 70
|
12
|
+
FAILURE_EXIT_CODE = 1
|
13
|
+
|
14
|
+
package_name "Krane"
|
15
|
+
|
16
|
+
def self.expand_options(task_options)
|
17
|
+
task_options.each { |option_name, config| method_option(option_name, config) }
|
18
|
+
end
|
19
|
+
|
20
|
+
desc("version", "Prints the version")
|
21
|
+
expand_options(VersionCommand::OPTIONS)
|
22
|
+
def version
|
23
|
+
VersionCommand.from_options(options)
|
24
|
+
end
|
25
|
+
|
26
|
+
desc("restart NAMESPACE CONTEXT", "Restart the pods in one or more deployments")
|
27
|
+
expand_options(RestartCommand::OPTIONS)
|
28
|
+
def restart(namespace, context)
|
29
|
+
rescue_and_exit do
|
30
|
+
RestartCommand.from_options(namespace, context, options)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.exit_on_failure?
|
35
|
+
true
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def rescue_and_exit
|
41
|
+
yield
|
42
|
+
rescue KubernetesDeploy::DeploymentTimeoutError
|
43
|
+
exit(TIMEOUT_EXIT_CODE)
|
44
|
+
rescue KubernetesDeploy::FatalDeploymentError
|
45
|
+
exit(FAILURE_EXIT_CODE)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Krane
|
4
|
+
module CLI
|
5
|
+
class RestartCommand
|
6
|
+
DEFAULT_RESTART_TIMEOUT = '300s'
|
7
|
+
OPTIONS = {
|
8
|
+
"deployments" => { type: :array, banner: "list of deployments",
|
9
|
+
desc: "List of workload names to restart" },
|
10
|
+
"global-timeout" => { type: :string, banner: "duration", default: DEFAULT_RESTART_TIMEOUT,
|
11
|
+
desc: "Max duration to monitor workloads correctly restarted" },
|
12
|
+
"selector" => { type: :string, banner: "'label=value'",
|
13
|
+
desc: "Select workloads by selector(s)" },
|
14
|
+
"verify-result" => { type: :boolean, default: true,
|
15
|
+
desc: "Verify workloads correctly restarted" },
|
16
|
+
}
|
17
|
+
|
18
|
+
def self.from_options(namespace, context, options)
|
19
|
+
require 'kubernetes-deploy/restart_task'
|
20
|
+
selector = KubernetesDeploy::LabelSelector.parse(options[:selector]) if options[:selector]
|
21
|
+
restart = KubernetesDeploy::RestartTask.new(
|
22
|
+
namespace: namespace,
|
23
|
+
context: context,
|
24
|
+
max_watch_seconds: KubernetesDeploy::DurationParser.new(options["global-timeout"]).parse!.to_i,
|
25
|
+
)
|
26
|
+
restart.run!(
|
27
|
+
options[:deployments],
|
28
|
+
selector: selector,
|
29
|
+
verify_result: options["verify-result"]
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -24,9 +24,6 @@ require 'kubernetes-deploy/kubernetes_resource'
|
|
24
24
|
service_account
|
25
25
|
daemon_set
|
26
26
|
resource_quota
|
27
|
-
elasticsearch
|
28
|
-
statefulservice
|
29
|
-
topic
|
30
27
|
stateful_set
|
31
28
|
cron_job
|
32
29
|
job
|
@@ -255,6 +252,11 @@ module KubernetesDeploy
|
|
255
252
|
KubernetesDeploy::Concurrency.split_across_threads(resources) do |r|
|
256
253
|
r.validate_definition(kubectl, selector: @selector)
|
257
254
|
end
|
255
|
+
|
256
|
+
resources.select(&:has_warnings?).each do |resource|
|
257
|
+
record_warnings(warning: resource.validation_warning_msg, filename: File.basename(resource.file_path))
|
258
|
+
end
|
259
|
+
|
258
260
|
failed_resources = resources.select(&:validation_failed?)
|
259
261
|
return unless failed_resources.present?
|
260
262
|
|
@@ -319,6 +321,12 @@ module KubernetesDeploy
|
|
319
321
|
@logger.summary.add_paragraph(debug_msg)
|
320
322
|
end
|
321
323
|
|
324
|
+
def record_warnings(warning:, filename:)
|
325
|
+
warn_msg = "Template warning: #{filename}\n"
|
326
|
+
warn_msg += "> Warning message:\n#{FormattedLogger.indent_four(warning)}"
|
327
|
+
@logger.summary.add_paragraph(ColorizedString.new(warn_msg).yellow)
|
328
|
+
end
|
329
|
+
|
322
330
|
def validate_configuration(allow_protected_ns:, prune:)
|
323
331
|
errors = []
|
324
332
|
errors += kubeclient_builder.validate_config_files
|
@@ -15,6 +15,8 @@ module KubernetesDeploy
|
|
15
15
|
GLOBAL = false
|
16
16
|
TIMEOUT = 5.minutes
|
17
17
|
LOG_LINE_COUNT = 250
|
18
|
+
SERVER_DRY_RUN_DISABLED_ERROR =
|
19
|
+
/(unknown flag: --server-dry-run)|(doesn't support dry-run)|(dryRun alpha feature is disabled)/
|
18
20
|
|
19
21
|
DISABLE_FETCHING_LOG_INFO = 'DISABLE_FETCHING_LOG_INFO'
|
20
22
|
DISABLE_FETCHING_EVENT_INFO = 'DISABLE_FETCHING_EVENT_INFO'
|
@@ -30,9 +32,12 @@ module KubernetesDeploy
|
|
30
32
|
If you have reason to believe it will succeed, retry the deploy to continue to monitor the rollout.
|
31
33
|
MSG
|
32
34
|
|
33
|
-
|
35
|
+
TIMEOUT_OVERRIDE_ANNOTATION_SUFFIX = "timeout-override"
|
36
|
+
TIMEOUT_OVERRIDE_ANNOTATION_DEPRECATED = "kubernetes-deploy.shopify.io/#{TIMEOUT_OVERRIDE_ANNOTATION_SUFFIX}"
|
37
|
+
TIMEOUT_OVERRIDE_ANNOTATION = "krane.shopify.io/#{TIMEOUT_OVERRIDE_ANNOTATION_SUFFIX}"
|
34
38
|
LAST_APPLIED_ANNOTATION = "kubectl.kubernetes.io/last-applied-configuration"
|
35
39
|
SENSITIVE_TEMPLATE_CONTENT = false
|
40
|
+
SERVER_DRY_RUNNABLE = false
|
36
41
|
|
37
42
|
class << self
|
38
43
|
def build(namespace:, context:, definition:, logger:, statsd_tags:, crd: nil)
|
@@ -93,7 +98,8 @@ module KubernetesDeploy
|
|
93
98
|
|
94
99
|
def timeout_override
|
95
100
|
return @timeout_override if defined?(@timeout_override)
|
96
|
-
|
101
|
+
|
102
|
+
@timeout_override = DurationParser.new(krane_annotation_value(TIMEOUT_OVERRIDE_ANNOTATION_SUFFIX)).parse!.to_i
|
97
103
|
rescue DurationParser::ParsingError
|
98
104
|
@timeout_override = nil
|
99
105
|
end
|
@@ -113,6 +119,7 @@ module KubernetesDeploy
|
|
113
119
|
@statsd_report_done = false
|
114
120
|
@disappeared = false
|
115
121
|
@validation_errors = []
|
122
|
+
@validation_warnings = []
|
116
123
|
@instance_data = {}
|
117
124
|
end
|
118
125
|
|
@@ -122,12 +129,22 @@ module KubernetesDeploy
|
|
122
129
|
|
123
130
|
def validate_definition(kubectl, selector: nil)
|
124
131
|
@validation_errors = []
|
132
|
+
@validation_warnings = []
|
125
133
|
validate_selector(selector) if selector
|
126
134
|
validate_timeout_annotation
|
135
|
+
validate_annotation_version
|
127
136
|
validate_spec_with_kubectl(kubectl)
|
128
137
|
@validation_errors.present?
|
129
138
|
end
|
130
139
|
|
140
|
+
def validation_warning_msg
|
141
|
+
@validation_warnings.join("\n")
|
142
|
+
end
|
143
|
+
|
144
|
+
def has_warnings?
|
145
|
+
@validation_warnings.present?
|
146
|
+
end
|
147
|
+
|
131
148
|
def validation_error_msg
|
132
149
|
@validation_errors.join("\n")
|
133
150
|
end
|
@@ -329,6 +346,10 @@ module KubernetesDeploy
|
|
329
346
|
self.class::SENSITIVE_TEMPLATE_CONTENT
|
330
347
|
end
|
331
348
|
|
349
|
+
def server_dry_runnable?
|
350
|
+
self.class::SERVER_DRY_RUNNABLE
|
351
|
+
end
|
352
|
+
|
332
353
|
class Event
|
333
354
|
EVENT_SEPARATOR = "ENDEVENT--BEGINEVENT"
|
334
355
|
FIELD_SEPARATOR = "ENDFIELD--BEGINFIELD"
|
@@ -396,20 +417,44 @@ module KubernetesDeploy
|
|
396
417
|
private
|
397
418
|
|
398
419
|
def validate_timeout_annotation
|
399
|
-
|
420
|
+
timeout_override_value = krane_annotation_value(TIMEOUT_OVERRIDE_ANNOTATION_SUFFIX)
|
421
|
+
timeout_annotation_key = krane_annotation_key(TIMEOUT_OVERRIDE_ANNOTATION_SUFFIX)
|
422
|
+
return if timeout_override_value.nil?
|
400
423
|
|
401
|
-
override = DurationParser.new(
|
424
|
+
override = DurationParser.new(timeout_override_value).parse!
|
402
425
|
if override <= 0
|
403
|
-
@validation_errors << "#{
|
426
|
+
@validation_errors << "#{timeout_annotation_key} annotation is invalid: Value must be greater than 0"
|
404
427
|
elsif override > 24.hours
|
405
|
-
@validation_errors << "#{
|
428
|
+
@validation_errors << "#{timeout_annotation_key} annotation is invalid: Value must be less than 24h"
|
406
429
|
end
|
407
430
|
rescue DurationParser::ParsingError => e
|
408
|
-
@validation_errors << "#{
|
431
|
+
@validation_errors << "#{timeout_annotation_key} annotation is invalid: #{e}"
|
432
|
+
end
|
433
|
+
|
434
|
+
def validate_annotation_version
|
435
|
+
return if validation_warning_msg.include?("annotations is deprecated")
|
436
|
+
annotation_keys = @definition.dig("metadata", "annotations")&.keys
|
437
|
+
annotation_keys&.each do |annotation|
|
438
|
+
if annotation.include?("kubernetes-deploy.shopify.io")
|
439
|
+
annotation_prefix = annotation.split('/').first
|
440
|
+
@validation_warnings << "#{annotation_prefix} as a prefix for annotations is deprecated: "\
|
441
|
+
"Use the 'krane.shopify.io' annotation prefix instead"
|
442
|
+
return
|
443
|
+
end
|
444
|
+
end
|
445
|
+
end
|
446
|
+
|
447
|
+
def krane_annotation_value(suffix)
|
448
|
+
@definition.dig("metadata", "annotations", "kubernetes-deploy.shopify.io/#{suffix}") ||
|
449
|
+
@definition.dig("metadata", "annotations", "krane.shopify.io/#{suffix}")
|
409
450
|
end
|
410
451
|
|
411
|
-
def
|
412
|
-
@definition.dig("metadata", "annotations",
|
452
|
+
def krane_annotation_key(suffix)
|
453
|
+
if @definition.dig("metadata", "annotations", "kubernetes-deploy.shopify.io/#{suffix}")
|
454
|
+
"kubernetes-deploy.shopify.io/#{suffix}"
|
455
|
+
elsif @definition.dig("metadata", "annotations", "krane.shopify.io/#{suffix}")
|
456
|
+
"krane.shopify.io/#{suffix}"
|
457
|
+
end
|
413
458
|
end
|
414
459
|
|
415
460
|
def validate_selector(selector)
|
@@ -426,9 +471,13 @@ module KubernetesDeploy
|
|
426
471
|
end
|
427
472
|
|
428
473
|
def validate_spec_with_kubectl(kubectl)
|
429
|
-
|
430
|
-
|
431
|
-
|
474
|
+
_, err, st = validate_with_dry_run_option(kubectl, "--dry-run")
|
475
|
+
if st.success? && server_dry_runnable?
|
476
|
+
_, err, st = validate_with_dry_run_option(kubectl, "--server-dry-run")
|
477
|
+
if st.success? || err.match(SERVER_DRY_RUN_DISABLED_ERROR)
|
478
|
+
return true
|
479
|
+
end
|
480
|
+
end
|
432
481
|
|
433
482
|
return true if st.success?
|
434
483
|
@validation_errors << if sensitive_template_content?
|
@@ -438,6 +487,12 @@ module KubernetesDeploy
|
|
438
487
|
end
|
439
488
|
end
|
440
489
|
|
490
|
+
def validate_with_dry_run_option(kubectl, dry_run_option)
|
491
|
+
command = ["apply", "-f", file_path, dry_run_option, "--output=name"]
|
492
|
+
kubectl.run(*command, log_failure: false, output_is_sensitive: sensitive_template_content?,
|
493
|
+
retry_whitelist: [:client_timeout], attempts: 3)
|
494
|
+
end
|
495
|
+
|
441
496
|
def labels
|
442
497
|
@definition.dig("metadata", "labels")
|
443
498
|
end
|
@@ -2,8 +2,9 @@
|
|
2
2
|
module KubernetesDeploy
|
3
3
|
class CustomResourceDefinition < KubernetesResource
|
4
4
|
TIMEOUT = 2.minutes
|
5
|
-
|
6
|
-
|
5
|
+
ROLLOUT_CONDITIONS_ANNOTATION_SUFFIX = "instance-rollout-conditions"
|
6
|
+
ROLLOUT_CONDITIONS_ANNOTATION = "krane.shopify.io/#{ROLLOUT_CONDITIONS_ANNOTATION_SUFFIX}"
|
7
|
+
TIMEOUT_FOR_INSTANCE_ANNOTATION = "krane.shopify.io/instance-timeout"
|
7
8
|
GLOBAL = true
|
8
9
|
|
9
10
|
def deploy_succeeded?
|
@@ -19,7 +20,7 @@ module KubernetesDeploy
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def timeout_for_instance
|
22
|
-
timeout =
|
23
|
+
timeout = krane_annotation_value("instance-timeout")
|
23
24
|
DurationParser.new(timeout).parse!.to_i
|
24
25
|
rescue DurationParser::ParsingError
|
25
26
|
nil
|
@@ -50,20 +51,20 @@ module KubernetesDeploy
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def prunable?
|
53
|
-
prunable =
|
54
|
+
prunable = krane_annotation_value("prunable")
|
54
55
|
prunable == "true"
|
55
56
|
end
|
56
57
|
|
57
58
|
def predeployed?
|
58
|
-
predeployed =
|
59
|
+
predeployed = krane_annotation_value("predeployed")
|
59
60
|
predeployed.nil? || predeployed == "true"
|
60
61
|
end
|
61
62
|
|
62
63
|
def rollout_conditions
|
63
64
|
return @rollout_conditions if defined?(@rollout_conditions)
|
64
65
|
|
65
|
-
@rollout_conditions = if
|
66
|
-
RolloutConditions.from_annotation(
|
66
|
+
@rollout_conditions = if krane_annotation_value(ROLLOUT_CONDITIONS_ANNOTATION_SUFFIX)
|
67
|
+
RolloutConditions.from_annotation(krane_annotation_value(ROLLOUT_CONDITIONS_ANNOTATION_SUFFIX))
|
67
68
|
end
|
68
69
|
rescue RolloutConditionsError
|
69
70
|
@rollout_conditions = nil
|
@@ -74,12 +75,13 @@ module KubernetesDeploy
|
|
74
75
|
|
75
76
|
validate_rollout_conditions
|
76
77
|
rescue RolloutConditionsError => e
|
77
|
-
@validation_errors << "Annotation #{
|
78
|
+
@validation_errors << "Annotation #{krane_annotation_key(ROLLOUT_CONDITIONS_ANNOTATION_SUFFIX)} "\
|
79
|
+
"on #{name} is invalid: #{e}"
|
78
80
|
end
|
79
81
|
|
80
82
|
def validate_rollout_conditions
|
81
|
-
if
|
82
|
-
conditions = RolloutConditions.from_annotation(
|
83
|
+
if krane_annotation_value(ROLLOUT_CONDITIONS_ANNOTATION_SUFFIX) && @rollout_conditions_validated.nil?
|
84
|
+
conditions = RolloutConditions.from_annotation(krane_annotation_value(ROLLOUT_CONDITIONS_ANNOTATION_SUFFIX))
|
83
85
|
conditions.validate!
|
84
86
|
end
|
85
87
|
|
@@ -96,9 +98,5 @@ module KubernetesDeploy
|
|
96
98
|
def names_accepted_status
|
97
99
|
names_accepted_condition["status"]
|
98
100
|
end
|
99
|
-
|
100
|
-
def rollout_conditions_annotation
|
101
|
-
@definition.dig("metadata", "annotations", ROLLOUT_CONDITIONS_ANNOTATION)
|
102
|
-
end
|
103
101
|
end
|
104
102
|
end
|
@@ -4,7 +4,9 @@ require 'kubernetes-deploy/kubernetes_resource/replica_set'
|
|
4
4
|
module KubernetesDeploy
|
5
5
|
class Deployment < KubernetesResource
|
6
6
|
TIMEOUT = 7.minutes
|
7
|
-
|
7
|
+
REQUIRED_ROLLOUT_ANNOTATION_SUFFIX = "required-rollout"
|
8
|
+
REQUIRED_ROLLOUT_ANNOTATION_DEPRECATED = "kubernetes-deploy.shopify.io/#{REQUIRED_ROLLOUT_ANNOTATION_SUFFIX}"
|
9
|
+
REQUIRED_ROLLOUT_ANNOTATION = "krane.shopify.io/#{REQUIRED_ROLLOUT_ANNOTATION_SUFFIX}"
|
8
10
|
REQUIRED_ROLLOUT_TYPES = %w(maxUnavailable full none).freeze
|
9
11
|
DEFAULT_REQUIRED_ROLLOUT = 'full'
|
10
12
|
|
@@ -103,8 +105,8 @@ module KubernetesDeploy
|
|
103
105
|
|
104
106
|
strategy = @definition.dig('spec', 'strategy', 'type').to_s
|
105
107
|
if required_rollout.downcase == 'maxunavailable' && strategy.present? && strategy.downcase != 'rollingupdate'
|
106
|
-
@validation_errors << "'#{
|
107
|
-
|
108
|
+
@validation_errors << "'#{krane_annotation_key(REQUIRED_ROLLOUT_ANNOTATION_SUFFIX)}: #{required_rollout}' "\
|
109
|
+
"is incompatible with strategy '#{strategy}'"
|
108
110
|
end
|
109
111
|
|
110
112
|
@validation_errors.empty?
|
@@ -148,7 +150,7 @@ module KubernetesDeploy
|
|
148
150
|
end
|
149
151
|
|
150
152
|
def rollout_annotation_err_msg
|
151
|
-
"'#{
|
153
|
+
"'#{krane_annotation_key(REQUIRED_ROLLOUT_ANNOTATION_SUFFIX)}: #{required_rollout}' is invalid. "\
|
152
154
|
"Acceptable values: #{REQUIRED_ROLLOUT_TYPES.join(', ')}"
|
153
155
|
end
|
154
156
|
|
@@ -201,7 +203,7 @@ module KubernetesDeploy
|
|
201
203
|
end
|
202
204
|
|
203
205
|
def required_rollout
|
204
|
-
|
206
|
+
krane_annotation_value("required-rollout") || DEFAULT_REQUIRED_ROLLOUT
|
205
207
|
end
|
206
208
|
|
207
209
|
def percent?(value)
|
@@ -19,6 +19,8 @@ module KubernetesDeploy
|
|
19
19
|
def status
|
20
20
|
if !exists?
|
21
21
|
"Not found"
|
22
|
+
elsif requires_publishing? && !published?
|
23
|
+
"LoadBalancer IP address is not provisioned yet"
|
22
24
|
elsif !requires_endpoints?
|
23
25
|
"Doesn't require any endpoints"
|
24
26
|
elsif selects_some_pods?
|
@@ -30,6 +32,7 @@ module KubernetesDeploy
|
|
30
32
|
|
31
33
|
def deploy_succeeded?
|
32
34
|
return false unless exists?
|
35
|
+
return published? if requires_publishing?
|
33
36
|
return exists? unless requires_endpoints?
|
34
37
|
# We can't use endpoints if we want the service to be able to fail fast when the pods are down
|
35
38
|
exposes_zero_replica_workload? || selects_some_pods?
|
@@ -89,5 +92,13 @@ module KubernetesDeploy
|
|
89
92
|
def external_name_svc?
|
90
93
|
@definition["spec"]["type"] == "ExternalName"
|
91
94
|
end
|
95
|
+
|
96
|
+
def requires_publishing?
|
97
|
+
@definition["spec"]["type"] == "LoadBalancer"
|
98
|
+
end
|
99
|
+
|
100
|
+
def published?
|
101
|
+
@instance_data.dig('status', 'loadBalancer', 'ingress').present?
|
102
|
+
end
|
92
103
|
end
|
93
104
|
end
|
@@ -69,10 +69,10 @@ module KubernetesDeploy
|
|
69
69
|
@logger.info("Rendering #{file_basename}...")
|
70
70
|
file_content = File.read(File.join(@template_dir, filename))
|
71
71
|
rendered_content = @renderer.render_template(filename, file_content)
|
72
|
-
implicit =
|
73
|
-
YAML.parse_stream(rendered_content, "<rendered> #{filename}") { |d| implicit
|
72
|
+
implicit = []
|
73
|
+
YAML.parse_stream(rendered_content, "<rendered> #{filename}") { |d| implicit << d.implicit }
|
74
74
|
if rendered_content.present?
|
75
|
-
stream.puts "---\n" if implicit
|
75
|
+
stream.puts "---\n" if implicit.first
|
76
76
|
stream.puts rendered_content
|
77
77
|
@logger.info("Rendered #{file_basename}")
|
78
78
|
else
|
@@ -29,14 +29,15 @@ module KubernetesDeploy
|
|
29
29
|
@max_watch_seconds = max_watch_seconds
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def run(*args)
|
33
33
|
perform!(*args)
|
34
34
|
true
|
35
35
|
rescue FatalDeploymentError
|
36
36
|
false
|
37
37
|
end
|
38
|
+
alias_method :perform, :run
|
38
39
|
|
39
|
-
def
|
40
|
+
def run!(deployments_names = nil, selector: nil, verify_result: true)
|
40
41
|
start = Time.now.utc
|
41
42
|
@logger.reset
|
42
43
|
|
@@ -47,16 +48,14 @@ module KubernetesDeploy
|
|
47
48
|
@logger.phase_heading("Triggering restart by touching ENV[RESTARTED_AT]")
|
48
49
|
patch_kubeclient_deployments(deployments)
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
raise DeploymentTimeoutError
|
51
|
+
if verify_result
|
52
|
+
@logger.phase_heading("Waiting for rollout")
|
53
|
+
resources = build_watchables(deployments, start)
|
54
|
+
verify_restart(resources)
|
55
|
+
else
|
56
|
+
warning = "Result verification is disabled for this task"
|
57
|
+
@logger.summary.add_paragraph(ColorizedString.new(warning).yellow)
|
58
58
|
end
|
59
|
-
raise FatalDeploymentError unless success
|
60
59
|
StatsD.distribution('restart.duration', StatsD.duration(start), tags: tags('success', deployments))
|
61
60
|
@logger.print_summary(:success)
|
62
61
|
rescue DeploymentTimeoutError
|
@@ -69,6 +68,7 @@ module KubernetesDeploy
|
|
69
68
|
@logger.print_summary(:failure)
|
70
69
|
raise
|
71
70
|
end
|
71
|
+
alias_method :perform!, :run!
|
72
72
|
|
73
73
|
private
|
74
74
|
|
@@ -168,6 +168,17 @@ module KubernetesDeploy
|
|
168
168
|
}
|
169
169
|
end
|
170
170
|
|
171
|
+
def verify_restart(resources)
|
172
|
+
ResourceWatcher.new(resources: resources, logger: @logger, operation_name: "restart",
|
173
|
+
timeout: @max_watch_seconds, namespace: @namespace, context: @context).run
|
174
|
+
failed_resources = resources.reject(&:deploy_succeeded?)
|
175
|
+
success = failed_resources.empty?
|
176
|
+
if !success && failed_resources.all?(&:deploy_timed_out?)
|
177
|
+
raise DeploymentTimeoutError
|
178
|
+
end
|
179
|
+
raise FatalDeploymentError unless success
|
180
|
+
end
|
181
|
+
|
171
182
|
def verify_config!
|
172
183
|
task_config_validator = TaskConfigValidator.new(@task_config, kubectl, kubeclient_builder)
|
173
184
|
unless task_config_validator.valid?
|
@@ -8,6 +8,7 @@ require 'kubernetes-deploy/resource_cache'
|
|
8
8
|
require 'kubernetes-deploy/resource_watcher'
|
9
9
|
require 'kubernetes-deploy/kubernetes_resource'
|
10
10
|
require 'kubernetes-deploy/kubernetes_resource/pod'
|
11
|
+
require 'kubernetes-deploy/runner_task_config_validator'
|
11
12
|
|
12
13
|
module KubernetesDeploy
|
13
14
|
class RunnerTask
|
@@ -35,7 +36,11 @@ module KubernetesDeploy
|
|
35
36
|
@logger.reset
|
36
37
|
|
37
38
|
@logger.phase_heading("Initializing task")
|
38
|
-
|
39
|
+
|
40
|
+
@logger.info("Validating configuration")
|
41
|
+
verify_config!(task_template, args)
|
42
|
+
@logger.info("Using namespace '#{@namespace}' in context '#{@context}'")
|
43
|
+
|
39
44
|
pod = build_pod(task_template, entrypoint, args, env_vars, verify_result)
|
40
45
|
validate_pod(pod)
|
41
46
|
|
@@ -107,41 +112,14 @@ module KubernetesDeploy
|
|
107
112
|
@logger.summary.add_paragraph(warning)
|
108
113
|
end
|
109
114
|
|
110
|
-
def
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
if task_template.blank?
|
115
|
-
errors << "Task template name can't be nil"
|
116
|
-
end
|
117
|
-
|
118
|
-
if @namespace.blank?
|
119
|
-
errors << "Namespace can't be empty"
|
120
|
-
end
|
121
|
-
|
122
|
-
if args.blank?
|
123
|
-
errors << "Args can't be nil"
|
124
|
-
end
|
125
|
-
|
126
|
-
begin
|
127
|
-
kubeclient.get_namespace(@namespace) if @namespace.present?
|
128
|
-
@logger.info("Using namespace '#{@namespace}' in context '#{@context}'")
|
129
|
-
|
130
|
-
rescue Kubeclient::ResourceNotFoundError
|
131
|
-
errors << "Namespace was not found"
|
132
|
-
rescue Kubeclient::HttpError
|
133
|
-
errors << "Could not connect to kubernetes cluster"
|
134
|
-
rescue KubernetesDeploy::KubeclientBuilder::ContextMissingError
|
135
|
-
errors << "Could not connect to kubernetes cluster - context invalid"
|
136
|
-
end
|
137
|
-
|
138
|
-
unless errors.empty?
|
115
|
+
def verify_config!(task_template, args)
|
116
|
+
task_config_validator = RunnerTaskConfigValidator.new(task_template, args, @task_config, kubectl,
|
117
|
+
kubeclient_builder)
|
118
|
+
unless task_config_validator.valid?
|
139
119
|
@logger.summary.add_action("Configuration invalid")
|
140
|
-
@logger.summary.add_paragraph(errors.map { |err| "- #{err}" }.join("\n"))
|
141
|
-
raise TaskConfigurationError
|
120
|
+
@logger.summary.add_paragraph([task_config_validator.errors].map { |err| "- #{err}" }.join("\n"))
|
121
|
+
raise KubernetesDeploy::TaskConfigurationError
|
142
122
|
end
|
143
|
-
|
144
|
-
TaskConfigValidator.new(@task_config, kubectl, kubeclient_builder, only: [:validate_server_version]).valid?
|
145
123
|
end
|
146
124
|
|
147
125
|
def get_template(template_name)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module KubernetesDeploy
|
3
|
+
class RunnerTaskConfigValidator < TaskConfigValidator
|
4
|
+
def initialize(template, args, *arguments)
|
5
|
+
super(*arguments)
|
6
|
+
@template = template
|
7
|
+
@args = args
|
8
|
+
@validations += %i(validate_template validate_args)
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def validate_args
|
14
|
+
if @args.blank?
|
15
|
+
@errors << "Args can't be nil"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def validate_template
|
20
|
+
if @template.blank?
|
21
|
+
@errors << "Task template name can't be nil"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubernetes-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Verey
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-09-
|
12
|
+
date: 2019-09-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -143,6 +143,20 @@ dependencies:
|
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: 0.9.6
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: thor
|
148
|
+
requirement: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.20.3
|
153
|
+
type: :runtime
|
154
|
+
prerelease: false
|
155
|
+
version_requirements: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.20.3
|
146
160
|
- !ruby/object:Gem::Dependency
|
147
161
|
name: bundler
|
148
162
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,6 +245,7 @@ description: Kubernetes deploy scripts
|
|
231
245
|
email:
|
232
246
|
- ops-accounts+shipit@shopify.com
|
233
247
|
executables:
|
248
|
+
- krane
|
234
249
|
- kubernetes-deploy
|
235
250
|
- kubernetes-render
|
236
251
|
- kubernetes-restart
|
@@ -250,7 +265,6 @@ files:
|
|
250
265
|
- Gemfile
|
251
266
|
- ISSUE_TEMPLATE.md
|
252
267
|
- LICENSE.txt
|
253
|
-
- NO-BINAUTH
|
254
268
|
- README.md
|
255
269
|
- Rakefile
|
256
270
|
- bin/ci
|
@@ -258,11 +272,16 @@ files:
|
|
258
272
|
- bin/test
|
259
273
|
- dev.yml
|
260
274
|
- dev/flamegraph-from-tests
|
275
|
+
- exe/krane
|
261
276
|
- exe/kubernetes-deploy
|
262
277
|
- exe/kubernetes-render
|
263
278
|
- exe/kubernetes-restart
|
264
279
|
- exe/kubernetes-run
|
265
280
|
- kubernetes-deploy.gemspec
|
281
|
+
- lib/krane.rb
|
282
|
+
- lib/krane/cli/krane.rb
|
283
|
+
- lib/krane/cli/restart_command.rb
|
284
|
+
- lib/krane/cli/version_command.rb
|
266
285
|
- lib/kubernetes-deploy.rb
|
267
286
|
- lib/kubernetes-deploy/bindings_parser.rb
|
268
287
|
- lib/kubernetes-deploy/cluster_resource_discovery.rb
|
@@ -285,7 +304,6 @@ files:
|
|
285
304
|
- lib/kubernetes-deploy/kubernetes_resource/custom_resource_definition.rb
|
286
305
|
- lib/kubernetes-deploy/kubernetes_resource/daemon_set.rb
|
287
306
|
- lib/kubernetes-deploy/kubernetes_resource/deployment.rb
|
288
|
-
- lib/kubernetes-deploy/kubernetes_resource/elasticsearch.rb
|
289
307
|
- lib/kubernetes-deploy/kubernetes_resource/horizontal_pod_autoscaler.rb
|
290
308
|
- lib/kubernetes-deploy/kubernetes_resource/ingress.rb
|
291
309
|
- lib/kubernetes-deploy/kubernetes_resource/job.rb
|
@@ -303,8 +321,6 @@ files:
|
|
303
321
|
- lib/kubernetes-deploy/kubernetes_resource/service.rb
|
304
322
|
- lib/kubernetes-deploy/kubernetes_resource/service_account.rb
|
305
323
|
- lib/kubernetes-deploy/kubernetes_resource/stateful_set.rb
|
306
|
-
- lib/kubernetes-deploy/kubernetes_resource/statefulservice.rb
|
307
|
-
- lib/kubernetes-deploy/kubernetes_resource/topic.rb
|
308
324
|
- lib/kubernetes-deploy/label_selector.rb
|
309
325
|
- lib/kubernetes-deploy/oj.rb
|
310
326
|
- lib/kubernetes-deploy/options_helper.rb
|
@@ -316,6 +332,7 @@ files:
|
|
316
332
|
- lib/kubernetes-deploy/restart_task.rb
|
317
333
|
- lib/kubernetes-deploy/rollout_conditions.rb
|
318
334
|
- lib/kubernetes-deploy/runner_task.rb
|
335
|
+
- lib/kubernetes-deploy/runner_task_config_validator.rb
|
319
336
|
- lib/kubernetes-deploy/statsd.rb
|
320
337
|
- lib/kubernetes-deploy/task_config.rb
|
321
338
|
- lib/kubernetes-deploy/task_config_validator.rb
|
data/NO-BINAUTH
DELETED
File without changes
|