php-nginx-ftp-stack
by VastIO B.V.
A Helm chart for deploying a static file / php stack (PHP-FPM, NGINX, and sFTP)
About this chart
php-nginx-ftp-stack
A Helm chart to deploy a complete PHP-FPM, NGINX, and sFTP stack for hosting PHP applications and managing static content with an integrated sFTP server.
Hosted on: helm.vastio.io
Notice: FTP has been replaced by sFTP in this chart.
Features
- PHP-FPM: Runs PHP scripts and supports dynamic installations of extensions like
gdfor image manipulation. - NGINX: Serves static files and proxies PHP requests to PHP-FPM.
- sFTP Server: Allows uploads of scripts, images, and other assets to the shared storage via sFTP.
- Shared Storage: A ReadWriteMany (RWX) PersistentVolumeClaim (PVC) shared between PHP-FPM, NGINX, and sFTP.
- Customizable: Allows configuration of namespace, storage size, sFTP credentials, and service types.
- Daemon Mode: Allows services to directly bind certain public ports on certain nodes using a proxy binary to forward the traffic. It can be enabled or disabled. A custom solution may be needed if you want to keep the original source address for each connection.
- Ingress: Supports configuring ingress resources for external access to the services.
Installation
Add the Helm Repository
helm repo add vastio https://helm.vastio.io
helm repo update
Install the Chart
helm install my-app vastio/php-nginx-ftp-stack --namespace my-namespace
You can also customize the deployment by creating a values.yaml file and providing it during installation:
helm install my-app vastio/php-nginx-ftp-stack --namespace my-namespace -f values.yaml
Upgrade the Chart
helm upgrade my-app vastio/php-nginx-ftp-stack --namespace my-namespace -f values.yaml
Configuration
The following table lists the configurable parameters of the chart and their default values:
| Parameter | Description | Default |
|---|---|---|
timezone | Timezone used for FTP | UTC |
storage.size | Size of the RWX PVC | 20Gi |
sftp.username | sFTP username | customuser |
sftp.password | sFTP password | custompassword123 |
phpFpm.enableForwarding | Expose PHP-FPM port directly on nodes (SECURITY RISK!) | false |
phpFpm.servicePort | PHP-FPM service port | 9000 |
phpFpm.publicPort | PHP-FPM public port (if forwarding) | 9000 |
phpFpm.replicas | Number of PHP-FPM replicas | 1 |
nginx.enableForwarding | Expose NGINX port directly on nodes | false |
nginx.serviceType | NGINX service type (ClusterIP, LoadBalancer, etc.) | ClusterIP |
nginx.servicePort | NGINX service port | 80 |
nginx.publicPort | NGINX public port (if forwarding) | 80 |
nginx.replicas | Number of NGINX replicas | 1 |
sftpServer.replicas | Number of sFTP server replicas | 1 |
sftpServer.servicePort | sFTP service port | 22 |
sftpServer.serviceType | sFTP service type (ClusterIP, NodePort, LoadBalancer, etc.) | ClusterIP |
sftpServer.nodePort | sFTP node port (if NodePort is used) | 30099 |
sftpServer.enableForwarding | Expose sFTP port directly on nodes | false |
sftpServer.publicPort | sFTP public port (if forwarding) | 22 |
sftpServer.sshHostKeySecret | SSH host key secret, leave blank if auto generated | sftp-host-key-secret |
sftpServer.extraVolumes | Extra volumes | [] |
sftpServer.extraMounts | Extra mounts | [] |
certManager.enabled | Enable cert-manager | false |
certManager.issuerKind | Issuer kind | ClusterIssuer |
certManager.issuerName | Issuer name | ssh-key-issuer |
certManager.createIssuer | Create issuer | true |
daemon.enabled | Enable Daemon Mode | false |
daemon.mode | Daemon mode (daemonset or none) | daemonset |
daemon.replicas | Number of replicas if using deployment mode | 1 |
daemon.nodeSelector | Node selector for port forwarding | {} |
ingress.enabled | Enable Ingress | false |
ingress.className | Ingress Class | "" |
ingress.annotations | Annotations | {} |
ingress.path | Path | / |
ingress.domains | Domains | [] |
Example values.yaml
# Timezone (Used for FTP only right-now)
timezone: UTC
storage:
# Pvc size where the files are stored
size: 20Gi
# sFTP User and Password
sftp:
username: customuser
password: custompassword123
phpFpm:
# Expose this port directly on one or more nodes using socat
# SECURITY RISK IF ENABLED!
enableForwarding: false
# Port
servicePort: 9000
# Public Port (if forwarding)
publicPort: 9000
# Amount of replicas
replicas: 1
nginx:
# Expose port directly on a node
enableForwarding: false
# Service Type for internal use (or external)
serviceType: ClusterIP
# Port
servicePort: 80
# Public Port (if forwarding)
publicPort: 80
# Amount of replicas
replicas: 1
sftpServer:
# Amount of replicas
replicas: 1
# Port
servicePort: 22
# Service Type
serviceType: ClusterIP
# Node Port (if useed)
nodePort: 30099
# Expose port directly on a node
enableForwarding: false
# Public Port (if forwarding)
publicPort: 22
# Enable SSH host key secret, leave blank if auto generated
# or sftp-host-key-secret if made by cert-manager
sshHostKeySecret: "sftp-host-key-secret"
# Extra Volumes
extraVolumes: []
# Extra Mounts
extraMounts: []
certManager:
# Enable cert-manager
## Disable if not installed in cluster
## Used for generating SSH host keys
enabled: false
# Issuer Kind
issuerKind: ClusterIssuer
# Issuer Name
issuerName: ssh-key-issuer
# Create Issuer
createIssuer: true
daemon:
# Enable Daemon Mode
enabled: false
# Daemon Mode
## Options: daemonset, none
mode: daemonset
# Amount of replicas
replicas: 1
# Host selector
nodeSelector: {}
ingress:
# Enable Ingress
enabled: false
# Ingress Class
className: ""
# Annotations
annotations: {}
# Path
path: /
# Domains
domains:
- name: host1.example.com
- name: host2.example.com
tls: true
- name: host3.example.com
tls: true
secretOverride: custom-tls-secret
Uninstalling the Chart
To uninstall the deployment:
helm uninstall my-app --namespace my-namespace
This will delete all resources associated with the deployment, but the PVC will persist unless explicitly deleted.
License
This Helm chart is licensed under the MIT License. See the LICENSE file for details.
Deploy php-nginx-ftp-stack with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has php-nginx-ftp-stack 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartphp-nginx-ftp-stack is pinned at v0.4.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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