Skip to content

Container orchestration ​

Functions of the tools module at v0.5.0. Each returns what a command runs in; import it with import * as tools from "tools".

kubectl.env ​

kubectl, configured by its parameters.

lask
kubectl.env(
  --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> = {}
): Runnable

The 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

  • --image The image to run; another release is passed as image = #alpine/k8s:<tag>.
  • --kubeconfig Host path of the kubeconfig, mounted read-only (KUBECONFIG).
  • --context HELM_KUBECONTEXT and KUBE_CTX; kubectl itself takes --context.
  • --namespace HELM_NAMESPACE; kubectl itself takes -n.
  • --network The container's network, e.g. "host".
  • --with Setups of other tools this environment should also carry: a cloud's credentials for the kubeconfig's exec plugin.
  • --extra_env Any 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"

bash
lask eval kubectl.env --kubeconfig /home/me/.kube/config

lib/kubectl.lask

helm.env ​

Helm, in the image of kubectl, configured by its parameters.

lask
helm.env(
  --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> = {}
): Runnable

The image is alpine/k8s, as for kubectl: one image for the cluster's tools, so a kubeconfig works the same in each.

Parameters

  • --image The image to run; another release is passed as image = #alpine/k8s:<tag>.
  • --kubeconfig Host path of the kubeconfig, mounted read-only (KUBECONFIG).
  • --context HELM_KUBECONTEXT.
  • --namespace HELM_NAMESPACE.
  • --network The container's network, e.g. "host".
  • --cache_dir Host 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.
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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"

bash
lask eval helm.env --namespace web --cache_dir /tmp/cache

lib/helm.lask

kustomize.env ​

Kustomize, in the image of kubectl.

lask
kustomize.env(
  --image: Environment = #alpine/k8s:1.37.0,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

The 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

  • --image The image to run; another release is passed as image = #alpine/k8s:<tag>.
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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"

bash
lask eval kustomize.env

lib/kustomize.lask

Released under the MIT License.