A Helm chart for deploying JSReport on Kubernetes. JSReport is a powerful reporting platform for generating reports from JavaScript templates.
- Kubernetes 1.18+
- Helm 3.0+
- PV provisioner support in the underlying infrastructure (if persistence is required)
# Add the JSReport Helm repository
helm repo add jsreport-helm https://ankosoftware.github.io/jsreport-helm/
helm repo update
# Install with default values
helm install my-jsreport jsreport-helm/jsreport
# Install with custom values
helm install my-jsreport jsreport-helm/jsreport -f my-values.yaml
# Install in a specific namespace
helm install my-jsreport jsreport-helm/jsreport --namespace jsreport --create-namespace
# Install from local chart (for development)
helm install my-jsreport charts/jsreport
kubectl get pods -l "app.kubernetes.io/name=jsreport"
helm uninstall my-jsreport
The following table lists the configurable parameters of the JSReport chart and their default values.
Key | Type | Default | Description |
---|---|---|---|
replicaCount |
int | 1 |
Number of JSReport replicas |
image.repository |
string | "jsreport/jsreport" |
JSReport image repository |
image.pullPolicy |
string | "IfNotPresent" |
Image pull policy |
image.tag |
string | "4.9.0-full" |
JSReport image tag |
env |
list | See values.yaml | Environment variables for JSReport configuration |
imagePullSecrets |
list | [] |
Image pull secrets |
nameOverride |
string | "" |
Override name of the chart |
fullnameOverride |
string | "" |
Override fullname of the chart |
serviceAccount.create |
bool | true |
Create service account |
serviceAccount.automount |
bool | true |
Automount service account token |
serviceAccount.annotations |
object | {} |
Service account annotations |
serviceAccount.name |
string | "" |
Service account name |
podAnnotations |
object | {} |
Pod annotations |
podLabels |
object | {} |
Pod labels |
podSecurityContext |
object | {} |
Pod security context |
securityContext |
object | {} |
Container security context |
service.type |
string | "ClusterIP" |
Service type |
service.port |
int | 5488 |
Service port |
ingress.enabled |
bool | false |
Enable ingress |
ingress.className |
string | "" |
Ingress class name |
ingress.annotations |
object | {} |
Ingress annotations |
ingress.hosts |
list | [{"host": "jsreport.local", "paths": [{"path": "/", "pathType": "ImplementationSpecific"}]}] |
Ingress hosts |
ingress.tls |
list | [] |
Ingress TLS configuration |
resources |
object | {"limits": {"cpu": "1000m", "memory": "2Gi"}, "requests": {"cpu": "500m", "memory": "1Gi"}} |
Resource limits and requests |
livenessProbe |
object | HTTP probe on port 5488 | Liveness probe configuration |
readinessProbe |
object | HTTP probe on port 5488 | Readiness probe configuration |
autoscaling.enabled |
bool | false |
Enable horizontal pod autoscaler |
autoscaling.minReplicas |
int | 1 |
Minimum number of replicas |
autoscaling.maxReplicas |
int | 100 |
Maximum number of replicas |
autoscaling.targetCPUUtilizationPercentage |
int | 80 |
Target CPU utilization percentage |
volumes |
list | [] |
Additional volumes |
volumeMounts |
list | [] |
Additional volume mounts |
nodeSelector |
object | {} |
Node selector |
tolerations |
list | [] |
Tolerations |
affinity |
object | {} |
Affinity |
The chart includes several important environment variables for JSReport configuration:
Chrome/Puppeteer Configuration:
chrome_launchOptions_args
: Chrome launch options optimized for Kubernetes- Additional Chrome flags for stability and security
Authentication Configuration:
extensions_authentication_admin_username
: Admin username (default: "admin")extensions_authentication_admin_password
: Admin password (default: "ChangeMe!Password!")extensions_authentication_cookieSession_secret
: Session secret (default: "ChangeMe!Secret!")
Performance and Stability Settings:
NODE_ENV
: Set to "production" for optimal performanceworkers_numberOfWorkers
: Number of worker processes (default: 2)workers_timeout
: Worker timeout in milliseconds (default: 120000)NODE_OPTIONS
: Node.js memory management settings
helm install jsreport jsreport-helm/jsreport
Create a production-values.yaml
file:
replicaCount: 3
image:
tag: "4.9.0-full"
env:
- name: chrome_launchOptions_args
value: "--no-sandbox,--disable-dev-shm-usage,--disable-gpu"
- name: extensions_authentication_admin_username
value: "admin"
- name: extensions_authentication_admin_password
value: "YourSecurePassword123!"
- name: extensions_authentication_cookieSession_secret
value: "YourSecureSessionSecret456!"
resources:
limits:
cpu: 1000m
memory: 2Gi
requests:
cpu: 500m
memory: 1Gi
# Security settings
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
capabilities:
drop:
- ALL
allowPrivilegeEscalation: false
# Optimized environment variables
env:
- name: NODE_ENV
value: "production"
- name: workers_numberOfWorkers
value: "2"
- name: NODE_OPTIONS
value: "--max-old-space-size=1536"
ingress:
enabled: true
className: "nginx"
annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
hosts:
- host: jsreport.yourdomain.com
paths:
- path: /
pathType: ImplementationSpecific
tls:
- secretName: jsreport-tls
hosts:
- jsreport.yourdomain.com
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
Deploy with:
helm install jsreport jsreport-helm/jsreport -f production-values.yaml
# For persistent data storage
volumes:
- name: jsreport-data
persistentVolumeClaim:
claimName: jsreport-pvc
# Temporary volumes are automatically configured
- name: tmp-volume
emptyDir:
sizeLimit: 1Gi
volumeMounts:
- name: jsreport-data
mountPath: /app/data
- name: tmp-volume
mountPath: /tmp
After installation, get the application URL:
# For ClusterIP service (default)
export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name=jsreport" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 8080:5488
echo "Visit http://127.0.0.1:8080 to use JSReport"
# For LoadBalancer service
kubectl get svc jsreport
# For Ingress
kubectl get ingress jsreport
helm upgrade my-jsreport jsreport-helm/jsreport
helm upgrade my-jsreport jsreport-helm/jsreport -f my-new-values.yaml
helm history my-jsreport
helm rollback my-jsreport 1
JSReport requires significant resources due to Chrome/Puppeteer for PDF generation:
- Minimum Memory: 1Gi (recommended: 2Gi)
- Minimum CPU: 500m (recommended: 1000m)
- Temporary Storage: Required for Chrome cache and temp files
The chart includes optimized Chrome launch options for Kubernetes:
--no-sandbox
: Required for running Chrome in containers--disable-dev-shm-usage
: Prevents /dev/shm size issues--disable-gpu
: Disables GPU acceleration (not needed for headless)- Additional flags for stability and security
JSReport supports multiple worker processes for better performance:
- Default: 2 workers per container
- Workers handle PDF generation in parallel
- Configurable timeout and port ranges
Node.js memory settings are optimized for container environments:
--max-old-space-size=1536
: Prevents memory issues in containers- Aligned with container memory limits
- Change Default Credentials: Always change the default admin username and password in production
- Use Strong Session Secrets: Generate a strong, random session secret
- Enable HTTPS: Use TLS/SSL for production deployments
- Resource Limits: Set appropriate resource limits to prevent resource exhaustion
- Security Context: Configure appropriate security contexts for your environment
- Non-Root User: The chart runs as non-root user (UID 1000) by default
- Capability Dropping: All unnecessary Linux capabilities are dropped
- Pod not starting: Check resource limits and node capacity
- Chrome crashes: Ensure the
--no-sandbox
flag is set in chrome launch options - Authentication issues: Verify environment variables are set correctly
- Memory issues: Increase memory limits for resource-intensive reports
# Check pod status
kubectl get pods -l "app.kubernetes.io/name=jsreport"
# View pod logs
kubectl logs -l "app.kubernetes.io/name=jsreport"
# Describe pod for events
kubectl describe pod <pod-name>
# Check service
kubectl get svc jsreport
- Fork the repository
- Create a feature branch
- Make your changes
- Test the chart
- Submit a pull request
# Lint the chart
helm lint charts/jsreport
# Template the chart
helm template jsreport charts/jsreport
# Install in test mode
helm install jsreport charts/jsreport --dry-run --debug
This Helm chart is licensed under the MIT License.