@cyc-seattle/platform 1.24.1 → 1.25.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.
package/README.md CHANGED
@@ -33,7 +33,7 @@ app owns. The apps that run on it live in their own repos, such as
33
33
  much, or every preview shows a change.
34
34
  - `WebService` is a `Workload` behind the environment's Gateway at `hostname`. Its Service exposes
35
35
  `port` as port 80, and its readiness probe must be an HTTP GET, which the load balancer's health
36
- check reuses. With `paths`, it claims only those path prefixes on `hostname`, and another
36
+ check reuses unless `healthCheck.path` names a cheaper path. With `paths`, it claims only those path prefixes on `hostname`, and another
37
37
  `WebService` can serve the rest of it.
38
38
  - `ScheduledJob` runs a CronJob on `schedule`, in `America/Los_Angeles` unless `timeZone` says
39
39
  otherwise. A run never overlaps the one before it, gets an hour, and doesn't retry, by default.
@@ -13,15 +13,18 @@ export interface WebServiceArgs extends WorkloadArgs {
13
13
  paths?: string[];
14
14
  /** The port the container serves HTTP on. The Service exposes it as port 80, named `http`. */
15
15
  port: number;
16
- /** An HTTP GET probe. The load balancer's health check uses the same path. */
16
+ /** An HTTP GET probe. The load balancer's health check uses the same path, unless `healthCheck.path` is set. */
17
17
  readinessProbe: Probe & {
18
18
  httpGet: pulumi.Input<k8s.types.input.core.v1.HTTPGetAction>;
19
19
  };
20
20
  /**
21
- * The load balancer's check timing. GKE's default is every 5s from each of several probers, which
22
- * an app whose readiness check reaches its database may not afford.
21
+ * The load balancer's check. GKE's default timing is every 5s from each of several probers, which
22
+ * an app whose readiness check reaches its database may not afford. `path` lets the load balancer
23
+ * check a cheaper path than the readiness probe. The kubelet still runs the readiness probe, and a
24
+ * pod that fails it leaves the load balancer's endpoints either way.
23
25
  */
24
26
  healthCheck?: {
27
+ path?: string;
25
28
  checkIntervalSec?: number;
26
29
  timeoutSec?: number;
27
30
  };
@@ -50,6 +50,7 @@ export class WebService extends pulumi.ComponentResource {
50
50
  const metadata = { name, namespace: platform.namespace, labels: { "app.kubernetes.io/name": name } };
51
51
  const child = { parent: this, provider: args.provider };
52
52
  const paths = args.paths && checkPaths(name, args.paths);
53
+ const { path: healthCheckPath, ...healthCheckTiming } = args.healthCheck ?? {};
53
54
  const { serviceAccount, service } = deployment(this, name, args, args.port);
54
55
  const backendRefs = [{ name: service.metadata.name, port: 80 }];
55
56
  new k8s.apiextensions.CustomResource(name, {
@@ -73,12 +74,12 @@ export class WebService extends pulumi.ComponentResource {
73
74
  metadata,
74
75
  spec: {
75
76
  default: {
76
- ...args.healthCheck,
77
+ ...healthCheckTiming,
77
78
  config: {
78
79
  type: "HTTP",
79
80
  httpHealthCheck: {
80
81
  portSpecification: "USE_SERVING_PORT",
81
- requestPath: pulumi.output(args.readinessProbe.httpGet).apply((get) => get?.path ?? "/"),
82
+ requestPath: healthCheckPath ?? pulumi.output(args.readinessProbe.httpGet).apply((get) => get?.path ?? "/"),
82
83
  },
83
84
  },
84
85
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyc-seattle/platform",
3
- "version": "1.24.1",
3
+ "version": "1.25.0",
4
4
  "description": "Pulumi components for CYC's shared Google Cloud platform: WebService, the platform outputs reader, and the stacks that build the platform",
5
5
  "author": "CYC Community Sailing Center",
6
6
  "license": "Apache-2.0",