kubernetes_helper 1.12.4 → 1.12.7
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 +8 -1
- data/lib/templates/cd.sh +2 -1
- data/lib/templates/settings.rb +0 -2
- 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: 386faaa431a2175aef58d35449263616ceaa27eb50c7eed09e4b2f2273321e62
|
4
|
+
data.tar.gz: 9a34b266ab98773d7453c28aec664f37dbf49d21d87e6b6f8d919ef9079bded5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e328d4a95e718f3815abd517cd8e1bb0ade62b80fbd25770eb6fb2e3730a7993098940e61bc65c56aa5538f94d707517a4ad5867be2189825734a812162c641
|
7
|
+
data.tar.gz: e807a576fae8a3402dba6fd6f3dd964dc75cfe55b3afde6df16ae2c8584f319194c8da2c637c97576b07ef17e766d4440866d296eb8f1f9e353401c4bf7f7fab
|
data/README.md
CHANGED
@@ -62,6 +62,7 @@ Below settings are used when running Continuous Deployment
|
|
62
62
|
- `continuous_deployment.docker_build_cmd`: Docker command to build the corresponding image. Sample: `build --target production -f Dockerfile `
|
63
63
|
- `continuous_deployment.update_deployment` (Boolean, default: false): If true permits to re-generate and update the k8s deployment(s) before applying the new version (new docker image)
|
64
64
|
- `continuous_deployment.before_building_image` (String, default: empty): Add the ability to enter commands before building docker image
|
65
|
+
- `continuous_deployment.after_building_image` (String, default: empty): Add the ability to enter commands after building docker image
|
65
66
|
|
66
67
|
Below settings are used when configuring the application in the k8s environment
|
67
68
|
- `deployment.name` (String): Web deployment name (Note: Underscores are not accepted). Sample: `my-app`
|
@@ -87,8 +88,8 @@ Below settings are used when configuring the application in the k8s environment
|
|
87
88
|
- `secrets.name` (String): K8s secrets name where env vars will be saved and fetched from. Sample: `my-app-secrets`
|
88
89
|
|
89
90
|
- `service.name`: K8s service name. Sample: `my-app-service`
|
90
|
-
- `service.port_name
|
91
|
-
- `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
|
91
|
+
- `service.port_name` (String, default `http-port`): Http port name to connect between k8s ingress and service. Sample: `http-port`. Note: max 15 characters
|
92
|
+
- `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
|
92
93
|
|
93
94
|
- `ingress.name`: Name of k8s ingress for the app: Sample: `my-app-ingress`
|
94
95
|
- `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
@@ -24,7 +24,14 @@ module KubernetesHelper
|
|
24
24
|
},
|
25
25
|
deployment: {
|
26
26
|
log_container: true
|
27
|
-
}
|
27
|
+
},
|
28
|
+
service: {
|
29
|
+
port_name: 'http-port',
|
30
|
+
backend_port_name: 'b-port'
|
31
|
+
},
|
32
|
+
secrets: {},
|
33
|
+
continuous_deployment: {},
|
34
|
+
ingress: {}
|
28
35
|
}
|
29
36
|
deep_merge(def_settings, settings || {})
|
30
37
|
end
|
data/lib/templates/cd.sh
CHANGED
@@ -37,13 +37,14 @@ then
|
|
37
37
|
fi
|
38
38
|
|
39
39
|
|
40
|
-
<%=continuous_deployment.before_building_image || ''%>
|
41
40
|
ALREADY_DEPLOYED="$(gcloud container images list-tags --format='get(tags)' $IMAGE_NAME | grep $CI_COMMIT_SHA || :;)"
|
42
41
|
if [ -z $ALREADY_DEPLOYED ]
|
43
42
|
then
|
44
43
|
## Build and push containers
|
45
44
|
echo "****** image not created yet, building image..."
|
45
|
+
<%=continuous_deployment.before_building_image || ''%>
|
46
46
|
docker $DOCKER_BUILD_CMD -t $DEPLOY_NAME .
|
47
|
+
<%=continuous_deployment.after_building_image || ''%>
|
47
48
|
docker push $DEPLOY_NAME
|
48
49
|
else
|
49
50
|
echo "****** image was already created: $ALREADY_DEPLOYED"
|
data/lib/templates/settings.rb
CHANGED