Reference example · JavaScript service

Node.js values.

An Express-style service with runtime configuration and a rolling replica profile.

values.yaml

replicaCount: 2
image: ghcr.io/example-org/nodejs
imageTag: "1.0.0"
imagePullPolicy: IfNotPresent

service:
  port: 8080

securityContext:
  runAsNonRoot: true
  runAsUser: 10001
  runAsGroup: 10001
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop: ["ALL"]
podSecurityContext:
  seccompProfile:
    type: RuntimeDefault

env:
  - name: NODE_ENV
    value: production
envFrom:
  - configMapRef:
      name: nodejs-config
envSecrets:
  enableEnv: true
  envs:
    - name: SESSION_SECRET
      secretName: nodejs-secrets
      secretKey: SESSION_SECRET
configMaps:
  - name: nodejs-config
    data:
      LOG_LEVEL: info
      TRUST_PROXY: "true"

resources:
  requests: {cpu: 100m, memory: 128Mi}
  limits: {cpu: 500m, memory: 512Mi}
readinessProbe:
  httpGet: {path: /health, port: http}
livenessProbe:
  httpGet: {path: /health, port: http}
route:
  enabled: true
  gateway: external
  gatewayNamespace: gateway-system
  sectionName: https
  hostname: nodejs.example.com

Deploy

helm upgrade --install nodejs universal/application \
  --namespace apps --create-namespace \
  --values values.yaml

Result

kubectl get pods -l app.kubernetes.io/instance=nodejs
NAME                       READY   STATUS
nodejs-5d9b7f8b6f-abcde    1/1     Running

curl -fsS https://nodejs.example.com/health
{"status":"ok"}

Package

Artifact Hub →