typekro 0.16.1 → 0.18.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/dist/.tsbuildinfo +1 -1
- package/dist/core/deployment/kro-factory.d.ts +9 -0
- package/dist/core/deployment/kro-factory.d.ts.map +1 -1
- package/dist/core/deployment/kro-factory.js +197 -8
- package/dist/core/deployment/kro-factory.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-helpers.js +9 -7
- package/dist/core/expressions/composition/composition-analyzer-helpers.js.map +1 -1
- package/dist/core/types/deployment.d.ts +31 -1
- package/dist/core/types/deployment.d.ts.map +1 -1
- package/dist/core/types/deployment.js.map +1 -1
- package/dist/factories/caddy/compositions/caddy-ingress.d.ts +39 -7
- package/dist/factories/caddy/compositions/caddy-ingress.d.ts.map +1 -1
- package/dist/factories/caddy/compositions/caddy-ingress.js +67 -34
- package/dist/factories/caddy/compositions/caddy-ingress.js.map +1 -1
- package/dist/factories/caddy/compositions/index.d.ts +1 -1
- package/dist/factories/caddy/compositions/index.d.ts.map +1 -1
- package/dist/factories/caddy/compositions/index.js +1 -1
- package/dist/factories/caddy/compositions/index.js.map +1 -1
- package/dist/factories/caddy/index.d.ts +7 -4
- package/dist/factories/caddy/index.d.ts.map +1 -1
- package/dist/factories/caddy/index.js +7 -4
- package/dist/factories/caddy/index.js.map +1 -1
- package/dist/factories/caddy/types.d.ts +35 -14
- package/dist/factories/caddy/types.d.ts.map +1 -1
- package/dist/factories/caddy/types.js +22 -8
- package/dist/factories/caddy/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,35 +3,30 @@
|
|
|
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 +
|
|
7
|
-
* local CA (no cert-manager)
|
|
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
|
|
11
13
|
* `.map()`-ed into a string (see integration-skill rules 32/48). Use the exported `renderCaddyfile()`
|
|
12
14
|
* helper to build the string from routes in concrete (consumer/direct) contexts, then pass it here.
|
|
13
15
|
*/
|
|
14
|
-
/**
|
|
15
|
-
* Caddy ingress config. `caddyfile` is the raw Caddyfile content (the routing + TLS config), supplied as
|
|
16
|
-
* a string so it passes through unchanged in both direct and KRO modes.
|
|
17
|
-
*
|
|
18
|
-
* Undeclared keys are REJECTED (`'+': 'reject'`) so misconfig fails loudly rather than being silently
|
|
19
|
-
* dropped — notably `replicaCount`: this composition is single-replica by design (the `tls internal` CA
|
|
20
|
-
* lives in a RWO PVC one pod owns), so a replica knob would invite a broken multi-pod-shares-RWO setup.
|
|
21
|
-
*/
|
|
16
|
+
/** The default (PVC-backed) Caddy-ingress config. `persistence` sizes the `/data` PVC. */
|
|
22
17
|
export declare const CaddyIngressConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
23
18
|
name: string;
|
|
24
19
|
caddyfile: string;
|
|
20
|
+
persistence?: {
|
|
21
|
+
size?: string;
|
|
22
|
+
storageClass?: string;
|
|
23
|
+
};
|
|
25
24
|
namespace?: string;
|
|
26
25
|
image?: string;
|
|
27
26
|
version?: string;
|
|
28
27
|
httpPort?: number;
|
|
29
28
|
httpsPort?: number;
|
|
30
29
|
serviceType?: "ClusterIP" | "NodePort" | "LoadBalancer";
|
|
31
|
-
persistence?: {
|
|
32
|
-
size?: string;
|
|
33
|
-
storageClass?: string;
|
|
34
|
-
};
|
|
35
30
|
resources?: {
|
|
36
31
|
requests?: {
|
|
37
32
|
cpu?: string;
|
|
@@ -44,6 +39,32 @@ export declare const CaddyIngressConfigSchema: import("arktype/internal/variants
|
|
|
44
39
|
};
|
|
45
40
|
}, {}>;
|
|
46
41
|
export type CaddyIngressConfig = typeof CaddyIngressConfigSchema.infer;
|
|
42
|
+
/**
|
|
43
|
+
* The ephemeral (emptyDir) Caddy-ingress config — used by `makeCaddyIngress({ ephemeral: true })`. It has
|
|
44
|
+
* NO `persistence` field: there is no PVC to size, so a `persistence` value would be silently ignored.
|
|
45
|
+
* The inherited `'+': 'reject'` makes passing `persistence` (or any unknown key) fail loudly instead.
|
|
46
|
+
*/
|
|
47
|
+
export declare const CaddyIngressEphemeralConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
48
|
+
name: string;
|
|
49
|
+
caddyfile: string;
|
|
50
|
+
namespace?: string;
|
|
51
|
+
image?: string;
|
|
52
|
+
version?: string;
|
|
53
|
+
httpPort?: number;
|
|
54
|
+
httpsPort?: number;
|
|
55
|
+
serviceType?: "ClusterIP" | "NodePort" | "LoadBalancer";
|
|
56
|
+
resources?: {
|
|
57
|
+
requests?: {
|
|
58
|
+
cpu?: string;
|
|
59
|
+
memory?: string;
|
|
60
|
+
};
|
|
61
|
+
limits?: {
|
|
62
|
+
cpu?: string;
|
|
63
|
+
memory?: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}, {}>;
|
|
67
|
+
export type CaddyIngressEphemeralConfig = typeof CaddyIngressEphemeralConfigSchema.infer;
|
|
47
68
|
/**
|
|
48
69
|
* Caddy ingress status. `ready` is a direct Deployment-proxy comparison (multi-resource non-Helm
|
|
49
70
|
* composition → no `Cel.expr`/conditions array): `status.readyReplicas >= spec.replicas`. The Deployment
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/factories/caddy/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/factories/caddy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoDH,0FAA0F;AAC1F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;MAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,KAAK,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;MAAqC,CAAC;AACpF,MAAM,MAAM,2BAA2B,GAAG,OAAO,iCAAiC,CAAC,KAAK,CAAC;AAEzF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;MAGnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,wBAAwB,CAAC,KAAK,CAAC;AAEvE,uGAAuG;AACvG,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,qGAAqG;IACrG,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,WAAW,sBAAsB;IACrC,8FAA8F;IAC9F,GAAG,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;CAC1B"}
|
|
@@ -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 +
|
|
7
|
-
* local CA (no cert-manager)
|
|
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)
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/factories/caddy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,yDAAyD;AACzD,MAAM,+BAA+B,GAAG;IACtC,WAAW,EAAE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