kubernetes-deploy 0.12.3 → 0.12.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildkite/pipeline.yml +8 -0
- data/NO-BINAUTH +0 -0
- data/README.md +3 -13
- data/bin/ci +16 -10
- data/bin/test +7 -0
- data/lib/kubernetes-deploy/kubernetes_resource/replica_set.rb +1 -0
- data/lib/kubernetes-deploy/kubernetes_resource/resource_quota.rb +33 -0
- data/lib/kubernetes-deploy/runner.rb +5 -1
- data/lib/kubernetes-deploy/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d302a32efb35a73d14f6c1638e7fd616ff5d7f7d
|
4
|
+
data.tar.gz: ed8ebbbb4907533688cbbcfcdcbaceb82a575724
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95116c7e04a64c38b56a66764940d2f4229293c37244a646b85f5be1db53b24e9c416e796969b2faf0f24274d03204f622c01d52af56e9bd66535570b956d470
|
7
|
+
data.tar.gz: 52df9715d206946071835cf4982b5a008174e9e31d897fa25b01c6c0f425d8532bb0c60d355cbac560195595b021920487d782d48e18c76024d7845e6823466e
|
data/NO-BINAUTH
ADDED
File without changes
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# kubernetes-deploy [![Build status](https://badge.buildkite.com/
|
1
|
+
# kubernetes-deploy [![Build status](https://badge.buildkite.com/d1aab6d17b010f418e43f740063fe5343c5d65df654e635a8b.svg?branch=master)](https://buildkite.com/shopify/kubernetes-deploy-gem) [![codecov](https://codecov.io/gh/Shopify/kubernetes-deploy/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/kubernetes-deploy)
|
2
2
|
|
3
3
|
`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.
|
4
4
|
|
@@ -53,7 +53,6 @@ This repo also includes related tools for [running tasks](#kubernetes-run) and [
|
|
53
53
|
* [Setup](#setup)
|
54
54
|
* [Running the test suite locally](#running-the-test-suite-locally)
|
55
55
|
* [Releasing a new version (Shopify employees)](#releasing-a-new-version-shopify-employees)
|
56
|
-
* [CI (Shopify employees)](#ci-shopify-employees)
|
57
56
|
* [CI (External contributors)](#ci-external-contributors)
|
58
57
|
|
59
58
|
**CONTRIBUTING**
|
@@ -294,20 +293,11 @@ To make StatsD log what it would have emitted, run a test with `STATSD_DEV=1`.
|
|
294
293
|
If you push your commit and the tag separately, Shipit usually fails with `You need to create the v0.7.9 tag first.`. To make it find your tag, go to `Settings` > `Resynchronize this stack` > `Clear git cache`.
|
295
294
|
|
296
295
|
|
297
|
-
|
298
|
-
## CI (Shopify employees)
|
299
|
-
|
300
|
-
Buildkite will build branches as you're working on them, but as soon as you create a PR it will stop building new commits from that branch because we disabled PR builds for security reasons. You can manually trigger the PR build from the [Buildkite UI](https://buildkite.com/shopify/kubernetes-deploy-gem) (just specify the branch; SHA is not required).
|
301
|
-
|
302
|
-
<img width="464" alt="screen shot 2017-02-21 at 10 55 33" src="https://cloud.githubusercontent.com/assets/522155/23172610/52771a3a-f824-11e6-8c8e-3d59c45e7ff8.png">
|
303
|
-
|
304
|
-
|
305
|
-
|
306
296
|
## CI (External contributors)
|
307
297
|
|
308
|
-
Please make sure you run the tests locally before submitting your PR (see [Running the test suite locally](#running-the-test-suite-locally)).
|
309
|
-
|
298
|
+
Please make sure you run the tests locally before submitting your PR (see [Running the test suite locally](#running-the-test-suite-locally)). After reviewing your PR, a Shopify employee will trigger CI for you from the [Buildkite UI](https://buildkite.com/shopify/kubernetes-deploy-gem) (just specify the branch; SHA is not required).
|
310
299
|
|
300
|
+
<img width="464" alt="screen shot 2017-02-21 at 10 55 33" src="https://cloud.githubusercontent.com/assets/522155/23172610/52771a3a-f824-11e6-8c8e-3d59c45e7ff8.png">
|
311
301
|
|
312
302
|
# Contributing
|
313
303
|
|
data/bin/ci
CHANGED
@@ -1,13 +1,19 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
set -
|
2
|
+
set -euo pipefail
|
3
3
|
|
4
|
-
|
4
|
+
if [[ -n "${DEBUG:+set}" ]]; then
|
5
|
+
set -x
|
6
|
+
fi
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
docker run --rm \
|
9
|
+
--net=host \
|
10
|
+
-v "$HOME/.kube":/"$HOME/.kube" \
|
11
|
+
-v "$HOME/.minikube":/"$HOME/.minikube" \
|
12
|
+
-v "$PWD":/usr/src/app \
|
13
|
+
-v "/usr/local/google-cloud-sdk/bin/kubectl":"/usr/bin/kubectl" \
|
14
|
+
-e CI=1 \
|
15
|
+
-e CODECOV_TOKEN=$CODECOV_TOKEN \
|
16
|
+
-e COVERAGE=1 \
|
17
|
+
-w /usr/src/app \
|
18
|
+
ruby:2.3 \
|
19
|
+
bin/test
|
data/bin/test
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module KubernetesDeploy
|
3
|
+
class ResourceQuota < KubernetesResource
|
4
|
+
TIMEOUT = 30.seconds
|
5
|
+
|
6
|
+
def sync
|
7
|
+
raw_json, _err, st = kubectl.run("get", type, @name, "--output=json")
|
8
|
+
@status = st.success? ? "Available" : "Unknown"
|
9
|
+
@found = st.success?
|
10
|
+
@rollout_data = if @found
|
11
|
+
JSON.parse(raw_json)
|
12
|
+
else
|
13
|
+
{}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def deploy_succeeded?
|
18
|
+
@rollout_data.dig("spec", "hard") == @rollout_data.dig("status", "hard")
|
19
|
+
end
|
20
|
+
|
21
|
+
def deploy_failed?
|
22
|
+
false
|
23
|
+
end
|
24
|
+
|
25
|
+
def timeout_message
|
26
|
+
UNUSUAL_FAILURE_MESSAGE
|
27
|
+
end
|
28
|
+
|
29
|
+
def exists?
|
30
|
+
@found
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -21,6 +21,7 @@ require 'kubernetes-deploy/kubernetes_resource'
|
|
21
21
|
replica_set
|
22
22
|
service_account
|
23
23
|
daemon_set
|
24
|
+
resource_quota
|
24
25
|
).each do |subresource|
|
25
26
|
require "kubernetes-deploy/kubernetes_resource/#{subresource}"
|
26
27
|
end
|
@@ -34,6 +35,7 @@ module KubernetesDeploy
|
|
34
35
|
include KubeclientBuilder
|
35
36
|
|
36
37
|
PREDEPLOY_SEQUENCE = %w(
|
38
|
+
ResourceQuota
|
37
39
|
Cloudsql
|
38
40
|
Redis
|
39
41
|
Bugsnag
|
@@ -262,7 +264,9 @@ module KubernetesDeploy
|
|
262
264
|
|
263
265
|
def validate_configuration(allow_protected_ns:, prune:)
|
264
266
|
errors = []
|
265
|
-
if ENV["KUBECONFIG"].blank?
|
267
|
+
if ENV["KUBECONFIG"].blank?
|
268
|
+
errors << "$KUBECONFIG not set"
|
269
|
+
elsif !File.file?(ENV["KUBECONFIG"])
|
266
270
|
errors << "Kube config not found at #{ENV['KUBECONFIG']}"
|
267
271
|
end
|
268
272
|
|
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.12.
|
4
|
+
version: 0.12.4
|
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: 2017-09-
|
12
|
+
date: 2017-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -189,14 +189,17 @@ executables:
|
|
189
189
|
extensions: []
|
190
190
|
extra_rdoc_files: []
|
191
191
|
files:
|
192
|
+
- ".buildkite/pipeline.yml"
|
192
193
|
- ".gitignore"
|
193
194
|
- ".rubocop.yml"
|
194
195
|
- Gemfile
|
195
196
|
- LICENSE.txt
|
197
|
+
- NO-BINAUTH
|
196
198
|
- README.md
|
197
199
|
- Rakefile
|
198
200
|
- bin/ci
|
199
201
|
- bin/setup
|
202
|
+
- bin/test
|
200
203
|
- dev/flamegraph-from-tests
|
201
204
|
- exe/kubernetes-deploy
|
202
205
|
- exe/kubernetes-restart
|
@@ -224,6 +227,7 @@ files:
|
|
224
227
|
- lib/kubernetes-deploy/kubernetes_resource/pod_template.rb
|
225
228
|
- lib/kubernetes-deploy/kubernetes_resource/redis.rb
|
226
229
|
- lib/kubernetes-deploy/kubernetes_resource/replica_set.rb
|
230
|
+
- lib/kubernetes-deploy/kubernetes_resource/resource_quota.rb
|
227
231
|
- lib/kubernetes-deploy/kubernetes_resource/service.rb
|
228
232
|
- lib/kubernetes-deploy/kubernetes_resource/service_account.rb
|
229
233
|
- lib/kubernetes-deploy/resource_watcher.rb
|