typekro 0.16.1 → 0.17.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.
@@ -3,8 +3,10 @@
3
3
  *
4
4
  * Caddy here is a CONFIG-DRIVEN reverse proxy (not the Caddy ingress-controller, and not a Helm
5
5
  * bootstrap): the composition runs the official `caddy` image with a Caddyfile we supply, and emits a
6
- * ConfigMap (Caddyfile) + Deployment + Service + PVC. Caddy's built-in `tls internal` issues certs from a
7
- * local CA (no cert-manager), so the PVC persists `/data` (the CA root) across restarts.
6
+ * ConfigMap (Caddyfile) + Deployment + Service + a `/data` volume. Caddy's built-in `tls internal` issues
7
+ * certs from a local CA (no cert-manager). By default `/data` is a PVC so the CA root persists across
8
+ * restarts; `makeCaddyIngress({ ephemeral: true })` uses an `emptyDir` instead (CA regenerates per pod),
9
+ * and that variant takes no `persistence` config (see `CaddyIngressEphemeralConfigSchema`).
8
10
  *
9
11
  * KRO-safety note: the Caddyfile is supplied as a STRING (`caddyfile`), not derived from a structured
10
12
  * `routes` array inside the composition. A `routes` array would be a graph proxy in KRO mode and cannot be
@@ -18,9 +20,11 @@ const resourceRequirementsSchemaShape = {
18
20
  'limits?': { 'cpu?': 'string', 'memory?': 'string' },
19
21
  };
20
22
  /**
21
- * Sizing for the PVC backing Caddy's `/data` (the `tls internal` CA root + issued certs). The PVC is
22
- * always created persisting the CA root is required so it's stable across restarts; an ephemeral/emptyDir
23
- * mode isn't offered because a conditional volume can't be expressed safely in KRO (compound includeWhen).
23
+ * Sizing for the PVC backing Caddy's `/data` (the `tls internal` CA root + issued certs), persisting the
24
+ * CA across restarts. An `emptyDir` alternative IS available, but as a BUILD-TIME option on the
25
+ * composition (`makeCaddyIngress({ ephemeral: true })`), not a spec field the storage choice is made
26
+ * when the composition is constructed, so it selects the resource set statically and never needs a KRO
27
+ * runtime conditional. (A spec-field toggle would require an unsafe compound `includeWhen`.)
24
28
  */
25
29
  const persistenceSchemaShape = {
26
30
  'size?': 'string',
@@ -34,7 +38,7 @@ const persistenceSchemaShape = {
34
38
  * dropped — notably `replicaCount`: this composition is single-replica by design (the `tls internal` CA
35
39
  * lives in a RWO PVC one pod owns), so a replica knob would invite a broken multi-pod-shares-RWO setup.
36
40
  */
37
- export const CaddyIngressConfigSchema = type({
41
+ const baseCaddyIngressShape = {
38
42
  '+': 'reject',
39
43
  name: 'string',
40
44
  'namespace?': 'string',
@@ -53,10 +57,20 @@ export const CaddyIngressConfigSchema = type({
53
57
  'httpsPort?': 'number',
54
58
  /** Service type (default ClusterIP — reached via the access tunnel; no public LB). */
55
59
  'serviceType?': '"ClusterIP" | "NodePort" | "LoadBalancer"',
56
- /** Sizing for the always-created `/data` PVC that holds the `tls internal` CA root (default 1Gi). */
57
- 'persistence?': persistenceSchemaShape,
58
60
  'resources?': resourceRequirementsSchemaShape,
61
+ };
62
+ /** The default (PVC-backed) Caddy-ingress config. `persistence` sizes the `/data` PVC. */
63
+ export const CaddyIngressConfigSchema = type({
64
+ ...baseCaddyIngressShape,
65
+ /** Sizing for the `/data` PVC that holds the `tls internal` CA root (default 1Gi). PVC mode only. */
66
+ 'persistence?': persistenceSchemaShape,
59
67
  });
68
+ /**
69
+ * The ephemeral (emptyDir) Caddy-ingress config — used by `makeCaddyIngress({ ephemeral: true })`. It has
70
+ * NO `persistence` field: there is no PVC to size, so a `persistence` value would be silently ignored.
71
+ * The inherited `'+': 'reject'` makes passing `persistence` (or any unknown key) fail loudly instead.
72
+ */
73
+ export const CaddyIngressEphemeralConfigSchema = type({ ...baseCaddyIngressShape });
60
74
  /**
61
75
  * Caddy ingress status. `ready` is a direct Deployment-proxy comparison (multi-resource non-Helm
62
76
  * composition → no `Cel.expr`/conditions array): `status.readyReplicas >= spec.replicas`. The Deployment
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/factories/caddy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,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AE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;CAC5C,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG;IAC7B,OAAO,EAAE,QAAQ;IACjB,eAAe,EAAE,QAAQ;CACjB,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG;IAC5B,GAAG,EAAE,QAAQ;IACb,IAAI,EAAE,QAAQ;IACd,YAAY,EAAE,QAAQ;IACtB,0GAA0G;IAC1G,SAAS,EAAE,QAAQ;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,QAAQ;IAClB;;;OAGG;IACH,UAAU,EAAE,QAAQ;IACpB,kEAAkE;IAClE,WAAW,EAAE,QAAQ;IACrB,oEAAoE;IACpE,YAAY,EAAE,QAAQ;IACtB,sFAAsF;IACtF,cAAc,EAAE,2CAA2C;IAC3D,YAAY,EAAE,+BAA+B;CACrC,CAAC;AAEX,0FAA0F;AAC1F,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3C,GAAG,qBAAqB;IACxB,qGAAqG;IACrG,cAAc,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC,CAAC;AAGpF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3C,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typekro",
3
- "version": "0.16.1",
3
+ "version": "0.17.0",
4
4
  "description": "A control plane aware framework for orchestrating kubernetes resources like a programmer.",
5
5
  "type": "module",
6
6
  "repository": {