@intentius/chant-lexicon-k3s 0.44.3

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 (110) hide show
  1. package/README.md +36 -0
  2. package/dist/codegen/docs.d.ts +7 -0
  3. package/dist/codegen/docs.d.ts.map +1 -0
  4. package/dist/codegen/generate-cli.d.ts +3 -0
  5. package/dist/codegen/generate-cli.d.ts.map +1 -0
  6. package/dist/codegen/generate-lexicon.d.ts +19 -0
  7. package/dist/codegen/generate-lexicon.d.ts.map +1 -0
  8. package/dist/codegen/generate-typescript.d.ts +11 -0
  9. package/dist/codegen/generate-typescript.d.ts.map +1 -0
  10. package/dist/codegen/generate.d.ts +15 -0
  11. package/dist/codegen/generate.d.ts.map +1 -0
  12. package/dist/codegen/naming.d.ts +13 -0
  13. package/dist/codegen/naming.d.ts.map +1 -0
  14. package/dist/codegen/package.d.ts +17 -0
  15. package/dist/codegen/package.d.ts.map +1 -0
  16. package/dist/codegen/parse.d.ts +93 -0
  17. package/dist/codegen/parse.d.ts.map +1 -0
  18. package/dist/generated/index.d.ts +8 -0
  19. package/dist/generated/index.d.ts.map +1 -0
  20. package/dist/generated/runtime.d.ts +5 -0
  21. package/dist/generated/runtime.d.ts.map +1 -0
  22. package/dist/index.d.ts +5 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/integrity.json +10 -0
  25. package/dist/lint/audit-catalog.d.ts +13 -0
  26. package/dist/lint/audit-catalog.d.ts.map +1 -0
  27. package/dist/lint/post-synth/index.d.ts +3 -0
  28. package/dist/lint/post-synth/index.d.ts.map +1 -0
  29. package/dist/lint/post-synth/k3s-helpers.d.ts +19 -0
  30. package/dist/lint/post-synth/k3s-helpers.d.ts.map +1 -0
  31. package/dist/lint/post-synth/k3s101.d.ts +13 -0
  32. package/dist/lint/post-synth/k3s101.d.ts.map +1 -0
  33. package/dist/lint/post-synth/k3s102.d.ts +11 -0
  34. package/dist/lint/post-synth/k3s102.d.ts.map +1 -0
  35. package/dist/lint/post-synth/k3s103.d.ts +11 -0
  36. package/dist/lint/post-synth/k3s103.d.ts.map +1 -0
  37. package/dist/lint/post-synth/k3s104.d.ts +12 -0
  38. package/dist/lint/post-synth/k3s104.d.ts.map +1 -0
  39. package/dist/lint/post-synth/k3s105.d.ts +11 -0
  40. package/dist/lint/post-synth/k3s105.d.ts.map +1 -0
  41. package/dist/lint/rules/index.d.ts +5 -0
  42. package/dist/lint/rules/index.d.ts.map +1 -0
  43. package/dist/lint/rules/token-literal.d.ts +17 -0
  44. package/dist/lint/rules/token-literal.d.ts.map +1 -0
  45. package/dist/lsp/completions.d.ts +7 -0
  46. package/dist/lsp/completions.d.ts.map +1 -0
  47. package/dist/lsp/hover.d.ts +6 -0
  48. package/dist/lsp/hover.d.ts.map +1 -0
  49. package/dist/manifest.json +6 -0
  50. package/dist/meta.json +37 -0
  51. package/dist/okf/index.md +9 -0
  52. package/dist/okf/types/Agent.md +55 -0
  53. package/dist/okf/types/Registries.md +14 -0
  54. package/dist/okf/types/Server.md +122 -0
  55. package/dist/package-cli.d.ts +3 -0
  56. package/dist/package-cli.d.ts.map +1 -0
  57. package/dist/plugin.d.ts +8 -0
  58. package/dist/plugin.d.ts.map +1 -0
  59. package/dist/serializer.d.ts +37 -0
  60. package/dist/serializer.d.ts.map +1 -0
  61. package/dist/skills/chant-k3s.md +90 -0
  62. package/dist/spec/fetch.d.ts +39 -0
  63. package/dist/spec/fetch.d.ts.map +1 -0
  64. package/dist/types/index.d.ts +370 -0
  65. package/dist/validate-cli.d.ts +3 -0
  66. package/dist/validate-cli.d.ts.map +1 -0
  67. package/dist/validate.d.ts +15 -0
  68. package/dist/validate.d.ts.map +1 -0
  69. package/package.json +68 -0
  70. package/src/codegen/docs.ts +25 -0
  71. package/src/codegen/generate-cli.ts +8 -0
  72. package/src/codegen/generate-lexicon.ts +58 -0
  73. package/src/codegen/generate-typescript.ts +63 -0
  74. package/src/codegen/generate.test.ts +157 -0
  75. package/src/codegen/generate.ts +116 -0
  76. package/src/codegen/naming.ts +42 -0
  77. package/src/codegen/package.ts +28 -0
  78. package/src/codegen/parse.ts +386 -0
  79. package/src/generated/.gitkeep +0 -0
  80. package/src/generated/index.d.ts +370 -0
  81. package/src/generated/index.ts +13 -0
  82. package/src/generated/lexicon-k3s.json +37 -0
  83. package/src/generated/runtime.ts +4 -0
  84. package/src/index.ts +11 -0
  85. package/src/lint/audit-catalog.ts +53 -0
  86. package/src/lint/post-synth/index.ts +15 -0
  87. package/src/lint/post-synth/k3s-helpers.ts +34 -0
  88. package/src/lint/post-synth/k3s101.ts +58 -0
  89. package/src/lint/post-synth/k3s102.ts +59 -0
  90. package/src/lint/post-synth/k3s103.ts +38 -0
  91. package/src/lint/post-synth/k3s104.ts +44 -0
  92. package/src/lint/post-synth/k3s105.ts +52 -0
  93. package/src/lint/post-synth/post-synth.test.ts +137 -0
  94. package/src/lint/rules/index.ts +7 -0
  95. package/src/lint/rules/token-literal.test.ts +53 -0
  96. package/src/lint/rules/token-literal.ts +87 -0
  97. package/src/lsp/completions.test.ts +10 -0
  98. package/src/lsp/completions.ts +25 -0
  99. package/src/lsp/hover.test.ts +10 -0
  100. package/src/lsp/hover.ts +43 -0
  101. package/src/package-cli.ts +24 -0
  102. package/src/plugin.test.ts +17 -0
  103. package/src/plugin.ts +129 -0
  104. package/src/serializer.acceptance.test.ts +137 -0
  105. package/src/serializer.test.ts +172 -0
  106. package/src/serializer.ts +191 -0
  107. package/src/skills/chant-k3s.md +90 -0
  108. package/src/spec/fetch.ts +80 -0
  109. package/src/validate-cli.ts +5 -0
  110. package/src/validate.ts +41 -0
