devenv

by anza-labs

Helm chartv0.1.2App latestApache-2.0Verified publisher

Nix development environment pod with Tailscale SSH access and optional Docker-in-Docker.

About this chart

devenv

Nix development environment pod with Tailscale SSH access and optional Docker-in-Docker.

Homepage: https://github.com/anza-labs/charts

Maintainers

NameEmailUrl
shanduur[email protected]http://linkedin.com/in/urbanekmateusz

Source Code

Prerequisites

Before installing, create the required Kubernetes Secrets and ConfigMaps that the chart expects.

Tailscale auth key

The default tailscale.authKeySecret value is tailscale-auth. Create it in the target namespace:

kubectl create secret generic tailscale-auth \
  --namespace devenv \
  --from-literal=TS_AUTHKEY=tskey-auth-xxxxxxxx

SSH authorized keys

Provide public keys via sshKeys.authorizedKeys at install time, or create a Secret in advance:

cat ~/.ssh/id_ed25519.pub | kubectl create secret generic my-ssh-keys \
  --namespace devenv \
  --from-file=authorized_keys=/dev/stdin

Then set --set sshKeys.existingSecret=my-ssh-keys.

Installation

To install the chart with the release name devenv:

helm repo add anza-labs https://anza-labs.github.io/charts
helm repo update anza-labs
helm install devenv anza-labs/devenv --version 0.1.2

Upgrading

To upgrade an existing installation:

helm upgrade devenv anza-labs/devenv

Uninstalling

To uninstall an existing installation:

helm uninstall devenv

Values

KeyTypeDefaultDescription
affinityobject{}Affinity settings for the pods.
bootstrapScriptstring""Custom bootstrap script (overrides the default).
core.envlist[]Extra environment variables for the core container.
core.extraVolumeMountslist[]Extra volume mounts for the core container.
core.image.packageslist["age","coreutils","curl","dnsutils","fd","file","fzf","git","gnupg","gnutar","gzip","htop","iproute2","lsof","ncurses","neovim","openssh","openssl","ripgrep","util-linux","xz","zsh"]Nixery packages to include (e.g. [go, rustc, cargo]).
core.image.pullPolicystring"IfNotPresent"Image pull policy.
core.image.repositorystring"nixery.dev/shell"Registry and repository for the image (will have packages appended).
core.image.tagstring"latest"Image tag.
core.resourcesobject{"limits":{"cpu":2,"memory":"4Gi"},"requests":{"cpu":"500m","memory":"1Gi"}}Resource requests and limits.
core.securityContextobject{}Security context (core container)
core.shellstring"/bin/zsh"Login shell for the user (e.g. /bin/zsh).
core.userstring"devpod"Non-root username.
core.workingDirstring"/home/devpod"Working directory.
dind.enabledboolfalseEnable Docker-in-Docker sidecar.
dind.image.pullPolicystring"IfNotPresent"Image pull policy.
dind.image.repositorystring"docker.io/library/docker"DinD image repository.
dind.image.tagstring"dind"DinD image tag.
dind.persistence.sizestring"30Gi"Docker storage PVC size.
dind.persistence.storageClassstring""Storage class for Docker storage PVC.
dind.privilegedbooltrueRun DinD in privileged mode.
dind.resourcesobject{"limits":{"cpu":2,"memory":"4Gi"},"requests":{"cpu":"500m","memory":"1Gi"}}Resource requests and limits.
dind.storageSizestring"30Gi"Docker storage size.
dind.userNamespace.enabledboolfalseUse user-namespace mode (requires kernel >=5.12).
dotfiles.git.hookCommandstring""Optional command to run after dotfiles are cloned (e.g. "cd dotfiles && stow .").
dotfiles.git.image.pullPolicystring"IfNotPresent"Image pull policy.
dotfiles.git.image.repositorystring"nixery.dev/shell/git"Registry and repository for the image (will have packages appended).
dotfiles.git.image.tagstring"latest"Image tag.
dotfiles.git.repositorylist[{"name":".ohmyzsh","repo":"https://github.com/ohmyzsh/ohmyzsh.git","revision":"master"}]Git repositories for dotfiles.
fullnameOverridestring""Override for the full name.
hostPathTun.enabledbooltrueEnable hostPath mount for /dev/net/tun.
hostPathTun.pathstring"/dev/net/tun"Path to the TUN device.
imagePullSecretslist[]Secrets for pulling images.
nameOverridestring""Override for the name.
nodeSelectorobject{"kubernetes.io/os":"linux"}Node selector for the pods.
persistence.home.accessModeslist["ReadWriteOnce"]Access modes for home PVC.
persistence.home.enabledbooltrueEnable home directory PVC.
persistence.home.sizestring"10Gi"Home directory PVC size.
persistence.home.storageClassstring""Storage class for home PVC.
podAnnotationsobject{}Annotations to be added to the pods.
podLabelsobject{}Labels to be added to the pods.
podSecurityContextobject{}
reboot.enabledboolfalseEnable weekly reboot CronJob (restarts on Sunday at midnight).
reboot.image.pullPolicystring"IfNotPresent"Image pull policy.
reboot.image.repositorystring"nixery.dev/kubectl"kubectl image repository.
reboot.image.tagstring"latest"Image tag.
reboot.resourcesobject{"limits":{"cpu":"200m","memory":"256Mi"},"requests":{"cpu":"50m","memory":"64Mi"}}Resource requests and limits for the reboot Job pod.
reboot.schedulestring"0 0 * * 0"Cron schedule expression (default: Sunday at midnight).
service.annotationsobject{}Annotations to add to the headless service.
serviceAccount.annotationsobject{}Annotations to add to the service account.
serviceAccount.automountbooltrueAutomatically mount a ServiceAccount's API credentials.
serviceAccount.createbooltrueSpecifies whether a service account should be created.
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template.
sshKeys.authorizedKeysstring""Authorized public keys (one per line).
sshKeys.existingSecretstring""Name of an existing secret containing key "authorized_keys".
tailscale.authKeySecretstring"tailscale-auth"Name of the secret containing TS_AUTHKEY.
tailscale.enabledbooltrueEnable Tailscale sidecar for SSH access.
tailscale.hostnamestring""Optional custom hostname (defaults to pod name).
tailscale.image.pullPolicystring"IfNotPresent"Image pull policy.
tailscale.image.repositorystring"docker.io/tailscale/tailscale"Tailscale image repository.
tailscale.image.tagstring"stable"Tailscale image tag.
tailscale.persistence.sizestring"256Mi"Size for Tailscale state PVC.
tailscale.persistence.storageClassstring""Storage class for Tailscale state PVC.
tailscale.resourcesobject{"limits":{"cpu":"200m","memory":"256Mi"},"requests":{"cpu":"50m","memory":"64Mi"}}Resource requests and limits.
tolerationslist[]Tolerations for the pods.
updateStrategy.typestring"OnDelete"

Deploy devenv with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has devenv on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdevenv is pinned at v0.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply