Rootless ko-style distroless OCI image builder & Registry v2 pusher (zero Docker daemon) plus typed Kubernetes manifests & WATCH client.
Pure-Veko daemonless ko-style OCI Container Image v1.1 builder, OCI Image Layout exporter, OCI Distribution Spec v2 HTTP Registry client, and Kubernetes manifest/watch/API toolkit (oci_k8s, oci_k8s/k8s).
oci_k8s packages static binaries and configuration files directly into reproducible, nonroot (65532:65532) distroless OCI container images and deploys them to Kubernetes clusters without requiring docker, podman, buildkit, or kubectl daemons:
oci_k8s (OCI Image Spec v1.1 & Distribution Spec v2):archive/tar (mtime = 0) and compress/deflate (gzip), computing both the uncompressed diff_id (sha256:<tar_hex>) for OCI Image Config rootfs.diff_ids and the compressed digest (sha256:<targz_hex>) for OCI Image Manifest layers.oci-layout, index.json, blobs/sha256/*) or single-file .tar archives (build-oci-layout, pack-oci-layout-tar), and pushes directly to remote registries (HEAD blob deduplication -> POST /blobs/uploads/ -> PUT ?digest= -> PUT /manifests/<tag>).oci_k8s/k8s (Kubernetes Manifests, WATCH & API Client):Deployment, Service, ConfigMap, Secret, and Ingress manifest builders plus a homoiconic from-quote DSL.WATCH event parser (ADDED, MODIFIED, DELETED, BOOKMARK, ERROR) with resourceVersion cursor tracking (parse-watch-ndjson), and Bearer-token HTTPS Server-Side Apply / Watch helpers (kube-get, kube-apply, kube-watch).veko pkg add oci_k8s@1.0.0Import the modules in .vk source files:
use [
oci = oci_k8s
k8s = oci_k8s/k8s
]+------------------------+ tar/pack +----------------------------+
| Static Binary / Files | ----------------> | Uncompressed Tar |
+------------------------+ | diff_id = sha256:<tar_hex> |
+-------------+--------------+
| gzip-compress
v
+------------------------+ +----------------------------+
| OCI Image Config v1.1 | <---------------- | Compressed Layer (.tar.gz) |
| rootfs.diff_ids[] | | digest = sha256:<tgz_hex> |
+-----------+------------+ +-------------+--------------+
| |
+----------------------+-----------------------+
v
+------------------------------+
| OCI Image Manifest v1.1 |
| -> OCI Layout Dir / .tar |
| -> Registry v2 Push -> K8s |
+------------------------------+oci_k8s| Symbol | Signature | Description |
|---|---|---|
MEDIA-OCI-INDEX | fn [] str | 'application/vnd.oci.image.index.v1+json' |
MEDIA-OCI-MANIFEST | fn [] str | 'application/vnd.oci.image.manifest.v1+json' |
MEDIA-OCI-CONFIG | fn [] str | 'application/vnd.oci.image.config.v1+json' |
MEDIA-OCI-LAYER-TAR-GZ | fn [] str | 'application/vnd.oci.image.layer.v1.tar+gzip' |
new-image | fn [] OciImageBuilder | Creates a nonroot 65532:65532 linux/amd64 OCI image builder |
with-platform | fn [img OciImageBuilder, os_name str, arch str /variant var str = ''] OciImageBuilder | Sets os, architecture, and optional variant |
with-entrypoint | fn [img OciImageBuilder, entrypoint block[str] /cmd args block[str] = []] OciImageBuilder | Configures container Entrypoint and Cmd |
with-env | fn [img OciImageBuilder, key str, value str] OciImageBuilder | Sets KEY=VALUE in container Env |
with-user | fn [img OciImageBuilder, user_spec str] OciImageBuilder | Sets container User |
with-workdir | fn [img OciImageBuilder, dir str] OciImageBuilder | Sets container WorkingDir |
with-labels | fn [img OciImageBuilder, extra map[str]] OciImageBuilder | Merges OCI image Labels |
with-exposed-port | fn [img OciImageBuilder, port_spec str] OciImageBuilder | Adds an exposed port ('8080/tcp') |
add-files-layer | fn [img OciImageBuilder, entries block[tar/TarEntry] /label layer_label str = 'files'] OciImageBuilder | Packs tar + gzip layer with diff_id and digest |
add-binary-layer | fn [img OciImageBuilder, container_path str, bin_bytes bytes /mode file_mode i64 = 0x1ed] OciImageBuilder | Adds an executable binary layer and sets default entrypoint |
assemble-image | fn [img OciImageBuilder /tag ref_tag str = 'latest'] BuiltOciImage | Builds in-memory OCI config, manifest, and index |
pack-oci-layout-tar | fn [built BuiltOciImage] bytes | Packs an OCI Image Layout into a single .tar buffer |
build-oci-layout | fn [img OciImageBuilder, out_path str /tag ref_tag str = 'latest'] BuiltOciImage | Writes an OCI Image Layout directory or .tar file |
parse-image-ref | fn [raw_ref str] ImageRef | Parses 'ghcr.io/org/app:v1.0.0' or digest references |
check-blob-head | fn [ref ImageRef, digest str /auth creds RegistryAuth = ...] bool | Checks blob existence via HEAD /v2/<repo>/blobs/<digest> |
push-blob-monolithic | fn [ref ImageRef, digest str, blob bytes /auth creds RegistryAuth = ...] str | Uploads a blob via POST /blobs/uploads/ + PUT ?digest= |
push-manifest | fn [ref ImageRef, manifest_json bytes /auth creds RegistryAuth = ...] str | Publishes OCI manifest via PUT /v2/<repo>/manifests/<ref> |
push-image | fn [img OciImageBuilder, raw_ref str /auth creds RegistryAuth = ...] map | Deduplicates blobs and pushes image end-to-end |
oci_k8s/k8s| Symbol | Signature | Description |
|---|---|---|
deployment-manifest | fn [name str, image str /namespace ns str = 'default' /replicas reps i64 = 1 /port container_port i64 = 8080 /env env_map map[str] = {} /labels extra_labels map[str] = {} /readiness_path probe_path str = ''] map | Builds a hardened nonroot apps/v1 Deployment |
service-manifest | fn [name str, port i64, target_port i64 /namespace ns str = 'default' /service_type svc_type str = 'ClusterIP' /selector sel map[str] = {}] map | Builds a v1 Service |
configmap-manifest | fn [name str, data map[str] /namespace ns str = 'default'] map | Builds a v1 ConfigMap |
secret-manifest | fn [name str, plain_data map[str] /namespace ns str = 'default' /secret_type stype str = 'Opaque'] map | Builds a Base64-encoded v1 Secret |
ingress-manifest | fn [name str, host str, path_prefix str, service_name str, service_port i64 /namespace ns str = 'default' /tls_secret tls_sec str = ''] map | Builds a networking.k8s.io/v1 Ingress |
from-quote | fn [spec block] map | Compiles a homoiconic quote [...] block into a K8s manifest |
parse-watch-ndjson | fn [raw_ndjson str /initial_rv start_rv str = ''] WatchBatch | Decodes NDJSON watch events and tracks resourceVersion |
new-kube-client | fn [api_server str, token str /namespace ns str = 'default' /ca_pem ca str = ''] KubeClient | Creates a Bearer-token Kubernetes API client |
resource-url | fn [kc KubeClient, api_version str, plural_kind str /name res_name str = '' /namespace ns str = '' /watch is_watch bool = false /resource_version rv str = ''] str | Formats core /api/v1 or grouped /apis/... endpoints |
kube-get | fn [kc KubeClient, api_version str, plural_kind str, name str] map | Fetches a Kubernetes resource JSON object |
kube-apply | fn [kc KubeClient, plural_kind str, manifest map] map | Server-Side Applies (PATCH ?fieldManager=veko-oci-k8s) |
kube-watch | fn [kc KubeClient, api_version str, plural_kind str /resource_version rv str = ''] WatchBatch | Watches resource changes after resource_version |
use [
oci = oci_k8s
k8s = oci_k8s/k8s
]
bin = os/read-bytes 'dist/api-linux-amd64'
img = (oci/new-image)
\ oci/with-platform 'linux' 'arm64'
\ oci/with-env 'PORT' '8080'
\ oci/add-binary-layer '/ko-app/api' bin
pushed = oci/push-image/auth img 'ghcr.io/myorg/api:v1.0.0' (oci/RegistryAuth {
bearer_token = (os/getenv/or 'GHCR_TOKEN' [''])
})
dep = k8s/deployment-manifest/namespace/replicas 'api' (map/get pushed 'pinned_ref') 'prod' 3
kc = k8s/new-kube-client/namespace 'https://k8s.internal:6443' (os/getenv/or 'KUBE_TOKEN' ['']) 'prod'
_ = k8s/kube-apply kc 'deployments' dephttps://veko-lang.org/pkg/oci_k8s/1.0.0.vkpbc52b44c91980b6dd5190f598c8b51c5a6b986aa8c6a8ccf424a4969526e7b12490a9cb2232fa9ff073ffc3468d0bdef6693b07a86a66bff04714c2e049d5be8ed25519:27406074d8681da1d4e6420f5d887cac15c313334c249ac047ba9d4e2df72b70{"name":"oci_k8s","version":"1.0.0","tier":5.0,"tier_label":"Tier 5: Cloud-Native, Noise, IaC & Wasm","category":"Daemonless OCI & Kubernetes","description":"Rootless ko-style distroless OCI image builder & Registry v2 pusher (zero Docker daemon) plus typed Kubernetes manifests & WATCH client.","modules":["oci_k8s/k8s","oci_k8s"],"homepage":"https://veko-lang.org/packages/oci_k8s"}| Bundle Entry Path | Size | Leaf SHA-256 Digest |
|---|---|---|
| README.md | 8 KB | 7caebfbfd56c954074cdea0c1b298d51893352de4f31bc97de92e6da9d855c30 |
| examples/demo.vk | 11 KB | 5cd1646735c0e9196f7ad8856f8ef46f29467770d97f2e904e232763f290040b |
| k8s.vk | 14 KB | f8e7bffd00d352641b49f2faf91191309f54e44191153da4af7e48523710db9d |
| mod.vk | 19 KB | 2e83b3912045a94dc7d650f843a11cf72bf8c3f8a3042bf69b806c84ba533d59 |