node-app

by bryopsida

Helm chartv0.5.1

A generic helm chart for a node app, load code into pod with `kubectl cp <app code foder> <pod name>:/app`. will automatically load new changes

About this chart

node-app

A generic helm chart for a node app, load code into pod with kubectl cp <app code foder> <pod name>:/app. will automatically load new changes

Maintainers

NameEmailUrl
bryopsida

Values

KeyTypeDefaultDescription
affinityobject{}Adjust pod affinity/grouping behavior on nodes
autoscalingobject{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}Control auto scaling settings, if you need this, you must enable manyPods: true
clusterDomainstring"cluster.local"
devSideCarobject{"dropbearPvcName":"dropbear","enabled":true,"homePvcName":"home","image":{"pullPolicy":"Always","repository":"ghcr.io/bryopsida/k8s-dev-pod","tag":"main"},"nvmInstallEnabled":true,"ohMyZshInstallEnabled":true,"passwordLoginEnabled":true,"resources":{},"sdkManInstallEnabled":true,"securityContext":{"runAsUser":1000},"service":{"enabled":true,"port":3022,"type":"ClusterIP"},"trustedPublicKeys":null}Control the sidecar that provides a drop bear ssh sidecar for VS Code Remote
devSideCar.dropbearPvcNamestring"dropbear"set the name of the PVC holding the dropbear config files
devSideCar.enabledbooltrueEnable the ssh sidecar, if you aren't making active live changes to your code you can disable this
devSideCar.homePvcNamestring"home"set the name of the PVC holding the ssh user home fodler
devSideCar.nvmInstallEnabledbooltrueinstall nvm
devSideCar.ohMyZshInstallEnabledbooltrueinstall oh my zsh
devSideCar.passwordLoginEnabledbooltrueEnable creating a random password on startup for the ssh user, once a public key has been copied this can/should be disabled
devSideCar.resourcesobject{}Set resources for the ssh/dev side car container
devSideCar.securityContextobject{"runAsUser":1000}Set security context settings for the ssh/dev side car container, you must take care when picking UID/GIDs to ensure the ssh user has permissions on the PVCs
devSideCar.service.enabledbooltrueEnable a service object for ssh access to the dev side car
devSideCar.service.portint3022Port to use for service
devSideCar.service.typestring"ClusterIP"Type of service, ClusterIP keeps internal, LoadBalancer exposes the service
fullnameOverridestring""
image.pullPolicystring"Always"
image.repositorystring"node"
image.tagstring"lts"
imagePullSecretslist[]
initContainers[0]object{"command":["node","/seed/seed.mjs"],"image":"node:lts","name":"seed-container","securityContext":{"runAsUser":1000},"volumeMounts":[{"mountPath":"/seed","name":"seed"},{"mountPath":"/app","name":"app-code","subPath":"app-code"},{"mountPath":"/home/node/.npm","name":"npm-cache","subPath":"npm-cache"}]}seed container, this copies in the pacßkage.json, package-lock.json, and index.js to kick start server that passes health checks the intent is this can be changed live and persisted in the app-code pvc as you make changes through the dev side car, when you finish making changes for a cycle you can disable the dev side car. If the ability to rollback is important to you, use a storage system with snapshotting and rollback.
livenessProbeobject{"httpGet":{"path":"/","port":"http"}}Control Liveness probe settings
managedStorageobject{"app-code":{"size":"1Gi"},"dropbear":{"size":"256Mi"},"home":{"size":"10Gi"},"node-modules":{"size":"5Gi"},"npm-cache":{"size":"5Gi"}}Map of storage volumes managed by the helm release
managedStorage.app-codeobject{"size":"1Gi"}PVC to hold application specific code
managedStorage.dropbearobject{"size":"256Mi"}PVC to persist dropbear config such as public keys
managedStorage.homeobject{"size":"10Gi"}PVC to hold SSH user home folder
managedStorage.node-modulesobject{"size":"5Gi"}PVC to hold node modules
managedStorage.npm-cacheobject{"size":"5Gi"}PVC to hold npm cache
manyPodsboolfalse
nameOverridestring""
nodeSelectorobject{}Control what node(s) pods can be scheduled on
podAnnotationsobject{}
podLabelsobject{}
podSecurityContext.fsGroupint1000
probesEnabledbooltrueToggle use of probes, if you plan on pausing/break pointing app server, you'll want to disable probes
readinessProbeobject{"httpGet":{"path":"/","port":"http"}}Control Readiness probe settings
replicaCountint1
resourcesobject{}Set resource allocations for the service/app container
securityContextobject{"runAsNonRoot":true,"runAsUser":1000}Set security context settings for the service/app container
service.portint3000
service.typestring"ClusterIP"
serviceAccount.annotationsobject{}
serviceAccount.automountbooltrue
serviceAccount.createbooltrue
serviceAccount.namestring""
tolerationslist[]Control what taints these workloads can tolerate
virtualService.enabledboolfalse
virtualService.gatewaystring"istio-ingress/default-gateway"
virtualService.hostnamestring"node.example.com"
volumeMountslist[{"mountPath":"/app","name":"app-code","subPath":"app-code"},{"mountPath":"/app/.npm","name":"npm-cache","subPath":"npm-cache"},{"mountPath":"/.npm","name":"npm-cache","subPath":"npm-cache"},{"mountPath":"/app/node_modules","name":"node-modules","subPath":"node-modules"}]Mount volumes onto containers
volumes[0].configMap.namestring"seed-config"
volumes[0].namestring"seed"
volumes[1].namestring"app-code"
volumes[1].persistentVolumeClaim.claimNamestring"app-code"
volumes[2].namestring"npm-cache"
volumes[2].persistentVolumeClaim.claimNamestring"npm-cache"
volumes[3].namestring"node-modules"
volumes[3].persistentVolumeClaim.claimNamestring"node-modules"
volumes[4].namestring"home"
volumes[4].persistentVolumeClaim.claimNamestring"home"
volumes[5].namestring"dropbear"
volumes[5].persistentVolumeClaim.claimNamestring"dropbear"

Autogenerated from chart metadata using helm-docs v1.12.0

Deploy node-app with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has node-app 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 chartnode-app is pinned at v0.5.1 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