helm_upgrade_logs 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/exe/helm_upgrade_logs +13 -3
- data/get_pods.rb +7 -0
- data/lib/helm_upgrade_logs/version.rb +1 -1
- data/lib/helm_upgrade_logs.rb +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 198e9553eb5958f78a59b2da3c8636b42da196a6629b9be4b4280da05d148555
|
4
|
+
data.tar.gz: 5f2ad592198f5500a259fa90081a5ba20ea68193036432ce86f5437143e2cbb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11c316ff2bc6332d6be91f722a7143687d7b3dd8375cd6e58429f59384feff2bd0d30b71f49ebc8aaebf71ba6c979657624b6ae3690668c2a2f3b2c71ef069ca
|
7
|
+
data.tar.gz: c851df7d22c2a59d546129d0592cf5bb19d0881db7c07f75b03b64d9bc64e746b33c26fa6d8ea502d55e446c1600e5659ee441dcee1c4d05fbbf9fb86cbbded0
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
|
+
## [0.2.0] - 2022-04-20
|
2
|
+
|
3
|
+
- Monitoring pods don't filter managed by helm as some pods don't have that with selectorLabels
|
4
|
+
|
5
|
+
## [0.1.7] - 2022-04-20
|
6
|
+
|
7
|
+
- Monitor helm upgrade command and periodically reload getting logs when new pods appear
|
8
|
+
|
1
9
|
## [0.1.6] - 2022-04-17
|
2
10
|
|
3
11
|
- Add `helm_test_logs` exe to check logs during `helm test`
|
12
|
+
- Add `pod-running-timeout` of 300s to try and pick up logs that might take a while to appear
|
4
13
|
|
5
14
|
## [0.1.5] - 2022-04-16
|
6
15
|
|
data/exe/helm_upgrade_logs
CHANGED
@@ -13,9 +13,19 @@ event_pid = Process.spawn 'kubectl get events --watch-only=true'
|
|
13
13
|
service_pid = Process.spawn 'kubectl get services --watch-only=true'
|
14
14
|
|
15
15
|
wait_for_pod_to_log
|
16
|
-
log_pid = Process.spawn "kubectl logs -lapp.kubernetes.io/managed-by=Helm,app.kubernetes.io/instance=#{$release_name} -f --all-containers --prefix --ignore-errors=true --max-log-requests=20 --timestamps=true"
|
17
16
|
|
18
|
-
|
19
|
-
|
17
|
+
@pods = []
|
18
|
+
|
19
|
+
while Process.waitpid(helm_pid, Process::WNOHANG) == nil do
|
20
|
+
pods = get_pods
|
21
|
+
if pods != @pods
|
22
|
+
@pods = pods
|
23
|
+
puts "[INFO] Pods: #{pods.join(',')}"
|
24
|
+
puts `kill #{@log_pid}` if @log_pid
|
25
|
+
@log_pid = Process.spawn "kubectl logs -lapp.kubernetes.io/managed-by=Helm,app.kubernetes.io/instance=#{$release_name} -f --all-containers --prefix --ignore-errors=true --max-log-requests=20 --timestamps=true --since=0s"
|
26
|
+
end
|
27
|
+
sleep 2.5
|
28
|
+
end
|
29
|
+
puts `kill #{@log_pid}`
|
20
30
|
puts `kill #{event_pid}`
|
21
31
|
puts `kill #{service_pid}`
|
data/get_pods.rb
ADDED
data/lib/helm_upgrade_logs.rb
CHANGED
@@ -24,6 +24,15 @@ def wait_for_pod_to_log
|
|
24
24
|
}
|
25
25
|
end
|
26
26
|
|
27
|
+
def get_pods
|
28
|
+
stdout, stderr, _ = Open3.capture3 "kubectl get pods -lapp.kubernetes.io/instance=#{$release_name} -o name"
|
29
|
+
if stderr.empty?
|
30
|
+
stdout.lines.collect { |pod| pod.strip }
|
31
|
+
else
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
27
36
|
module HelmUpgradeLogs
|
28
37
|
class Error < StandardError; end
|
29
38
|
# Your code goes here...
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helm_upgrade_logs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Garratt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Basic wrapper around helm and kubectl to allow easy debugging of a helm
|
14
14
|
release. All arguments after a usual helm upgrade are used as normal
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- bin/start_kind.sh
|
42
42
|
- exe/helm_test_logs
|
43
43
|
- exe/helm_upgrade_logs
|
44
|
+
- get_pods.rb
|
44
45
|
- helm_upgrade_logs.gemspec
|
45
46
|
- lib/helm_upgrade_logs.rb
|
46
47
|
- lib/helm_upgrade_logs/version.rb
|