Skip to main content

Module kube

Module kube 

Source
Expand description

Kubernetes auth + URL helpers.

Tatara-script doesn’t bundle a full kube-rs equivalent — instead it exposes the auth primitives a script needs to call the K8s API via the existing http-get-json / http-post-json stdlib. This keeps the binary size small and follows the Unix-philosophy “small, composable primitives” the user named.

Surface:

(kube-in-cluster?) → bool — running inside a Pod? (kube-bearer-token) → string — service account token (kube-ca-cert) → string — cluster CA cert (PEM) (kube-namespace) → string — pod’s own namespace (kube-api-base) → string — “https://kubernetes.default.svc:443”

Use together with http-get-json:

(define ns (kube-namespace)) (define url (string-append (kube-api-base) “/api/v1/namespaces/” ns “/configmaps”)) (define headers (list (list “Authorization” (string-append “Bearer “ (kube-bearer-token))))) (define cms (http-get-json url headers))

Functions§

install