kubernetes_helper 1.12.5 → 1.12.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/kubernetes_helper/version.rb +1 -1
- data/lib/kubernetes_helper.rb +10 -2
- data/lib/templates/deployment.yml +2 -2
- data/lib/templates/settings.rb +6 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa7e78cceeb40228bdfb3dea0d9e89e9beb112e484eb61ca8e7302716b69abd4
|
4
|
+
data.tar.gz: 1b6eda67f29f936e66714f08b538ef868b1f3e3c76f67d3e4f2e09098898e5a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c7816fd3c3cea7dc303f2923b453338f4ad976cf577bea302d75e0b7c84ee0dee98fc58d06b76c9816de0dc14cb31b8ea0aa19ce7e5cc768bb20faf76cbee7e
|
7
|
+
data.tar.gz: ea90240216df3170b2185203cc1d27688950eb83130caee7e339b368501dfeb1c613a480895c17dadb7a3e235b3338cabd80871079b0a5d428b4309e7c3949be
|
data/README.md
CHANGED
@@ -77,6 +77,7 @@ Below settings are used when configuring the application in the k8s environment
|
|
77
77
|
Sample volume: `{ my_volume: { kind: 'hostPath', mount_path: '/', settings: { path: '..', type: 'Directory' } } }`
|
78
78
|
Sample secret: `{ pubsub_secret: { kind: 'secret', mount_path: '/secrets/pubsub', settings: { secretName: 'my_secret_name' } } }`
|
79
79
|
- `deployment.log_container` (Boolean, default true): Permits to auto include logs container to print all logs from logs/*.log to stdout (required for papertrail using fluentd)
|
80
|
+
- `deployment.log_folder` (String, default `/app/log`): Logs to be printed from
|
80
81
|
- `deployment.app_port` (Integer, default 3000): Application port number
|
81
82
|
|
82
83
|
- `deployment.job_name` (String, optional): Job deployment name (Note: Underscores are not accepted). Sample: `my-app-job`. Note: This deployment is created only if this value is present
|
@@ -88,8 +89,8 @@ Below settings are used when configuring the application in the k8s environment
|
|
88
89
|
- `secrets.name` (String): K8s secrets name where env vars will be saved and fetched from. Sample: `my-app-secrets`
|
89
90
|
|
90
91
|
- `service.name`: K8s service name. Sample: `my-app-service`
|
91
|
-
- `service.port_name
|
92
|
-
- `service.backend_port_name` (String): Web backend port name to be connected between k8s service and web deployments. Sample: `b-port`. Note: max 15 characters
|
92
|
+
- `service.port_name` (String, default `http-port`): Http port name to connect between k8s ingress and service. Sample: `http-port`. Note: max 15 characters
|
93
|
+
- `service.backend_port_name` (String, default `b-port`): Web backend port name to be connected between k8s service and web deployments. Sample: `b-port`. Note: max 15 characters
|
93
94
|
|
94
95
|
- `ingress.name`: Name of k8s ingress for the app: Sample: `my-app-ingress`
|
95
96
|
- `ingress.ip_name` (Optional): Static ip address is not created nor assigned if empty value. Sample: `my-app-static-ip`
|
data/lib/kubernetes_helper.rb
CHANGED
@@ -23,8 +23,16 @@ module KubernetesHelper
|
|
23
23
|
name: 'gcloud'
|
24
24
|
},
|
25
25
|
deployment: {
|
26
|
-
log_container: true
|
27
|
-
|
26
|
+
log_container: true,
|
27
|
+
log_folder: '/app/log'
|
28
|
+
},
|
29
|
+
service: {
|
30
|
+
port_name: 'http-port',
|
31
|
+
backend_port_name: 'b-port'
|
32
|
+
},
|
33
|
+
secrets: {},
|
34
|
+
continuous_deployment: {},
|
35
|
+
ingress: {}
|
28
36
|
}
|
29
37
|
deep_merge(def_settings, settings || {})
|
30
38
|
end
|
@@ -48,7 +48,7 @@ documents:
|
|
48
48
|
<% if deployment.log_container %>
|
49
49
|
- &log_volume
|
50
50
|
name: applog
|
51
|
-
mountPath:
|
51
|
+
mountPath: <%= deployment.log_folder %>
|
52
52
|
<% end %>
|
53
53
|
|
54
54
|
<% if deployment.cloud_secret_name %>
|
@@ -80,7 +80,7 @@ documents:
|
|
80
80
|
- &logs_container # print to stdout all log files
|
81
81
|
name: print-logs
|
82
82
|
image: busybox
|
83
|
-
command: [/bin/sh, -c, 'until find
|
83
|
+
command: [/bin/sh, -c, 'until find <%= deployment.log_folder %>/*.log; do sleep 1; done; tail -n+1 -f <%= deployment.log_folder %>/*.log']
|
84
84
|
env: []
|
85
85
|
volumeMounts:
|
86
86
|
- *log_volume
|
data/lib/templates/settings.rb
CHANGED
@@ -17,6 +17,12 @@ settings = {
|
|
17
17
|
# job_services: ['sidekiq', 'cron'] # list of linux services needed.
|
18
18
|
# custom_volumes: { my_volume: { kind: 'hostPath', mount_path: '/', settings: { path: '..', type: 'Directory' } } }
|
19
19
|
},
|
20
|
+
secrets: {
|
21
|
+
name: "#{app_name}-secrets"
|
22
|
+
},
|
23
|
+
service: {
|
24
|
+
name: app_name,
|
25
|
+
},
|
20
26
|
ingress: {
|
21
27
|
name: "#{app_name}-ingress",
|
22
28
|
ip_name: "#{app_name}-static-ip", # nil if static ip is not necessary
|
@@ -32,14 +38,6 @@ settings = {
|
|
32
38
|
docker_build_cmd: 'build -f Dockerfile', # using target: 'build --target production -f Dockerfile '
|
33
39
|
update_deployment: false # permits to reload secrets and re-generate/update deployment yaml
|
34
40
|
},
|
35
|
-
secrets: {
|
36
|
-
name: "#{app_name}-secrets"
|
37
|
-
},
|
38
|
-
service: {
|
39
|
-
name: app_name,
|
40
|
-
port_name: 'http-port', # max 15 characters
|
41
|
-
backend_port_name: 'b-port' # max 15 characters
|
42
|
-
}
|
43
41
|
}
|
44
42
|
|
45
43
|
KubernetesHelper.settings(settings)
|