@intentius/chant-lexicon-k8s 0.6.0 → 0.8.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.
Files changed (257) hide show
  1. package/dist/actions/apps.d.ts +44 -0
  2. package/dist/actions/apps.d.ts.map +1 -0
  3. package/dist/actions/batch.d.ts +22 -0
  4. package/dist/actions/batch.d.ts.map +1 -0
  5. package/dist/actions/core.d.ts +131 -0
  6. package/dist/actions/core.d.ts.map +1 -0
  7. package/dist/actions/index.d.ts +9 -0
  8. package/dist/actions/index.d.ts.map +1 -0
  9. package/dist/actions/networking.d.ts +27 -0
  10. package/dist/actions/networking.d.ts.map +1 -0
  11. package/dist/actions/rbac.d.ts +40 -0
  12. package/dist/actions/rbac.d.ts.map +1 -0
  13. package/dist/codegen/docs-cli.d.ts +2 -0
  14. package/dist/codegen/docs-cli.d.ts.map +1 -0
  15. package/dist/codegen/docs.d.ts +12 -0
  16. package/dist/codegen/docs.d.ts.map +1 -0
  17. package/dist/codegen/generate-cli.d.ts +6 -0
  18. package/dist/codegen/generate-cli.d.ts.map +1 -0
  19. package/dist/codegen/generate-lexicon.d.ts +21 -0
  20. package/dist/codegen/generate-lexicon.d.ts.map +1 -0
  21. package/dist/codegen/generate-typescript.d.ts +11 -0
  22. package/dist/codegen/generate-typescript.d.ts.map +1 -0
  23. package/dist/codegen/generate.d.ts +19 -0
  24. package/dist/codegen/generate.d.ts.map +1 -0
  25. package/dist/codegen/naming.d.ts +15 -0
  26. package/dist/codegen/naming.d.ts.map +1 -0
  27. package/dist/codegen/package.d.ts +11 -0
  28. package/dist/codegen/package.d.ts.map +1 -0
  29. package/dist/codegen/patches.d.ts +31 -0
  30. package/dist/codegen/patches.d.ts.map +1 -0
  31. package/dist/codegen/typecheck.d.ts +5 -0
  32. package/dist/codegen/typecheck.d.ts.map +1 -0
  33. package/dist/codegen/versions.d.ts +20 -0
  34. package/dist/codegen/versions.d.ts.map +1 -0
  35. package/dist/composites/adot-collector.d.ts +66 -0
  36. package/dist/composites/adot-collector.d.ts.map +1 -0
  37. package/dist/composites/agic-ingress.d.ts +73 -0
  38. package/dist/composites/agic-ingress.d.ts.map +1 -0
  39. package/dist/composites/aks-external-dns-agent.d.ts +65 -0
  40. package/dist/composites/aks-external-dns-agent.d.ts.map +1 -0
  41. package/dist/composites/alb-ingress.d.ts +77 -0
  42. package/dist/composites/alb-ingress.d.ts.map +1 -0
  43. package/dist/composites/argo-app.d.ts +168 -0
  44. package/dist/composites/argo-app.d.ts.map +1 -0
  45. package/dist/composites/autoscaled-service.d.ts +106 -0
  46. package/dist/composites/autoscaled-service.d.ts.map +1 -0
  47. package/dist/composites/azure-disk-storage-class.d.ts +48 -0
  48. package/dist/composites/azure-disk-storage-class.d.ts.map +1 -0
  49. package/dist/composites/azure-file-storage-class.d.ts +46 -0
  50. package/dist/composites/azure-file-storage-class.d.ts.map +1 -0
  51. package/dist/composites/azure-monitor-collector.d.ts +63 -0
  52. package/dist/composites/azure-monitor-collector.d.ts.map +1 -0
  53. package/dist/composites/batch-job.d.ts +85 -0
  54. package/dist/composites/batch-job.d.ts.map +1 -0
  55. package/dist/composites/cockroachdb-cluster.d.ts +132 -0
  56. package/dist/composites/cockroachdb-cluster.d.ts.map +1 -0
  57. package/dist/composites/cockroachdb-region-stack.d.ts +164 -0
  58. package/dist/composites/cockroachdb-region-stack.d.ts.map +1 -0
  59. package/dist/composites/config-connector-context.d.ts +41 -0
  60. package/dist/composites/config-connector-context.d.ts.map +1 -0
  61. package/dist/composites/configured-app.d.ts +91 -0
  62. package/dist/composites/configured-app.d.ts.map +1 -0
  63. package/dist/composites/cron-workload.d.ts +76 -0
  64. package/dist/composites/cron-workload.d.ts.map +1 -0
  65. package/dist/composites/ebs-storage-class.d.ts +55 -0
  66. package/dist/composites/ebs-storage-class.d.ts.map +1 -0
  67. package/dist/composites/efs-storage-class.d.ts +47 -0
  68. package/dist/composites/efs-storage-class.d.ts.map +1 -0
  69. package/dist/composites/external-dns-agent.d.ts +58 -0
  70. package/dist/composites/external-dns-agent.d.ts.map +1 -0
  71. package/dist/composites/filestore-storage-class.d.ts +46 -0
  72. package/dist/composites/filestore-storage-class.d.ts.map +1 -0
  73. package/dist/composites/fluent-bit-agent.d.ts +66 -0
  74. package/dist/composites/fluent-bit-agent.d.ts.map +1 -0
  75. package/dist/composites/gce-ingress.d.ts +72 -0
  76. package/dist/composites/gce-ingress.d.ts.map +1 -0
  77. package/dist/composites/gce-pd-storage-class.d.ts +48 -0
  78. package/dist/composites/gce-pd-storage-class.d.ts.map +1 -0
  79. package/dist/composites/gke-external-dns-agent.d.ts +59 -0
  80. package/dist/composites/gke-external-dns-agent.d.ts.map +1 -0
  81. package/dist/composites/gke-fluent-bit-agent.d.ts +64 -0
  82. package/dist/composites/gke-fluent-bit-agent.d.ts.map +1 -0
  83. package/dist/composites/gke-gateway.d.ts +63 -0
  84. package/dist/composites/gke-gateway.d.ts.map +1 -0
  85. package/dist/composites/gke-otel-collector.d.ts +64 -0
  86. package/dist/composites/gke-otel-collector.d.ts.map +1 -0
  87. package/dist/composites/index.d.ts +86 -0
  88. package/dist/composites/index.d.ts.map +1 -0
  89. package/dist/composites/irsa-service-account.d.ts +54 -0
  90. package/dist/composites/irsa-service-account.d.ts.map +1 -0
  91. package/dist/composites/metrics-server.d.ts +56 -0
  92. package/dist/composites/metrics-server.d.ts.map +1 -0
  93. package/dist/composites/monitored-service.d.ts +92 -0
  94. package/dist/composites/monitored-service.d.ts.map +1 -0
  95. package/dist/composites/namespace-env.d.ts +64 -0
  96. package/dist/composites/namespace-env.d.ts.map +1 -0
  97. package/dist/composites/network-isolated-app.d.ts +88 -0
  98. package/dist/composites/network-isolated-app.d.ts.map +1 -0
  99. package/dist/composites/node-agent.d.ts +87 -0
  100. package/dist/composites/node-agent.d.ts.map +1 -0
  101. package/dist/composites/ray-cluster.d.ts +179 -0
  102. package/dist/composites/ray-cluster.d.ts.map +1 -0
  103. package/dist/composites/ray-job.d.ts +88 -0
  104. package/dist/composites/ray-job.d.ts.map +1 -0
  105. package/dist/composites/ray-service.d.ts +87 -0
  106. package/dist/composites/ray-service.d.ts.map +1 -0
  107. package/dist/composites/secure-ingress.d.ts +66 -0
  108. package/dist/composites/secure-ingress.d.ts.map +1 -0
  109. package/dist/composites/security-context.d.ts +17 -0
  110. package/dist/composites/security-context.d.ts.map +1 -0
  111. package/dist/composites/sidecar-app.d.ts +121 -0
  112. package/dist/composites/sidecar-app.d.ts.map +1 -0
  113. package/dist/composites/stateful-app.d.ts +82 -0
  114. package/dist/composites/stateful-app.d.ts.map +1 -0
  115. package/dist/composites/web-app.d.ts +95 -0
  116. package/dist/composites/web-app.d.ts.map +1 -0
  117. package/dist/composites/worker-pool.d.ts +96 -0
  118. package/dist/composites/worker-pool.d.ts.map +1 -0
  119. package/dist/composites/workload-identity-sa.d.ts +54 -0
  120. package/dist/composites/workload-identity-sa.d.ts.map +1 -0
  121. package/dist/composites/workload-identity-service-account.d.ts +54 -0
  122. package/dist/composites/workload-identity-service-account.d.ts.map +1 -0
  123. package/dist/coverage.d.ts +14 -0
  124. package/dist/coverage.d.ts.map +1 -0
  125. package/dist/crd/crd-sources.d.ts +10 -0
  126. package/dist/crd/crd-sources.d.ts.map +1 -0
  127. package/dist/crd/loader.d.ts +17 -0
  128. package/dist/crd/loader.d.ts.map +1 -0
  129. package/dist/crd/parser.d.ts +21 -0
  130. package/dist/crd/parser.d.ts.map +1 -0
  131. package/dist/crd/types.d.ts +55 -0
  132. package/dist/crd/types.d.ts.map +1 -0
  133. package/dist/default-labels.d.ts +84 -0
  134. package/dist/default-labels.d.ts.map +1 -0
  135. package/dist/describe-resources.d.ts +30 -0
  136. package/dist/describe-resources.d.ts.map +1 -0
  137. package/dist/detect.d.ts +4 -0
  138. package/dist/detect.d.ts.map +1 -0
  139. package/dist/export-resources.d.ts +8 -0
  140. package/dist/export-resources.d.ts.map +1 -0
  141. package/dist/generated/index.d.ts +295 -0
  142. package/dist/generated/index.d.ts.map +1 -0
  143. package/dist/generated/runtime.d.ts +5 -0
  144. package/dist/generated/runtime.d.ts.map +1 -0
  145. package/dist/import/generator.d.ts +25 -0
  146. package/dist/import/generator.d.ts.map +1 -0
  147. package/dist/import/live-export.d.ts +18 -0
  148. package/dist/import/live-export.d.ts.map +1 -0
  149. package/dist/import/parser.d.ts +19 -0
  150. package/dist/import/parser.d.ts.map +1 -0
  151. package/dist/index.d.ts +20 -0
  152. package/dist/index.d.ts.map +1 -0
  153. package/dist/integrity.json +2 -2
  154. package/dist/lint/post-synth/argo-helpers.d.ts +24 -0
  155. package/dist/lint/post-synth/argo-helpers.d.ts.map +1 -0
  156. package/dist/lint/post-synth/argo002.d.ts +12 -0
  157. package/dist/lint/post-synth/argo002.d.ts.map +1 -0
  158. package/dist/lint/post-synth/argo003.d.ts +14 -0
  159. package/dist/lint/post-synth/argo003.d.ts.map +1 -0
  160. package/dist/lint/post-synth/argo005.d.ts +3 -0
  161. package/dist/lint/post-synth/argo005.d.ts.map +1 -0
  162. package/dist/lint/post-synth/index.d.ts +3 -0
  163. package/dist/lint/post-synth/index.d.ts.map +1 -0
  164. package/dist/lint/post-synth/k8s-helpers.d.ts +97 -0
  165. package/dist/lint/post-synth/k8s-helpers.d.ts.map +1 -0
  166. package/dist/lint/post-synth/wk8005.d.ts +10 -0
  167. package/dist/lint/post-synth/wk8005.d.ts.map +1 -0
  168. package/dist/lint/post-synth/wk8006.d.ts +9 -0
  169. package/dist/lint/post-synth/wk8006.d.ts.map +1 -0
  170. package/dist/lint/post-synth/wk8041.d.ts +10 -0
  171. package/dist/lint/post-synth/wk8041.d.ts.map +1 -0
  172. package/dist/lint/post-synth/wk8042.d.ts +10 -0
  173. package/dist/lint/post-synth/wk8042.d.ts.map +1 -0
  174. package/dist/lint/post-synth/wk8101.d.ts +10 -0
  175. package/dist/lint/post-synth/wk8101.d.ts.map +1 -0
  176. package/dist/lint/post-synth/wk8102.d.ts +9 -0
  177. package/dist/lint/post-synth/wk8102.d.ts.map +1 -0
  178. package/dist/lint/post-synth/wk8103.d.ts +9 -0
  179. package/dist/lint/post-synth/wk8103.d.ts.map +1 -0
  180. package/dist/lint/post-synth/wk8104.d.ts +10 -0
  181. package/dist/lint/post-synth/wk8104.d.ts.map +1 -0
  182. package/dist/lint/post-synth/wk8105.d.ts +10 -0
  183. package/dist/lint/post-synth/wk8105.d.ts.map +1 -0
  184. package/dist/lint/post-synth/wk8201.d.ts +10 -0
  185. package/dist/lint/post-synth/wk8201.d.ts.map +1 -0
  186. package/dist/lint/post-synth/wk8202.d.ts +10 -0
  187. package/dist/lint/post-synth/wk8202.d.ts.map +1 -0
  188. package/dist/lint/post-synth/wk8203.d.ts +10 -0
  189. package/dist/lint/post-synth/wk8203.d.ts.map +1 -0
  190. package/dist/lint/post-synth/wk8204.d.ts +14 -0
  191. package/dist/lint/post-synth/wk8204.d.ts.map +1 -0
  192. package/dist/lint/post-synth/wk8205.d.ts +10 -0
  193. package/dist/lint/post-synth/wk8205.d.ts.map +1 -0
  194. package/dist/lint/post-synth/wk8207.d.ts +10 -0
  195. package/dist/lint/post-synth/wk8207.d.ts.map +1 -0
  196. package/dist/lint/post-synth/wk8208.d.ts +10 -0
  197. package/dist/lint/post-synth/wk8208.d.ts.map +1 -0
  198. package/dist/lint/post-synth/wk8209.d.ts +10 -0
  199. package/dist/lint/post-synth/wk8209.d.ts.map +1 -0
  200. package/dist/lint/post-synth/wk8301.d.ts +15 -0
  201. package/dist/lint/post-synth/wk8301.d.ts.map +1 -0
  202. package/dist/lint/post-synth/wk8302.d.ts +9 -0
  203. package/dist/lint/post-synth/wk8302.d.ts.map +1 -0
  204. package/dist/lint/post-synth/wk8303.d.ts +10 -0
  205. package/dist/lint/post-synth/wk8303.d.ts.map +1 -0
  206. package/dist/lint/post-synth/wk8304.d.ts +10 -0
  207. package/dist/lint/post-synth/wk8304.d.ts.map +1 -0
  208. package/dist/lint/post-synth/wk8305.d.ts +9 -0
  209. package/dist/lint/post-synth/wk8305.d.ts.map +1 -0
  210. package/dist/lint/post-synth/wk8306.d.ts +11 -0
  211. package/dist/lint/post-synth/wk8306.d.ts.map +1 -0
  212. package/dist/lint/post-synth/wk8401.d.ts +11 -0
  213. package/dist/lint/post-synth/wk8401.d.ts.map +1 -0
  214. package/dist/lint/post-synth/wk8402.d.ts +10 -0
  215. package/dist/lint/post-synth/wk8402.d.ts.map +1 -0
  216. package/dist/lint/post-synth/wk8403.d.ts +10 -0
  217. package/dist/lint/post-synth/wk8403.d.ts.map +1 -0
  218. package/dist/lint/rules/argo-appset-single-project.d.ts +18 -0
  219. package/dist/lint/rules/argo-appset-single-project.d.ts.map +1 -0
  220. package/dist/lint/rules/argo-ast.d.ts +37 -0
  221. package/dist/lint/rules/argo-ast.d.ts.map +1 -0
  222. package/dist/lint/rules/argo-automated-prune.d.ts +20 -0
  223. package/dist/lint/rules/argo-automated-prune.d.ts.map +1 -0
  224. package/dist/lint/rules/hardcoded-namespace.d.ts +13 -0
  225. package/dist/lint/rules/hardcoded-namespace.d.ts.map +1 -0
  226. package/dist/lint/rules/latest-image-tag.d.ts +3 -0
  227. package/dist/lint/rules/latest-image-tag.d.ts.map +1 -0
  228. package/dist/lint/rules/missing-resource-limits.d.ts +3 -0
  229. package/dist/lint/rules/missing-resource-limits.d.ts.map +1 -0
  230. package/dist/lsp/completions.d.ts +6 -0
  231. package/dist/lsp/completions.d.ts.map +1 -0
  232. package/dist/lsp/hover.d.ts +6 -0
  233. package/dist/lsp/hover.d.ts.map +1 -0
  234. package/dist/manifest.json +1 -1
  235. package/dist/micro-time.d.ts +43 -0
  236. package/dist/micro-time.d.ts.map +1 -0
  237. package/dist/package-cli.d.ts +6 -0
  238. package/dist/package-cli.d.ts.map +1 -0
  239. package/dist/plugin.d.ts +9 -0
  240. package/dist/plugin.d.ts.map +1 -0
  241. package/dist/serializer.d.ts +12 -0
  242. package/dist/serializer.d.ts.map +1 -0
  243. package/dist/spec/fetch.d.ts +34 -0
  244. package/dist/spec/fetch.d.ts.map +1 -0
  245. package/dist/spec/parse.d.ts +73 -0
  246. package/dist/spec/parse.d.ts.map +1 -0
  247. package/dist/validate-cli.d.ts +6 -0
  248. package/dist/validate-cli.d.ts.map +1 -0
  249. package/dist/validate.d.ts +15 -0
  250. package/dist/validate.d.ts.map +1 -0
  251. package/dist/variables.d.ts +35 -0
  252. package/dist/variables.d.ts.map +1 -0
  253. package/package.json +24 -5
  254. package/src/composites/argo-app.ts +3 -3
  255. package/src/detect.ts +9 -0
  256. package/src/lint/post-synth/index.ts +63 -0
  257. package/src/plugin.ts +4 -12
