@pattform/api-kit 3.3.0 → 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
|
|
@@ -21,6 +21,10 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
21
21
|
const imageRefFromConfig = (_c = args.imageDigest) !== null && _c !== void 0 ? _c : componentConfig.get("imageRef");
|
|
22
22
|
// Create an Artifact Registry repository
|
|
23
23
|
this.repository = new gcp.artifactregistry.Repository("container-component-" + args.imageName + "-repo-" + args.environment, {
|
|
24
|
+
// Explicit (and on the Cloud Run service below): a capability's
|
|
25
|
+
// provider defaults to the platform project (pattform-management),
|
|
26
|
+
// not the client's.
|
|
27
|
+
project: gcpProject,
|
|
24
28
|
description: args.environment + " repository for " + args.imageName + " Docker images",
|
|
25
29
|
format: "DOCKER",
|
|
26
30
|
location: gcpRegion,
|
|
@@ -54,14 +58,17 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
54
58
|
// Default Spring Boot probe paths (can be overridden via args)
|
|
55
59
|
const defaultReadinessPath = (_d = args.readinessPath) !== null && _d !== void 0 ? _d : "/actuator/health/readiness";
|
|
56
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;
|
|
57
63
|
// Create a Cloud Run service for the container image.
|
|
58
64
|
this.service = new gcp.cloudrunv2.Service("container-component-" + args.imageName + "-service-" + args.environment, {
|
|
65
|
+
project: gcpProject,
|
|
59
66
|
location: gcpRegion,
|
|
60
67
|
ingress: "INGRESS_TRAFFIC_ALL",
|
|
61
68
|
name: args.imageName + "-" + args.environment,
|
|
62
69
|
invokerIamDisabled: true,
|
|
63
70
|
template: {
|
|
64
|
-
maxInstanceRequestConcurrency: (
|
|
71
|
+
maxInstanceRequestConcurrency: (_g = args.concurrency) !== null && _g !== void 0 ? _g : 30,
|
|
65
72
|
scaling: {
|
|
66
73
|
maxInstanceCount: 2
|
|
67
74
|
},
|
|
@@ -86,7 +93,7 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
86
93
|
livenessProbe: {
|
|
87
94
|
httpGet: {
|
|
88
95
|
path: defaultLivenessPath,
|
|
89
|
-
port:
|
|
96
|
+
port: probePort,
|
|
90
97
|
},
|
|
91
98
|
initialDelaySeconds: 30,
|
|
92
99
|
periodSeconds: 20,
|
|
@@ -96,7 +103,7 @@ class ContainerComponent extends pulumi.ComponentResource {
|
|
|
96
103
|
startupProbe: {
|
|
97
104
|
httpGet: {
|
|
98
105
|
path: defaultReadinessPath,
|
|
99
|
-
port:
|
|
106
|
+
port: probePort,
|
|
100
107
|
},
|
|
101
108
|
initialDelaySeconds: 2,
|
|
102
109
|
periodSeconds: 5,
|