@@ -0,0 +1,14 @@
1
+ ---
2
+ type: resource-type
3
+ title: Registries
4
+ description: k3s resource type K3s::Registries
5
+ name: Registries
6
+ lexicon: k3s
7
+ resource_type: K3s::Registries
8
+ ---
9
+ `K3s::Registries`, a resource type of the k3s lexicon.
10
+
11
+ ## Properties
12
+
13
+ - `configs` (`Record<string, RegistryConfig>`, optional): Registry endpoint to auth/TLS configuration
14
+ - `mirrors` (`Record<string, Mirror>`, optional): Registry name (or wildcard) to mirror configuration
@@ -0,0 +1,122 @@
1
+ ---
2
+ type: resource-type
3
+ title: Server
4
+ description: k3s resource type K3s::Server
5
+ name: Server
6
+ lexicon: k3s
7
+ resource_type: K3s::Server
8
+ ---
9
+ `K3s::Server`, a resource type of the k3s lexicon.
10
+
11
+ ## Properties
12
+
13
+ - `advertise-address` (`string`, optional): (listener) IPv4/IPv6 address that apiserver uses to advertise to members of the cluster (default: node-external-ip/node-ip)
14
+ - `advertise-port` (`number`, optional): (listener) Port that apiserver uses to advertise to members of the cluster (default: https-listen-port)
15
+ - `agent-token-file` (`string`, optional): (cluster) File containing the agent secret
16
+ - `alsologtostderr` (`boolean`, optional): (logging) Log to standard error as well as file (if set)
17
+ - `bind-address` (`string`, optional): (listener) bind address (default: 0.0.0.0)
18
+ - `cluster-cidr` (`string | string[]`, optional): (networking) IPv4/IPv6 network CIDRs to use for pod IPs (default: 10.42.0.0/16)
19
+ - `cluster-dns` (`string | string[]`, optional): (networking) IPv4/IPv6 Cluster IP for coredns service. Should be in your service-cidr range (default: 10.43.0.10)
20
+ - `cluster-domain` (`string`, optional): (networking) Cluster Domain (default: cluster.local)
21
+ - `cluster-init` (`boolean`, optional): (cluster) Initialize a new cluster using embedded Etcd
22
+ - `cluster-reset` (`boolean`, optional): (cluster) Forget all peers and become sole member of a new cluster
23
+ - `cluster-reset-restore-path` (`string`, optional): (db) Path to snapshot file to be restored
24
+ - `container-runtime-endpoint` (`string`, optional): (agent/runtime) Disable embedded containerd and use the CRI socket at the given path; when used with --docker this sets the docker socket path
25
+ - `data-dir` (`string`, optional): (data) Folder to hold state default /var/lib/rancher/ or ${HOME}/.rancher/ if not root
26
+ - `datastore-cafile` (`string`, optional): (db) TLS Certificate Authority file used to secure datastore backend communication
27
+ - `datastore-certfile` (`string`, optional): (db) TLS certification file used to secure datastore backend communication
28
+ - `datastore-endpoint` (`string`, optional): (db) Specify etcd, NATS, MySQL, Postgres, or SQLite (default) data source name
29
+ - `datastore-keyfile` (`string`, optional): (db) TLS key file used to secure datastore backend communication
30
+ - `debug` (`boolean`, optional): (logging) Turn on debug logs
31
+ - `default-local-storage-path` (`string`, optional): (storage) Default local storage path for local provisioner storage class
32
+ - `default-runtime` (`string`, optional): (agent/runtime) Set the default runtime in containerd
33
+ - `disable` (`string | string[]`, optional): (components) Do not deploy packaged components and delete any deployed components (valid values: )
34
+ - `disable-cloud-controller` (`boolean`, optional): (components) Disable default cloud controller manager
35
+ - `disable-default-registry-endpoint` (`boolean`, optional): (agent/containerd) Disables containerd's fallback default registry endpoint when a mirror is configured for that registry
36
+ - `disable-helm-controller` (`boolean`, optional): (components) Disable Helm controller
37
+ - `disable-kube-proxy` (`boolean`, optional): (components) Disable running kube-proxy
38
+ - `disable-network-policy` (`boolean`, optional): (components) Disable default network policy controller
39
+ - `disable-scheduler` (`boolean`, optional): (components) Disable Kubernetes default scheduler
40
+ - `docker` (`boolean`, optional): (agent/runtime) (experimental) Use cri-dockerd instead of containerd
41
+ - `egress-selector-mode` (`string`, optional): (networking) One of 'agent', 'cluster', 'pod', 'disabled' (default: agent)
42
+ - `embedded-registry` (`boolean`, optional): (components) Enable embedded distributed container registry; requires use of embedded containerd; when enabled agents will also listen on the supervisor port
43
+ - `enable-pprof` (`boolean`, optional): (experimental) Enable pprof endpoint on supervisor port
44
+ - `etcd-arg` (`string | string[]`, optional): (flags) Customized flag for etcd process
45
+ - `etcd-disable-snapshots` (`boolean`, optional): (db) Disable automatic etcd snapshots
46
+ - `etcd-expose-metrics` (`boolean`, optional): (db) Expose etcd metrics to client interface
47
+ - `etcd-s3` (`boolean`, optional): (db) Enable backup to S3
48
+ - `etcd-s3-access-key` (`string`, optional): (db) S3 access key
49
+ - `etcd-s3-bucket` (`string`, optional): (db) S3 bucket name
50
+ - `etcd-s3-bucket-lookup-type` (`string`, optional): (db) S3 bucket lookup type, one of 'auto', 'dns', 'path'; default is 'auto' if not set
51
+ - `etcd-s3-config-secret` (`string`, optional): (db) Name of secret in the kube-system namespace used to configure S3, if etcd-s3 is enabled and no other etcd-s3 options are set
52
+ - `etcd-s3-endpoint` (`string`, optional): (db) S3 endpoint url (default: s3.amazonaws.com)
53
+ - `etcd-s3-endpoint-ca` (`string`, optional): (db) S3 custom CA cert to connect to S3 endpoint
54
+ - `etcd-s3-folder` (`string`, optional): (db) S3 folder
55
+ - `etcd-s3-insecure` (`boolean`, optional): (db) Disables S3 over HTTPS
56
+ - `etcd-s3-proxy` (`string`, optional): (db) Proxy server to use when connecting to S3, overriding any proxy-releated environment variables
57
+ - `etcd-s3-region` (`string`, optional): (db) S3 region / bucket location (optional) (default: us-east-1)
58
+ - `etcd-s3-retention` (`number`, optional): (db) S3 retention limit
59
+ - `etcd-s3-secret-key` (`string`, optional): (db) S3 secret key
60
+ - `etcd-s3-session-token` (`string`, optional): (db) S3 session token
61
+ - `etcd-s3-skip-ssl-verify` (`boolean`, optional): (db) Disables S3 SSL certificate validation
62
+ - `etcd-s3-timeout` (`string`, optional): (db) S3 timeout
63
+ - `etcd-snapshot-compress` (`boolean`, optional): (db) Compress etcd snapshot
64
+ - `etcd-snapshot-dir` (`string`, optional): (db) Directory to save db snapshots. (default: ${data-dir}/server/db/snapshots)
65
+ - `etcd-snapshot-name` (`string`, optional): (db) Set the base name of etcd snapshots, appended with UNIX timestamp (default: etcd-snapshot)
66
+ - `etcd-snapshot-reconcile-interval` (`string`, optional): (db) Snapshot reconcile interval
67
+ - `etcd-snapshot-retention` (`number`, optional): (db) Number of snapshots to retain
68
+ - `etcd-snapshot-schedule-cron` (`string`, optional): (db) Snapshot interval time in cron spec. eg. every 5 hours '0 */5 * * *' (default: 0 */12 * * *)
69
+ - `flannel-backend` (`string`, optional): (networking) Backend (valid values: 'none', 'vxlan', 'host-gw', 'wireguard-native' (default: vxlan)
70
+ - `flannel-cni-conf` (`string`, optional): (agent/networking) Override default flannel cni config file
71
+ - `flannel-conf` (`string`, optional): (agent/networking) Override default flannel config file
72
+ - `flannel-external-ip` (`boolean`, optional): (networking) Use node external IP addresses for Flannel traffic
73
+ - `flannel-iface` (`string`, optional): (agent/networking) Override default flannel interface
74
+ - `flannel-ipv6-masq` (`boolean`, optional): (networking) Enable IPv6 masquerading for pod
75
+ - `helm-controller-arg` (`string | string[]`, optional): (flags) Customized flag for helm-controller process
76
+ - `https-listen-port` (`number`, optional): (listener) HTTPS listen port (default: 6443)
77
+ - `image-credential-provider-bin-dir` (`string`, optional): (agent/node) The path to the directory where credential provider plugin binaries are located (default: /var/lib/rancher/credentialprovider/bin)
78
+ - `image-credential-provider-config` (`string`, optional): (agent/node) The path to the credential provider plugin config file (default: /var/lib/rancher/credentialprovider/config.yaml)
79
+ - `image-service-endpoint` (`string`, optional): (agent/runtime) Disable embedded containerd image service and use remote image service socket at the given path. If not specified, defaults to --container-runtime-endpoint.
80
+ - `kube-apiserver-arg` (`string | string[]`, optional): (flags) Customized flag for kube-apiserver process
81
+ - `kube-cloud-controller-manager-arg` (`string | string[]`, optional): (flags) Customized flag for kube-cloud-controller-manager process
82
+ - `kube-controller-manager-arg` (`string | string[]`, optional): (flags) Customized flag for kube-controller-manager process
83
+ - `kube-proxy-arg` (`string | string[]`, optional): (agent/flags) Customized flag for kube-proxy process
84
+ - `kube-scheduler-arg` (`string | string[]`, optional): (flags) Customized flag for kube-scheduler process
85
+ - `kubelet-arg` (`string | string[]`, optional): (agent/flags) Customized flag for kubelet process
86
+ - `lb-server-port` (`number`, optional): (agent/node) Local port for supervisor client load-balancer. If the supervisor and apiserver are not colocated an additional port 1 less than this port will also be used for the apiserver client load-balancer. (default: 6444)
87
+ - `log` (`string`, optional): (logging) Log to file
88
+ - `node-external-dns` (`string | string[]`, optional): (agent/networking) external DNS addresses to advertise for node
89
+ - `node-external-ip` (`string | string[]`, optional): (agent/networking) IPv4/IPv6 external IP addresses to advertise for node
90
+ - `node-internal-dns` (`string | string[]`, optional): (agent/networking) internal DNS addresses to advertise for node
91
+ - `node-ip` (`string | string[]`, optional): (agent/networking) IPv4/IPv6 addresses to advertise for node
92
+ - `node-label` (`string | string[]`, optional): (agent/node) Registering and starting kubelet with set of labels
93
+ - `node-name` (`string`, optional): (agent/node) Node name
94
+ - `node-taint` (`string | string[]`, optional): (agent/node) Registering kubelet with set of taints
95
+ - `nonroot-devices` (`boolean`, optional): (agent/containerd) Allows non-root pods to access devices by setting device_ownership_from_security_context=true in the containerd CRI config
96
+ - `pause-image` (`string`, optional): (agent/runtime) Customized pause image for containerd or docker sandbox (default: rancher/mirrored-pause:3.10.2)
97
+ - `prefer-bundled-bin` (`boolean`, optional): (experimental) Prefer bundled userspace binaries over host binaries
98
+ - `private-registry` (`string`, optional): (agent/runtime) Private registry configuration file
99
+ - `protect-kernel-defaults` (`boolean`, optional): (agent/node) Kernel tuning behavior. If set, error if kernel tunables are different than kubelet defaults.
100
+ - `resolv-conf` (`string`, optional): (agent/networking) Kubelet resolv.conf file
101
+ - `rootless` (`boolean`, optional): (experimental) Run rootless
102
+ - `secrets-encryption` (`boolean`, optional): Enable secret encryption at rest
103
+ - `secrets-encryption-provider` (`string`, optional): (experimental) Secret encryption provider (valid values: 'aescbc', 'secretbox') (default: aescbc)
104
+ - `selinux` (`boolean`, optional): (agent/node) Enable SELinux in containerd
105
+ - `server` (`string`, optional): (cluster) Server to connect to, used to join a cluster
106
+ - `service-cidr` (`string | string[]`, optional): (networking) IPv4/IPv6 network CIDRs to use for service IPs (default: 10.43.0.0/16)
107
+ - `service-node-port-range` (`string`, optional): (networking) Port range to reserve for services with NodePort visibility (default: 30000-32767)
108
+ - `servicelb-namespace` (`string`, optional): (networking) Namespace of the pods for the servicelb component (default: kube-system)
109
+ - `snapshotter` (`string`, optional): (agent/runtime) Override default containerd snapshotter
110
+ - `supervisor-metrics` (`boolean`, optional): (experimental/components) Enable serving internal metrics on the supervisor port; when enabled agents will also listen on the supervisor port
111
+ - `system-default-registry` (`string`, optional): (agent/runtime) Private registry to be used for all system images
112
+ - `tls-san` (`string | string[]`, optional): (listener) Add additional hostnames or IPv4/IPv6 addresses as Subject Alternative Names on the server TLS cert
113
+ - `tls-san-security` (`boolean`, optional): (listener) Protect the server TLS cert by refusing to add Subject Alternative Names not associated with the kubernetes apiserver service, server nodes, or values of the tls-san option (default: true) (default: true)
114
+ - `token-file` (`string`, optional): (cluster) File containing the token
115
+ - `v` (`number`, optional): (logging) Number for the log level verbosity
116
+ - `vmodule` (`string`, optional): (logging) Comma-separated list of FILE_PATTERN=LOG_LEVEL settings for file-filtered logging
117
+ - `vpn-auth` (`string`, optional): (agent/networking) (experimental) Credentials for the VPN provider. It must include the provider name and join key in the format name=<vpn-provider>,joinKey=<key>[,controlServerURL=<url>][,extraArgs=<args>]
118
+ - `vpn-auth-file` (`string`, optional): (agent/networking) (experimental) File containing credentials for the VPN provider. It must include the provider name and join key in the format name=<vpn-provider>,joinKey=<key>[,controlServerURL=<url>][,extraArgs=<args>]
119
+ - `with-node-id` (`boolean`, optional): (agent/node) Append id to node name
120
+ - `write-kubeconfig` (`string`, optional): (client) Write kubeconfig for admin client to this file
121
+ - `write-kubeconfig-group` (`string`, optional): (client) Write kubeconfig with this group
122
+ - `write-kubeconfig-mode` (`string`, optional): (client) Write kubeconfig with this mode
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env tsx
2
+ export {};
3
+ //# sourceMappingURL=package-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-cli.d.ts","sourceRoot":"","sources":["../src/package-cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { LexiconPlugin } from "@intentius/chant/lexicon";
2
+ /**
3
+ * k3s lexicon plugin.
4
+ *
5
+ * Implements all required LexiconPlugin lifecycle methods.
6
+ */
7
+ export declare const k3sPlugin: LexiconPlugin;
8
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAe7F;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,aA4GvB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * k3s config YAML serializer.
3
+ *
4
+ * Emits the files k3s consumes verbatim — the walk-away artifacts that
5
+ * justify a lexicon here at all (#1600):
6
+ *
7
+ * K3s::Server / K3s::Agent → config.yaml (`k3s server --config <file>`)
8
+ * K3s::Registries → registries.yaml
9
+ *
10
+ * One document per declared entity: the first config is the primary
11
+ * output, every further entity lands in files[] keyed `<name>.config.yaml`
12
+ * / `<name>.registries.yaml`. A config.yaml's keys are exactly the CLI
13
+ * flag names, so the emitted file diffs cleanly against any hand-written
14
+ * one and `k3s check-config` style tooling sees nothing unusual.
15
+ *
16
+ * ## Ownership rides node-label (#1603)
17
+ *
18
+ * config.yaml has no free-form metadata channel, but `node-label` is a
19
+ * first-class key on both server and agent and lands on the registered
20
+ * Node as ordinary Kubernetes labels. When a build carries ownership,
21
+ * the serializer appends the chant label pair to `node-label` — readable
22
+ * back through any kubectl against the cluster, and inert to k3s itself.
23
+ * An author's own label with the same key wins.
24
+ *
25
+ * ## What never appears
26
+ *
27
+ * `token` / `agent-token` literals are not part of the typed surface
28
+ * (#1601), and K3SC001 fails the build if one arrives through untyped
29
+ * props anyway. The file k3s reads secrets from is the file's business
30
+ * (`token-file`), not the artifact's.
31
+ */
32
+ import type { Serializer } from "@intentius/chant/serializer";
33
+ export declare const SERVER_TYPE = "K3s::Server";
34
+ export declare const AGENT_TYPE = "K3s::Agent";
35
+ export declare const REGISTRIES_TYPE = "K3s::Registries";
36
+ export declare const k3sSerializer: Serializer;
37
+ //# sourceMappingURL=serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAsC,MAAM,6BAA6B,CAAC;AAMlG,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAkHjD,eAAO,MAAM,aAAa,EAAE,UAkC3B,CAAC"}
@@ -0,0 +1,90 @@
1
+ ---
2
+ skill: chant-k3s
3
+ description: Declare k3s host configuration — server/agent config.yaml and registries.yaml — as typed chant source
4
+ user-invocable: true
5
+ ---
6
+
7
+ # k3s with chant
8
+
9
+ The k3s lexicon declares the files k3s itself consumes: `config.yaml` for
10
+ `k3s server` / `k3s agent`, and `registries.yaml` for the embedded
11
+ containerd. The emitted files are exactly what the native tool accepts —
12
+ drop them at `/etc/rancher/k3s/` (or pass `--config`) and chant is nowhere
13
+ in sight.
14
+
15
+ Config keys are the CLI flag names, verbatim. If `k3s server --help` shows
16
+ `--write-kubeconfig-mode`, the declaration key is `"write-kubeconfig-mode"`.
17
+ Quoted kebab-case keys are normal here.
18
+
19
+ ## Declaring a server
20
+
21
+ ```typescript
22
+ import { Server } from "@intentius/chant-lexicon-k3s";
23
+
24
+ export const controlPlane = new Server({
25
+ "cluster-init": true, // embedded etcd, first node
26
+ "tls-san": ["10.0.0.10", "cp.example.internal"],
27
+ "write-kubeconfig-mode": "0600", // wider than 0644 trips K3S104
28
+ disable: ["traefik"],
29
+ });
30
+ ```
31
+
32
+ ## Declaring an agent
33
+
34
+ ```typescript
35
+ import { Agent } from "@intentius/chant-lexicon-k3s";
36
+
37
+ export const worker = new Agent({
38
+ server: "https://cp.example.internal:6443", // required — K3S103 without it
39
+ "token-file": "/etc/rancher/k3s/agent-token",
40
+ });
41
+ ```
42
+
43
+ ## The token boundary
44
+
45
+ There is no `token` property, on purpose. The join secret reaches the node
46
+ as a file (`token-file`, `agent-token-file`) or as `K3S_TOKEN` /
47
+ `K3S_TOKEN_FILE` in the installer's environment — never as a value in
48
+ source. A literal that arrives through raw props anyway fails K3S001 at
49
+ lint and K3S101 at build. The same wall covers `etcd-s3-secret-key` and
50
+ `etcd-s3-session-token`; use `etcd-s3-config-secret` (a Secret on the
51
+ cluster) for snapshot-store credentials.
52
+
53
+ ## Private registries
54
+
55
+ ```typescript
56
+ import { Mirror, Registries, RegistryConfig, RegistryTLS } from "@intentius/chant-lexicon-k3s";
57
+
58
+ export const registries = new Registries({
59
+ mirrors: {
60
+ "docker.io": new Mirror({ endpoint: ["https://mirror.internal:5000"] }),
61
+ },
62
+ configs: {
63
+ "mirror.internal:5000": new RegistryConfig({
64
+ tls: new RegistryTLS({ ca_file: "/etc/ssl/certs/mirror-ca.pem" }),
65
+ }),
66
+ },
67
+ });
68
+ ```
69
+
70
+ Literal `auth.password` / `auth.token` fail K3S102; `insecure_skip_verify`
71
+ warns via K3S105 — pin the CA instead.
72
+
73
+ ## Output shape
74
+
75
+ One file per declared entity. The first Server/Agent config is the primary
76
+ build output; further configs land beside it as `<name>.config.yaml`, and
77
+ a Registries entity as `registries.yaml`. A build carrying an ownership
78
+ marker stamps it into `node-label`, so the registered Node is attributable
79
+ with any kubectl.
80
+
81
+ ## Rules
82
+
83
+ | Rule | Severity | What it catches |
84
+ |---|---|---|
85
+ | K3S001 | error | literal `token` / `agent-token` in source |
86
+ | K3S101 | error | a literal secret reaching the build (token, etcd S3 keys) |
87
+ | K3S102 | error | literal registry credentials in registries.yaml |
88
+ | K3S103 | error | an Agent with no `server` to join |
89
+ | K3S104 | warning | kubeconfig written wider than 0644 |
90
+ | K3S105 | warning | registry TLS verification disabled |
@@ -0,0 +1,39 @@
1
+ /**
2
+ * k3s CLI flag-definition fetching — downloads the pinned Go sources that
3
+ * define the server and agent flag surfaces, and caches them locally.
4
+ *
5
+ * k3s publishes no JSON Schema for config.yaml. The config file's keys ARE
6
+ * the CLI flag names ("Every flag can be a config key", docs.k3s.io), and
7
+ * the flags are defined as urfave/cli struct literals in pkg/cli/cmds/.
8
+ * Those literals carry name, usage, default and hidden-ness, so the tagged
9
+ * source tree is the machine-readable spec (#1599) — the same channel the
10
+ * k3s binary itself is built from, pinned the same way k3d pins its
11
+ * schema.json.
12
+ */
13
+ /**
14
+ * Pinned upstream k3s release.
15
+ *
16
+ * Bump this constant (and re-generate) when adopting a newer k3s release.
17
+ * The acceptance test's rancher/k3s image tag derives from it (`+` → `-`).
18
+ */
19
+ export declare const K3S_VERSION = "v1.36.3+k3s1";
20
+ /** Docker image tag form of the pin: `+` is not legal in a tag. */
21
+ export declare const K3S_IMAGE_TAG: string;
22
+ /**
23
+ * Fetch all pinned spec files, keyed by filename.
24
+ */
25
+ export declare function fetchSpecFiles(force?: boolean): Promise<Record<string, string>>;
26
+ /**
27
+ * Fetch the spec as a Map<typeName, Buffer> compatible with the
28
+ * generatePipeline fetchSchemas callback.
29
+ *
30
+ * Single entry keyed "K3s::Config" whose buffer is a JSON envelope of the
31
+ * fetched files — the parse step needs them together to resolve flag-var
32
+ * references across files.
33
+ */
34
+ export declare function fetchSchemas(force?: boolean): Promise<Map<string, Buffer>>;
35
+ /**
36
+ * Clear the cached spec files.
37
+ */
38
+ export declare function clearCache(): void;
39
+ //# sourceMappingURL=fetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/spec/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;;;;GAKG;AACH,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAE1C,mEAAmE;AACnE,eAAO,MAAM,aAAa,QAAgC,CAAC;AAqB3D;;GAEG;AACH,wBAAsB,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAOrF;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAKhF;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}