@@ -0,0 +1,87 @@
1
+ /**
2
+ * NodeAgent composite — DaemonSet + ServiceAccount + ClusterRole + ClusterRoleBinding + optional ConfigMap.
3
+ *
4
+ * A higher-level construct for per-node agents (Fluentd, Prometheus Node Exporter,
5
+ * security scanners) that need cluster-wide RBAC and tolerations.
6
+ */
7
+ import { DaemonSet, ServiceAccount, ClusterRole, ClusterRoleBinding, ConfigMap } from "../generated/index.js";
8
+ import type { ContainerSecurityContext } from "./security-context.js";
9
+ export interface NodeAgentProps {
10
+ /** Agent name — used in metadata and labels. */
11
+ name: string;
12
+ /** Container image. */
13
+ image: string;
14
+ /** Metrics port (optional). */
15
+ port?: number;
16
+ /** Host path mounts. */
17
+ hostPaths?: Array<{
18
+ name: string;
19
+ hostPath: string;
20
+ mountPath: string;
21
+ readOnly?: boolean;
22
+ }>;
23
+ /** Config data — creates a ConfigMap mounted at /etc/{name}/. */
24
+ config?: Record<string, string>;
25
+ /** ClusterRole RBAC rules (required). */
26
+ rbacRules: Array<{
27
+ apiGroups: string[];
28
+ resources: string[];
29
+ verbs: string[];
30
+ }>;
31
+ /** Tolerate all taints so agent runs on every node (default: true). */
32
+ tolerateAllTaints?: boolean;
33
+ /** Namespace for namespaced resources (DaemonSet, ServiceAccount, ConfigMap). */
34
+ namespace?: string;
35
+ /** Additional labels to apply to all resources. */
36
+ labels?: Record<string, string>;
37
+ /** CPU request (default: "50m"). */
38
+ cpuRequest?: string;
39
+ /** Memory request (default: "64Mi"). */
40
+ memoryRequest?: string;
41
+ /** CPU limit (default: "200m"). */
42
+ cpuLimit?: string;
43
+ /** Memory limit (default: "128Mi"). */
44
+ memoryLimit?: string;
45
+ /** Environment variables for the container. */
46
+ env?: Array<{
47
+ name: string;
48
+ value: string;
49
+ }>;
50
+ /** Container security context (supports PSS restricted fields). */
51
+ securityContext?: ContainerSecurityContext;
52
+ /** Per-member defaults for fine-grained overrides. */
53
+ defaults?: {
54
+ daemonSet?: Partial<Record<string, unknown>>;
55
+ serviceAccount?: Partial<Record<string, unknown>>;
56
+ clusterRole?: Partial<Record<string, unknown>>;
57
+ clusterRoleBinding?: Partial<Record<string, unknown>>;
58
+ configMap?: Partial<Record<string, unknown>>;
59
+ };
60
+ }
61
+ export interface NodeAgentResult {
62
+ daemonSet: InstanceType<typeof DaemonSet>;
63
+ serviceAccount: InstanceType<typeof ServiceAccount>;
64
+ clusterRole: InstanceType<typeof ClusterRole>;
65
+ clusterRoleBinding: InstanceType<typeof ClusterRoleBinding>;
66
+ configMap?: InstanceType<typeof ConfigMap>;
67
+ }
68
+ /**
69
+ * Create a NodeAgent composite — returns prop objects for
70
+ * a DaemonSet, ServiceAccount, ClusterRole, ClusterRoleBinding, and optional ConfigMap.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * import { NodeAgent } from "@intentius/chant-lexicon-k8s";
75
+ *
76
+ * const { daemonSet, serviceAccount, clusterRole, clusterRoleBinding } = NodeAgent({
77
+ * name: "log-collector",
78
+ * image: "fluentd:v1.16",
79
+ * hostPaths: [{ name: "varlog", hostPath: "/var/log", mountPath: "/var/log" }],
80
+ * rbacRules: [
81
+ * { apiGroups: [""], resources: ["pods", "namespaces"], verbs: ["get", "list", "watch"] },
82
+ * ],
83
+ * });
84
+ * ```
85
+ */
86
+ export declare const NodeAgent: import("@intentius/chant").CompositeDefinition<NodeAgentProps, import("@intentius/chant").CompositeMembers>;
87
+ //# sourceMappingURL=node-agent.d.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;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,mEAAmE;IACnE,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,sDAAsD;IACtD,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAClD,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC/C,kBAAkB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACtD,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC9C,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;IAC1C,cAAc,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;IACpD,WAAW,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;IAC9C,kBAAkB,EAAE,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS,6GAyJP,CAAC"}
@@ -0,0 +1,179 @@
1
+ /**
2
+ * RayCluster composite — KubeRay RayCluster CR + surrounding K8s infra.
3
+ *
4
+ * Encodes production defaults for running Ray on Kubernetes:
5
+ * - NetworkPolicy with podSelector rules (avoids GKE pod CIDR mismatch)
6
+ * - PodDisruptionBudget on the head (minAvailable: 1)
7
+ * - preStop: ray stop hooks + terminationGracePeriodSeconds: 120 on all pods
8
+ * - ServiceAccount for the head + optional autoscaler ClusterRole/CRB
9
+ * - Optional shared ReadWriteMany PVC for training data (Filestore/EFS)
10
+ * - Optional GCS spillover env var for object store spill-to-GCS
11
+ */
12
+ import { ServiceAccount, ClusterRole, ClusterRoleBinding, NetworkPolicy, PodDisruptionBudget, PersistentVolumeClaim, Service, RayCluster as RayClusterResource } from "../generated/index.js";
13
+ /** Container resource spec for Ray pods. */
14
+ export interface ResourceSpec {
15
+ /** CPU request/limit (e.g. "2", "500m"). */
16
+ cpu: string;
17
+ /** Memory request/limit (e.g. "4Gi", "512Mi"). */
18
+ memory: string;
19
+ /** GPU count — adds nvidia.com/gpu to resource requests and limits. */
20
+ gpu?: number;
21
+ }
22
+ /** Head node configuration. */
23
+ export interface HeadGroupSpec {
24
+ resources: ResourceSpec;
25
+ /**
26
+ * Shared memory size mounted at /dev/shm (default: "2Gi").
27
+ * Prevents OOM when PyTorch workers share tensors via /dev/shm.
28
+ */
29
+ shmSize?: string;
30
+ /**
31
+ * When true, sets num-cpus=0 so the Ray scheduler never places user tasks on
32
+ * the head node. Recommended for production — keeps the head free for GCS,
33
+ * dashboard, and autoscaler. Default: false.
34
+ */
35
+ reserveHead?: boolean;
36
+ /** Additional Ray start params merged into defaults. */
37
+ rayStartParams?: Record<string, string>;
38
+ /** Additional environment variables for the head container. */
39
+ env?: Array<{
40
+ name: string;
41
+ value: string;
42
+ }>;
43
+ }
44
+ /** Worker group configuration. */
45
+ export interface WorkerGroupSpec {
46
+ /** Worker group name — used as a selector label (e.g. "cpu", "gpu"). */
47
+ groupName: string;
48
+ /** Initial replica count. */
49
+ replicas: number;
50
+ /** Minimum replicas for autoscaling (default: replicas). */
51
+ minReplicas?: number;
52
+ /** Maximum replicas for autoscaling (default: replicas). */
53
+ maxReplicas?: number;
54
+ resources: ResourceSpec;
55
+ /**
56
+ * Idle timeout before the Ray autoscaler terminates idle workers (default: 60s).
57
+ * Use 300s for GPU groups to amortize initialization overhead.
58
+ */
59
+ idleTimeoutSeconds?: number;
60
+ /** Add nvidia.com/gpu NoSchedule toleration — required for GPU tainted node pools. */
61
+ gpuTolerations?: boolean;
62
+ /** Additional Ray start params. num-cpus is derived from resources.cpu automatically. */
63
+ rayStartParams?: Record<string, string>;
64
+ /** Additional environment variables for worker containers. */
65
+ env?: Array<{
66
+ name: string;
67
+ value: string;
68
+ }>;
69
+ }
70
+ /** Cluster spec shared by RayCluster, RayJob, and RayService. */
71
+ export interface RayClusterSpec {
72
+ /**
73
+ * Container image for head and all worker groups.
74
+ * Use a pre-built image stored in Artifact Registry / ECR for production —
75
+ * pip installs via runtimeEnv add minutes to cold start at scale.
76
+ */
77
+ image: string;
78
+ head: HeadGroupSpec;
79
+ workerGroups: WorkerGroupSpec[];
80
+ }
81
+ export interface RayClusterProps {
82
+ name: string;
83
+ namespace: string;
84
+ cluster: RayClusterSpec;
85
+ /**
86
+ * Shared ReadWriteMany storage for training data.
87
+ * Mounts the same PVC into head and all worker pods.
88
+ * Use Filestore ENTERPRISE (GKE) or EFS (AWS) for production SLA.
89
+ */
90
+ sharedStorage?: {
91
+ storageClass: string;
92
+ size: string;
93
+ /** Mount path in all containers (default: "/mnt/ray-data"). */
94
+ mountPath?: string;
95
+ };
96
+ /**
97
+ * Enable Ray in-tree autoscaler.
98
+ * Creates a ClusterRole/CRB granting pod CRUD to the head ServiceAccount.
99
+ */
100
+ enableAutoscaler?: boolean;
101
+ /**
102
+ * GCS bucket name for object store spill-to-GCS.
103
+ * Injects RAY_object_spilling_config into the head container.
104
+ * Without this, large object graphs (model weights) cause OOM on the head.
105
+ */
106
+ spilloverBucket?: string;
107
+ /**
108
+ * Emit a LoadBalancer Service exposing the Ray dashboard on port 8265.
109
+ * Default false — use `kubectl port-forward svc/<name>-head-svc 8265:8265`.
110
+ */
111
+ exposeDashboard?: boolean;
112
+ /** Additional labels applied to all resources. */
113
+ labels?: Record<string, string>;
114
+ /** Per-member defaults for fine-grained overrides via mergeDefaults. */
115
+ defaults?: {
116
+ serviceAccount?: Partial<Record<string, unknown>>;
117
+ clusterRole?: Partial<Record<string, unknown>>;
118
+ clusterRoleBinding?: Partial<Record<string, unknown>>;
119
+ networkPolicy?: Partial<Record<string, unknown>>;
120
+ pdb?: Partial<Record<string, unknown>>;
121
+ pvc?: Partial<Record<string, unknown>>;
122
+ dashboardService?: Partial<Record<string, unknown>>;
123
+ rayCluster?: Partial<Record<string, unknown>>;
124
+ };
125
+ }
126
+ export interface RayClusterResult {
127
+ serviceAccount: InstanceType<typeof ServiceAccount>;
128
+ clusterRole?: InstanceType<typeof ClusterRole>;
129
+ clusterRoleBinding?: InstanceType<typeof ClusterRoleBinding>;
130
+ networkPolicy: InstanceType<typeof NetworkPolicy>;
131
+ pdb: InstanceType<typeof PodDisruptionBudget>;
132
+ pvc?: InstanceType<typeof PersistentVolumeClaim>;
133
+ /** Only present when exposeDashboard is true. */
134
+ dashboardService?: InstanceType<typeof Service>;
135
+ rayCluster: InstanceType<typeof RayClusterResource>;
136
+ }
137
+ /**
138
+ * Build headGroupSpec and workerGroupSpecs for a KubeRay CR.
139
+ * Exported for use in RayJob and RayService composites.
140
+ */
141
+ export declare function buildRayClusterParts(cluster: RayClusterSpec, saName: string, spilloverBucket: string | undefined, pvcName: string | undefined, mountPath: string | undefined): {
142
+ headGroupSpec: Record<string, unknown>;
143
+ workerGroupSpecs: Array<Record<string, unknown>>;
144
+ rayVersion: string | undefined;
145
+ };
146
+ /**
147
+ * Build a NetworkPolicy for a Ray cluster.
148
+ * Uses podSelector-only rules for intra-cluster traffic to avoid GKE pod CIDR
149
+ * mismatch (GKE secondary pod CIDRs differ from declared subnet CIDRs).
150
+ * GCS egress uses ipBlock excluding RFC1918 to allow Google APIs while
151
+ * blocking internal lateral movement.
152
+ */
153
+ export declare function buildRayNetworkPolicy(name: string, namespace: string, commonLabels: Record<string, string>, exposeDashboard: boolean, defOverride: Partial<Record<string, unknown>> | undefined): InstanceType<typeof NetworkPolicy>;
154
+ /**
155
+ * Create a RayCluster composite — returns a KubeRay RayCluster CR and the
156
+ * surrounding K8s resources needed for a production Ray cluster.
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * import { RayCluster } from "@intentius/chant-lexicon-k8s";
161
+ *
162
+ * const ray = RayCluster({
163
+ * name: "ray",
164
+ * namespace: "ray-system",
165
+ * cluster: {
166
+ * image: "us-docker.pkg.dev/my-project/ray-images/ray:2.40.0",
167
+ * head: { resources: { cpu: "2", memory: "8Gi" } },
168
+ * workerGroups: [
169
+ * { groupName: "cpu", replicas: 2, minReplicas: 1, maxReplicas: 8,
170
+ * resources: { cpu: "2", memory: "4Gi" } },
171
+ * ],
172
+ * },
173
+ * enableAutoscaler: true,
174
+ * spilloverBucket: "my-ray-spill",
175
+ * });
176
+ * ```
177
+ */
178
+ export declare const RayCluster: import("@intentius/chant").CompositeDefinition<RayClusterProps, import("@intentius/chant").CompositeMembers>;
179
+ //# sourceMappingURL=ray-cluster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ray-cluster.d.ts","sourceRoot":"","sources":["../../src/composites/ray-cluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,OAAO,EACP,UAAU,IAAI,kBAAkB,EACjC,MAAM,cAAc,CAAC;AAItB,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,+BAA+B;AAC/B,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,YAAY,CAAC;IACxB;;;OAGG;IACH,O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 * then tears the cluster down. Ideal for batch training pipelines.
6
+ *
7
+ * Encodes the same production defaults as RayCluster (NetworkPolicy,
8
+ * preStop hooks, optional shared PVC, optional autoscaler RBAC).
9
+ */
10
+ import { ServiceAccount, ClusterRole, ClusterRoleBinding, NetworkPolicy, PersistentVolumeClaim, RayJob as RayJobResource } from "../generated/index.js";
11
+ import { type RayClusterSpec } from "./ray-cluster.js";
12
+ export type { RayClusterSpec };
13
+ export type { ResourceSpec, HeadGroupSpec, WorkerGroupSpec } from "./ray-cluster.js";
14
+ export interface RayJobProps {
15
+ name: string;
16
+ namespace: string;
17
+ /**
18
+ * Entrypoint command to run on the Ray cluster.
19
+ * E.g. "python train.py --epochs 10"
20
+ */
21
+ entrypoint: string;
22
+ cluster: RayClusterSpec;
23
+ /**
24
+ * Ray runtime environment YAML string.
25
+ * Prefer pre-built images over pip installs here — each pip install adds
26
+ * startup latency per worker on cold start.
27
+ */
28
+ runtimeEnvYAML?: string;
29
+ /**
30
+ * Tear down the cluster after the job finishes (default: true).
31
+ * Set false to keep the cluster alive for debugging.
32
+ */
33
+ shutdownAfterJobFinishes?: boolean;
34
+ /**
35
+ * TTL in seconds before a finished RayJob is garbage-collected (default: 300).
36
+ */
37
+ ttlSecondsAfterFinished?: number;
38
+ sharedStorage?: {
39
+ storageClass: string;
40
+ size: string;
41
+ mountPath?: string;
42
+ };
43
+ enableAutoscaler?: boolean;
44
+ spilloverBucket?: string;
45
+ labels?: Record<string, string>;
46
+ defaults?: {
47
+ serviceAccount?: Partial<Record<string, unknown>>;
48
+ clusterRole?: Partial<Record<string, unknown>>;
49
+ clusterRoleBinding?: Partial<Record<string, unknown>>;
50
+ networkPolicy?: Partial<Record<string, unknown>>;
51
+ pvc?: Partial<Record<string, unknown>>;
52
+ rayJob?: Partial<Record<string, unknown>>;
53
+ };
54
+ }
55
+ export interface RayJobResult {
56
+ serviceAccount: InstanceType<typeof ServiceAccount>;
57
+ clusterRole?: InstanceType<typeof ClusterRole>;
58
+ clusterRoleBinding?: InstanceType<typeof ClusterRoleBinding>;
59
+ networkPolicy: InstanceType<typeof NetworkPolicy>;
60
+ pvc?: InstanceType<typeof PersistentVolumeClaim>;
61
+ rayJob: InstanceType<typeof RayJobResource>;
62
+ }
63
+ /**
64
+ * Create a RayJob composite — ephemeral Ray cluster for a single batch job.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * import { RayJob } from "@intentius/chant-lexicon-k8s";
69
+ *
70
+ * const job = RayJob({
71
+ * name: "train-resnet",
72
+ * namespace: "ray-system",
73
+ * entrypoint: "python train.py --epochs 50",
74
+ * cluster: {
75
+ * image: "us-docker.pkg.dev/my-project/ray-images/ray:2.40.0",
76
+ * head: { resources: { cpu: "2", memory: "8Gi" } },
77
+ * workerGroups: [
78
+ * { groupName: "gpu", replicas: 4,
79
+ * resources: { cpu: "8", memory: "32Gi", gpu: 1 },
80
+ * gpuTolerations: true },
81
+ * ],
82
+ * },
83
+ * spilloverBucket: "my-ray-spill",
84
+ * });
85
+ * ```
86
+ */
87
+ export declare const RayJob: import("@intentius/chant").CompositeDefinition<RayJobProps, import("@intentius/chant").CompositeMembers>;
88
+ //# sourceMappingURL=ray-job.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ray-job.d.ts","sourceRoot":"","sources":["../../src/composites/ray-job.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,MAAM,IAAI,cAAc,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,cAAc,EAAE,CAAC;AAC/B,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;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CAAC;IAC7D,aAAa,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;IAClD,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC;IACjD,MAAM,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,MAAM,0GAmIP,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * RayService composite — KubeRay RayService CR + surrounding K8s infra.
3
+ *
4
+ * RayService manages a persistent Ray Serve HTTP endpoint with zero-downtime
5
+ * blue-green upgrades. Ideal for online inference and serving workloads.
6
+ *
7
+ * Encodes the same production defaults as RayCluster (NetworkPolicy, preStop
8
+ * hooks, PDB, optional shared PVC, optional autoscaler RBAC) plus a
9
+ * LoadBalancer Service exposing the Serve HTTP endpoint on port 8000.
10
+ */
11
+ import { ServiceAccount, ClusterRole, ClusterRoleBinding, NetworkPolicy, PodDisruptionBudget, PersistentVolumeClaim, Service, RayService as RayServiceResource } from "../generated/index.js";
12
+ import { type RayClusterSpec } from "./ray-cluster.js";
13
+ export type { RayClusterSpec };
14
+ export type { ResourceSpec, HeadGroupSpec, WorkerGroupSpec } from "./ray-cluster.js";
15
+ export interface RayServiceProps {
16
+ name: string;
17
+ namespace: string;
18
+ /**
19
+ * Ray Serve application config in YAML format.
20
+ * Passed verbatim to spec.serveConfigV2.
21
+ * See https://docs.ray.io/en/latest/serve/production-guide/config.html
22
+ */
23
+ serveConfigV2: string;
24
+ cluster: RayClusterSpec;
25
+ sharedStorage?: {
26
+ storageClass: string;
27
+ size: string;
28
+ mountPath?: string;
29
+ };
30
+ enableAutoscaler?: boolean;
31
+ spilloverBucket?: string;
32
+ labels?: Record<string, string>;
33
+ defaults?: {
34
+ serviceAccount?: Partial<Record<string, unknown>>;
35
+ clusterRole?: Partial<Record<string, unknown>>;
36
+ clusterRoleBinding?: Partial<Record<string, unknown>>;
37
+ networkPolicy?: Partial<Record<string, unknown>>;
38
+ pdb?: Partial<Record<string, unknown>>;
39
+ pvc?: Partial<Record<string, unknown>>;
40
+ serveService?: Partial<Record<string, unknown>>;
41
+ rayService?: Partial<Record<string, unknown>>;
42
+ };
43
+ }
44
+ export interface RayServiceResult {
45
+ serviceAccount: InstanceType<typeof ServiceAccount>;
46
+ clusterRole?: InstanceType<typeof ClusterRole>;
47
+ clusterRoleBinding?: InstanceType<typeof ClusterRoleBinding>;
48
+ networkPolicy: InstanceType<typeof NetworkPolicy>;
49
+ pdb: InstanceType<typeof PodDisruptionBudget>;
50
+ pvc?: InstanceType<typeof PersistentVolumeClaim>;
51
+ /** LoadBalancer Service exposing Ray Serve on port 8000. */
52
+ serveService: InstanceType<typeof Service>;
53
+ rayService: InstanceType<typeof RayServiceResource>;
54
+ }
55
+ /**
56
+ * Create a RayService composite — persistent Ray Serve endpoint with
57
+ * zero-downtime blue-green upgrades.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * import { RayService } from "@intentius/chant-lexicon-k8s";
62
+ *
63
+ * const svc = RayService({
64
+ * name: "inference",
65
+ * namespace: "ray-system",
66
+ * serveConfigV2: `
67
+ * applications:
68
+ * - name: classifier
69
+ * import_path: app:deployment
70
+ * deployments:
71
+ * - name: Classifier
72
+ * num_replicas: 2
73
+ * `,
74
+ * cluster: {
75
+ * image: "us-docker.pkg.dev/my-project/ray-images/ray:2.40.0",
76
+ * head: { resources: { cpu: "2", memory: "8Gi" } },
77
+ * workerGroups: [
78
+ * { groupName: "gpu", replicas: 2,
79
+ * resources: { cpu: "4", memory: "16Gi", gpu: 1 },
80
+ * gpuTolerations: true },
81
+ * ],
82
+ * },
83
+ * });
84
+ * ```
85
+ */
86
+ export declare const RayService: import("@intentius/chant").CompositeDefinition<RayServiceProps, import("@intentius/chant").CompositeMembers>;
87
+ //# sourceMappingURL=ray-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ray-service.d.ts","sourceRoot":"","sources":["../../src/compos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CAAC;QACvC,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACvC,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAChD,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC/C,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;IACpD,WAAW,CAAC,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;IAC/C,kBAAkB,CAAC,EAAE,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC7D,aAAa,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;IAClD,GAAG,EAAE,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC;IAC9C,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC;IACjD,4DAA4D;IAC5D,YAAY,EAAE,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC;IAC3C,UAAU,EAAE,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;CACrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,UAAU,8GAsKP,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * SecureIngress composite — Ingress + optional cert-manager Certificate.
3
+ *
4
+ * A standalone Ingress with TLS via cert-manager, supporting
5
+ * multiple hosts and paths (unlike the single-path Ingress in WebApp).
6
+ */
7
+ import { Ingress, Certificate } from "../generated/index.js";
8
+ export interface SecureIngressHost {
9
+ /** Hostname (e.g., "api.example.com"). */
10
+ hostname: string;
11
+ /** Path rules for this host. */
12
+ paths: Array<{
13
+ path: string;
14
+ pathType?: string;
15
+ serviceName: string;
16
+ servicePort: number;
17
+ }>;
18
+ }
19
+ export interface SecureIngressProps {
20
+ /** Ingress name — used in metadata and labels. */
21
+ name: string;
22
+ /** Host definitions with paths. */
23
+ hosts: SecureIngressHost[];
24
+ /** cert-manager ClusterIssuer name — if set, creates a Certificate resource. */
25
+ clusterIssuer?: string;
26
+ /** Ingress class name (e.g., "nginx"). */
27
+ ingressClassName?: string;
28
+ /** Additional annotations on the Ingress. */
29
+ annotations?: Record<string, string>;
30
+ /** Additional labels to apply to all resources. */
31
+ labels?: Record<string, string>;
32
+ /** Namespace for all resources. */
33
+ namespace?: string;
34
+ /** Per-member defaults for fine-grained overrides. */
35
+ defaults?: {
36
+ ingress?: Partial<Record<string, unknown>>;
37
+ certificate?: Partial<Record<string, unknown>>;
38
+ };
39
+ }
40
+ export interface SecureIngressResult {
41
+ ingress: InstanceType<typeof Ingress>;
42
+ certificate?: InstanceType<typeof Certificate>;
43
+ }
44
+ /**
45
+ * Create a SecureIngress composite — returns prop objects for
46
+ * an Ingress and optional cert-manager Certificate.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * import { SecureIngress } from "@intentius/chant-lexicon-k8s";
51
+ *
52
+ * const { ingress, certificate } = SecureIngress({
53
+ * name: "api-ingress",
54
+ * hosts: [
55
+ * {
56
+ * hostname: "api.example.com",
57
+ * paths: [{ path: "/", serviceName: "api", servicePort: 80 }],
58
+ * },
59
+ * ],
60
+ * clusterIssuer: "letsencrypt-prod",
61
+ * ingressClassName: "nginx",
62
+ * });
63
+ * ```
64
+ */
65
+ export declare const SecureIngress: import("@intentius/chant").CompositeDefinition<SecureIngressProps, import("@intentius/chant").CompositeMembers>;
66
+ //# sourceMappingURL=secure-ingress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secure-ingress.d.ts","sourceRoot":"","sources":["../../src/composites/secure-ingress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC3C,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAChD,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,iHAwFP,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** Container-level security context — covers PSS restricted requirements. */
2
+ export interface ContainerSecurityContext {
3
+ runAsNonRoot?: boolean;
4
+ readOnlyRootFilesystem?: boolean;
5
+ runAsUser?: number;
6
+ runAsGroup?: number;
7
+ allowPrivilegeEscalation?: boolean;
8
+ capabilities?: {
9
+ add?: string[];
10
+ drop?: string[];
11
+ };
12
+ seccompProfile?: {
13
+ type: string;
14
+ localhostProfile?: string;
15
+ };
16
+ }
17
+ //# sourceMappingURL=security-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-context.d.ts","sourceRoot":"","sources":["../../src/composites/security-context.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,WAAW,wBAAwB;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACnD,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D"}