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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d72e1288dc4248dfcb5a1843a63946c8b9e89c1d
4
- data.tar.gz: cd7f50c0d7fc5524ce8c9b83113af0e1d8abb01b
3
+ metadata.gz: d302a32efb35a73d14f6c1638e7fd616ff5d7f7d
4
+ data.tar.gz: ed8ebbbb4907533688cbbcfcdcbaceb82a575724
5
5
  SHA512:
6
- metadata.gz: 8d399ff5fd70beddf51c041ba7f39ba586501c7e9a0728e7fb820523d70b1ebb957cf5df14d3abeba78b197ed1fdcdbf3dfbbf7b489b6164be5725a32237c0ba
7
- data.tar.gz: 381a1e2bc1828589974638e1facfb3090f31fc6d3e4be024fb3c85072e3ba6cf2108f72cc26071e6668f6b0952407d64eaf41bddeb2e1e668ffc9a83687ce09f
6
+ metadata.gz: 95116c7e04a64c38b56a66764940d2f4229293c37244a646b85f5be1db53b24e9c416e796969b2faf0f24274d03204f622c01d52af56e9bd66535570b956d470
7
+ data.tar.gz: 52df9715d206946071835cf4982b5a008174e9e31d897fa25b01c6c0f425d8532bb0c60d355cbac560195595b021920487d782d48e18c76024d7845e6823466e
@@ -0,0 +1,8 @@
1
+ - name: 'Run Test Suite (:kubernetes: 1.7.5)'
2
+ command: bin/ci
3
+ agents:
4
+ queue: pipa-production-minikube-v1.7.5
5
+ - name: 'Run Test Suite (:kubernetes: 1.6.4)'
6
+ command: bin/ci
7
+ agents:
8
+ queue: pipa-production-minikube-v1.6.4
data/NO-BINAUTH ADDED
File without changes
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # kubernetes-deploy [![Build status](https://badge.buildkite.com/0f2d4956d49fbc795f9c17b0a741a6aa9ea532738e5f872ac8.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)
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)). A Shopify employee will trigger CI for you after reviewing your PR.
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 -eox pipefail
2
+ set -euo pipefail
3
3
 
4
- KUBERNETES_VER=1.6.0
4
+ if [[ -n "${DEBUG:+set}" ]]; then
5
+ set -x
6
+ fi
5
7
 
6
- echo "--- Installing dependencies"
7
- bundle install --jobs 4
8
-
9
- echo "--- Starting minikube"
10
- minikube start --cpus 2 --memory 2048 --disk-size=2gb --kubernetes-version=$KUBERNETES_VER --logtostderr
11
-
12
- echo "--- Running tests"
13
- bundle exec rake test
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,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ echo "--- :ruby: Bundle Install"
5
+ bundle install --jobs 4
6
+ echo "+++ :kubernetes: Run Tests"
7
+ bundle exec rake test TESTOPTS='-v'
@@ -66,6 +66,7 @@ module KubernetesDeploy
66
66
  end
67
67
 
68
68
  def fetch_logs
69
+ return {} unless @pods.present? # the kubectl command times out if no pods exist
69
70
  container_names.each_with_object({}) do |container_name, container_logs|
70
71
  out, _err, _st = kubectl.run(
71
72
  "logs",
@@ -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? || !File.file?(ENV["KUBECONFIG"])
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
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module KubernetesDeploy
3
- VERSION = "0.12.3"
3
+ VERSION = "0.12.4"
4
4
  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.12.3
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-22 00:00:00.000000000 Z
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