kdep 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kdep/cli.rb +1 -0
- data/lib/kdep/commands/apply.rb +1 -1
- data/lib/kdep/commands/bump.rb +17 -10
- data/lib/kdep/commands/diff.rb +1 -1
- data/lib/kdep/commands/helm_install.rb +286 -0
- data/lib/kdep/commands/migrate.rb +176 -71
- data/lib/kdep/commands/render.rb +2 -2
- data/lib/kdep/defaults.rb +6 -2
- data/lib/kdep/docker.rb +57 -1
- data/lib/kdep/helm.rb +34 -0
- data/lib/kdep/old_format.rb +690 -9
- data/lib/kdep/preset.rb +1 -1
- data/lib/kdep/registry.rb +119 -3
- data/lib/kdep/version.rb +1 -1
- data/lib/kdep.rb +2 -0
- data/templates/presets/helm +4 -0
- data/templates/presets/statefulset +4 -0
- data/templates/presets/statefulset_svc +5 -0
- data/templates/resources/configmap.yml.erb +7 -3
- data/templates/resources/cronjob.yml.erb +49 -12
- data/templates/resources/deployment.yml.erb +64 -11
- data/templates/resources/ingress.yml.erb +59 -13
- data/templates/resources/secret.yml.erb +7 -7
- data/templates/resources/service.yml.erb +26 -2
- data/templates/resources/statefulset.yml.erb +125 -0
- metadata +16 -10
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: StatefulSet
|
|
3
|
+
metadata:
|
|
4
|
+
name: <%= @config["statefulset_name"] || @config["deployment_name"] || name %>
|
|
5
|
+
namespace: <%= namespace %>
|
|
6
|
+
labels:
|
|
7
|
+
app: <%= name %>
|
|
8
|
+
spec:
|
|
9
|
+
replicas: <%= replicas %>
|
|
10
|
+
serviceName: <%= @config["service_name"] || name %>
|
|
11
|
+
selector:
|
|
12
|
+
matchLabels:
|
|
13
|
+
app: <%= name %>
|
|
14
|
+
template:
|
|
15
|
+
metadata:
|
|
16
|
+
labels:
|
|
17
|
+
app: <%= name %>
|
|
18
|
+
<% if @config["pod_labels"] -%>
|
|
19
|
+
<% @config["pod_labels"].each do |k, v| -%>
|
|
20
|
+
<%= k %>: "<%= v %>"
|
|
21
|
+
<% end -%>
|
|
22
|
+
<% end -%>
|
|
23
|
+
spec:
|
|
24
|
+
<% if @config["termination_grace_period"] -%>
|
|
25
|
+
terminationGracePeriodSeconds: <%= @config["termination_grace_period"] %>
|
|
26
|
+
<% end -%>
|
|
27
|
+
<% if @config["image_pull_secrets"] -%>
|
|
28
|
+
imagePullSecrets:
|
|
29
|
+
- name: <%= @config["image_pull_secrets"] %>
|
|
30
|
+
<% end -%>
|
|
31
|
+
containers:
|
|
32
|
+
- name: <%= @config["container_name"] || name %>
|
|
33
|
+
image: <%= @config["registry"] ? "#{@config["registry"]}/#{image}" : image %>:<%= @config["tag"] || "latest" %>
|
|
34
|
+
<% if @config["image_pull_policy"] -%>
|
|
35
|
+
imagePullPolicy: <%= @config["image_pull_policy"] %>
|
|
36
|
+
<% end -%>
|
|
37
|
+
<% if @config["command"] -%>
|
|
38
|
+
command: <%= @config["command"].is_a?(Array) ? @config["command"].inspect : "[\"#{@config["command"]}\"]" %>
|
|
39
|
+
<% end -%>
|
|
40
|
+
<% if @config["args"] -%>
|
|
41
|
+
args: <%= @config["args"].is_a?(Array) ? @config["args"].inspect : "[\"#{@config["args"]}\"]" %>
|
|
42
|
+
<% end -%>
|
|
43
|
+
<% if @config["port"] -%>
|
|
44
|
+
ports:
|
|
45
|
+
- containerPort: <%= port %>
|
|
46
|
+
<% if @config["container_port_protocol"] -%>
|
|
47
|
+
protocol: <%= @config["container_port_protocol"] %>
|
|
48
|
+
<% end -%>
|
|
49
|
+
<% end -%>
|
|
50
|
+
<% if @config["security_context"] -%>
|
|
51
|
+
securityContext:
|
|
52
|
+
<%= @config["security_context"].to_yaml.sub("---\n", "").gsub(/^/, " ").rstrip %>
|
|
53
|
+
<% end -%>
|
|
54
|
+
<% if @config["resources"] -%>
|
|
55
|
+
resources:
|
|
56
|
+
<% if @config["resources"]["requests"] -%>
|
|
57
|
+
requests:
|
|
58
|
+
<% @config["resources"]["requests"].each do |k, v| -%>
|
|
59
|
+
<%= k %>: <%= v.is_a?(Numeric) ? v : "\"#{v}\"" %>
|
|
60
|
+
<% end -%>
|
|
61
|
+
<% end -%>
|
|
62
|
+
<% if @config["resources"]["limits"] -%>
|
|
63
|
+
limits:
|
|
64
|
+
<% @config["resources"]["limits"].each do |k, v| -%>
|
|
65
|
+
<%= k %>: <%= v.is_a?(Numeric) ? v : "\"#{v}\"" %>
|
|
66
|
+
<% end -%>
|
|
67
|
+
<% end -%>
|
|
68
|
+
<% end -%>
|
|
69
|
+
<% if @config["probe"] -%>
|
|
70
|
+
livenessProbe:
|
|
71
|
+
httpGet:
|
|
72
|
+
path: <%= @config["probe"]["path"] || "/healthz" %>
|
|
73
|
+
port: <%= @config["probe"]["port"] || port %>
|
|
74
|
+
initialDelaySeconds: <%= @config["probe"]["initial_delay"] || 15 %>
|
|
75
|
+
periodSeconds: <%= @config["probe"]["period"] || 10 %>
|
|
76
|
+
failureThreshold: <%= @config["probe"]["failure_threshold"] || 3 %>
|
|
77
|
+
<% if @config["probe"]["liveness_success_threshold"] -%>
|
|
78
|
+
successThreshold: <%= @config["probe"]["liveness_success_threshold"] %>
|
|
79
|
+
<% end -%>
|
|
80
|
+
timeoutSeconds: <%= @config["probe"]["timeout"] || 3 %>
|
|
81
|
+
readinessProbe:
|
|
82
|
+
httpGet:
|
|
83
|
+
path: <%= @config["probe"]["readiness_path"] || @config["probe"]["path"] || "/healthz" %>
|
|
84
|
+
port: <%= @config["probe"]["readiness_port"] || @config["probe"]["port"] || port %>
|
|
85
|
+
initialDelaySeconds: <%= @config["probe"]["readiness_initial_delay"] || @config["probe"]["initial_delay"] || 3 %>
|
|
86
|
+
periodSeconds: <%= @config["probe"]["readiness_period"] || @config["probe"]["period"] || 10 %>
|
|
87
|
+
failureThreshold: <%= @config["probe"]["readiness_failure_threshold"] || @config["probe"]["failure_threshold"] || 3 %>
|
|
88
|
+
<% if @config["probe"]["readiness_success_threshold"] -%>
|
|
89
|
+
successThreshold: <%= @config["probe"]["readiness_success_threshold"] %>
|
|
90
|
+
<% end -%>
|
|
91
|
+
timeoutSeconds: <%= @config["probe"]["readiness_timeout"] || @config["probe"]["timeout"] || 3 %>
|
|
92
|
+
<% end -%>
|
|
93
|
+
<% if @config["lifecycle"] -%>
|
|
94
|
+
lifecycle:
|
|
95
|
+
<%= @config["lifecycle"].to_yaml.sub("---\n", "").gsub(/^/, " ").rstrip %>
|
|
96
|
+
<% end -%>
|
|
97
|
+
<% if @config["volume_mounts"] -%>
|
|
98
|
+
volumeMounts:
|
|
99
|
+
<% @config["volume_mounts"].each do |vm| -%>
|
|
100
|
+
- name: <%= vm["name"] %>
|
|
101
|
+
mountPath: <%= vm["mountPath"] %>
|
|
102
|
+
<% if vm["readOnly"] -%>
|
|
103
|
+
readOnly: <%= vm["readOnly"] %>
|
|
104
|
+
<% end -%>
|
|
105
|
+
<% if vm["subPath"] -%>
|
|
106
|
+
subPath: <%= vm["subPath"] %>
|
|
107
|
+
<% end -%>
|
|
108
|
+
<% end -%>
|
|
109
|
+
<% end -%>
|
|
110
|
+
envFrom:
|
|
111
|
+
<% env_from_list = @config["env_from"] || ["configmap/config-#{name}", "secret/secret-#{name}"] -%>
|
|
112
|
+
<% env_from_list.each do |ref| -%>
|
|
113
|
+
<% type, ref_name = ref.split("/", 2) -%>
|
|
114
|
+
<% if type == "configmap" -%>
|
|
115
|
+
- configMapRef:
|
|
116
|
+
name: <%= ref_name %>
|
|
117
|
+
<% elsif type == "secret" -%>
|
|
118
|
+
- secretRef:
|
|
119
|
+
name: <%= ref_name %>
|
|
120
|
+
<% end -%>
|
|
121
|
+
<% end -%>
|
|
122
|
+
<% if @config["volumes"] -%>
|
|
123
|
+
volumes:
|
|
124
|
+
<%= @config["volumes"].to_yaml.sub("---\n", "").gsub(/^/, " ").rstrip %>
|
|
125
|
+
<% end -%>
|
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kdep
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Leadfy
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: minitest
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -71,6 +71,7 @@ files:
|
|
|
71
71
|
- lib/kdep/commands/dashboard.rb
|
|
72
72
|
- lib/kdep/commands/diff.rb
|
|
73
73
|
- lib/kdep/commands/eject.rb
|
|
74
|
+
- lib/kdep/commands/helm_install.rb
|
|
74
75
|
- lib/kdep/commands/init.rb
|
|
75
76
|
- lib/kdep/commands/log.rb
|
|
76
77
|
- lib/kdep/commands/migrate.rb
|
|
@@ -94,6 +95,7 @@ files:
|
|
|
94
95
|
- lib/kdep/defaults.rb
|
|
95
96
|
- lib/kdep/discovery.rb
|
|
96
97
|
- lib/kdep/docker.rb
|
|
98
|
+
- lib/kdep/helm.rb
|
|
97
99
|
- lib/kdep/kubectl.rb
|
|
98
100
|
- lib/kdep/old_format.rb
|
|
99
101
|
- lib/kdep/preset.rb
|
|
@@ -110,7 +112,10 @@ files:
|
|
|
110
112
|
- templates/init/secrets.yml
|
|
111
113
|
- templates/presets/cronjob
|
|
112
114
|
- templates/presets/custom
|
|
115
|
+
- templates/presets/helm
|
|
113
116
|
- templates/presets/job
|
|
117
|
+
- templates/presets/statefulset
|
|
118
|
+
- templates/presets/statefulset_svc
|
|
114
119
|
- templates/presets/web
|
|
115
120
|
- templates/presets/worker
|
|
116
121
|
- templates/resources/configmap.yml.erb
|
|
@@ -120,11 +125,12 @@ files:
|
|
|
120
125
|
- templates/resources/job.yml.erb
|
|
121
126
|
- templates/resources/secret.yml.erb
|
|
122
127
|
- templates/resources/service.yml.erb
|
|
128
|
+
- templates/resources/statefulset.yml.erb
|
|
123
129
|
homepage: https://github.com/repleadfy/kdep
|
|
124
130
|
licenses:
|
|
125
131
|
- MIT
|
|
126
132
|
metadata: {}
|
|
127
|
-
post_install_message:
|
|
133
|
+
post_install_message:
|
|
128
134
|
rdoc_options: []
|
|
129
135
|
require_paths:
|
|
130
136
|
- lib
|
|
@@ -139,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
139
145
|
- !ruby/object:Gem::Version
|
|
140
146
|
version: '0'
|
|
141
147
|
requirements: []
|
|
142
|
-
rubygems_version: 3.
|
|
143
|
-
signing_key:
|
|
148
|
+
rubygems_version: 3.2.32
|
|
149
|
+
signing_key:
|
|
144
150
|
specification_version: 4
|
|
145
151
|
summary: Kubernetes deployment CLI
|
|
146
152
|
test_files: []
|