Container orchestration
Functions of the tools module at v0.3.2. Each returns what a command runs in; import it with import * as tools from "tools".
kubectl
kubectl, configured by its parameters.
kubectl(
--image: Environment = #alpine/k8s:1.37.0,
--kubeconfig: String | Null = null,
--context: String | Null = null,
--namespace: String | Null = null,
--network: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is #alpine/k8s:1.37.0 unless --image names another: its tag follows kubectl's release, and it carries Helm, Kustomize, the AWS CLI and eksctl beside it, so a kubeconfig whose user runs aws eks get-token works with with = [aws_setup(...)]. It has no gke-gcloud-auth-plugin. The kubectl image of registry.k8s.io has no shell, which every command here runs through. lask sync pulls and pins whichever image is used (lask spec 10.3); a run never pulls.
A cluster the kubeconfig reaches at 127.0.0.1 — kind, minikube — is the host's, not the container's: give network = "host".
Parameters
--imageThe image to run; another release is passed as image = #alpine/k8s:<tag>.--kubeconfigHost path of the kubeconfig, mounted read-only (KUBECONFIG).--contextHELM_KUBECONTEXT and KUBE_CTX; kubectl itself takes--context.--namespaceHELM_NAMESPACE; kubectl itself takes-n.--networkThe container's network, e.g. "host".--withSetups of other tools this environment should also carry: a cloud's credentials for the kubeconfig's exec plugin.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "kubectl" } on ... or $[...].
Image alpine/k8s:1.37.0
Command words kustomize: import command { "kustomize" } from "tools"
lask eval kubectl --kubeconfig /home/me/.kube/confighelm
Helm, in the image of kubectl, configured by its parameters.
helm(
--image: Environment = #alpine/k8s:1.37.0,
--kubeconfig: String | Null = null,
--context: String | Null = null,
--namespace: String | Null = null,
--network: String | Null = null,
--cache_dir: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is alpine/k8s, as for kubectl: one image for the cluster's tools, so a kubeconfig works the same in each.
Parameters
--imageThe image to run; another release is passed as image = #alpine/k8s:<tag>.--kubeconfigHost path of the kubeconfig, mounted read-only (KUBECONFIG).--contextHELM_KUBECONTEXT.--namespaceHELM_NAMESPACE.--networkThe container's network, e.g. "host".--cache_dirHost directory mounted at /cache; Helm's cache, configuration and data live under /cache/helm (HELM_CACHE_HOME, HELM_CONFIG_HOME, HELM_DATA_HOME), so added repositories and plugins outlive the container.--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "helm" } on ... or $[...].
Image alpine/k8s:1.37.0
Command words kustomize: import command { "kustomize" } from "tools"
lask eval helm --namespace web --cache_dir /tmp/cachekustomize
Kustomize, in the image of kubectl.
kustomize(
--image: Environment = #alpine/k8s:1.37.0,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is alpine/k8s, as for kubectl; the Kustomize image of registry.k8s.io is published for amd64 only. kustomize build renders manifests and reaches no cluster, so its command word is exported.
Parameters
--imageThe image to run; another release is passed as image = #alpine/k8s:<tag>.--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with.
Returns Runnable: The environment, for command { "kustomize" } on ... or $[...].
Image alpine/k8s:1.37.0
Command words kustomize: import command { "kustomize" } from "tools"
lask eval kustomize