@pattform/api-kit 3.3.1 → 3.4.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.
|
@@ -22,6 +22,7 @@ export interface ContainerComponentArgs {
|
|
|
22
22
|
concurrency?: number;
|
|
23
23
|
readinessPath?: pulumi.Input<string>;
|
|
24
24
|
livenessPath?: pulumi.Input<string>;
|
|
25
|
+
probePort?: pulumi.Input<number>;
|
|
25
26
|
gcpProject?: pulumi.Input<string>;
|
|
26
27
|
gcpRegion?: pulumi.Input<string>;
|
|
27
28
|
imageDigest?: pulumi.Input<string>;
|
|
@@ -9,7 +9,7 @@ const gcp = require("@pulumi/gcp");
|
|
|
9
9
|
*/
|
|
10
10
|
class ContainerComponent extends pulumi.ComponentResource {
|
|
11
11
|
constructor(name, args, opts) {
|
|
12
|
-
var _a, _b, _c, _d, _e, _f;
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
13
13
|
super("custom:pattform:ContainerComponent", name, args, opts);
|
|
14
14
|
// Project, region and image digest come from args when given (a
|
|
15
15
|
// capability has no stack config of its own), else from config as
|
|
@@ -58,6 +58,8 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
58
58
|
// Default Spring Boot probe paths (can be overridden via args)
|
|
59
59
|
const defaultReadinessPath = (_d = args.readinessPath) !== null && _d !== void 0 ? _d : "/actuator/health/readiness";
|
|
60
60
|
const defaultLivenessPath = (_e = args.livenessPath) !== null && _e !== void 0 ? _e : "/actuator/health/liveness";
|
|
61
|
+
// Spring Boot's actuator on its own management port (8081) by default.
|
|
62
|
+
const probePort = (_f = args.probePort) !== null && _f !== void 0 ? _f : 8081;
|
|
61
63
|
// Create a Cloud Run service for the container image.
|
|
62
64
|
this.service = new gcp.cloudrunv2.Service("container-component-" + args.imageName + "-service-" + args.environment, {
|
|
63
65
|
project: gcpProject,
|
|
@@ -66,7 +68,7 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
66
68
|
name: args.imageName + "-" + args.environment,
|
|
67
69
|
invokerIamDisabled: true,
|
|
68
70
|
template: {
|
|
69
|
-
maxInstanceRequestConcurrency: (
|
|
71
|
+
maxInstanceRequestConcurrency: (_g = args.concurrency) !== null && _g !== void 0 ? _g : 30,
|
|
70
72
|
scaling: {
|
|
71
73
|
maxInstanceCount: 2
|
|
72
74
|
},
|
|
@@ -91,7 +93,7 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
91
93
|
livenessProbe: {
|
|
92
94
|
httpGet: {
|
|
93
95
|
path: defaultLivenessPath,
|
|
94
|
-
port:
|
|
96
|
+
port: probePort,
|
|
95
97
|
},
|
|
96
98
|
initialDelaySeconds: 30,
|
|
97
99
|
periodSeconds: 20,
|
|
@@ -101,7 +103,7 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
101
103
|
startupProbe: {
|
|
102
104
|
httpGet: {
|
|
103
105
|
path: defaultReadinessPath,
|
|
104
|
-
port:
|
|
106
|
+
port: probePort,
|
|
105
107
|
},
|
|
106
108
|
initialDelaySeconds: 2,
|
|
107
109
|
periodSeconds: 5,
|