php-nginx-ftp-stack

by VastIO B.V.

Helm chartv0.4.0App 0.4.0Verified publisher

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 gd for 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:

ParameterDescriptionDefault
timezoneTimezone used for FTPUTC
storage.sizeSize of the RWX PVC20Gi
sftp.usernamesFTP usernamecustomuser
sftp.passwordsFTP passwordcustompassword123
phpFpm.enableForwardingExpose PHP-FPM port directly on nodes (SECURITY RISK!)false
phpFpm.servicePortPHP-FPM service port9000
phpFpm.publicPortPHP-FPM public port (if forwarding)9000
phpFpm.replicasNumber of PHP-FPM replicas1
nginx.enableForwardingExpose NGINX port directly on nodesfalse
nginx.serviceTypeNGINX service type (ClusterIP, LoadBalancer, etc.)ClusterIP
nginx.servicePortNGINX service port80
nginx.publicPortNGINX public port (if forwarding)80
nginx.replicasNumber of NGINX replicas1
sftpServer.replicasNumber of sFTP server replicas1
sftpServer.servicePortsFTP service port22
sftpServer.serviceTypesFTP service type (ClusterIP, NodePort, LoadBalancer, etc.)ClusterIP
sftpServer.nodePortsFTP node port (if NodePort is used)30099
sftpServer.enableForwardingExpose sFTP port directly on nodesfalse
sftpServer.publicPortsFTP public port (if forwarding)22
sftpServer.sshHostKeySecretSSH host key secret, leave blank if auto generatedsftp-host-key-secret
sftpServer.extraVolumesExtra volumes[]
sftpServer.extraMountsExtra mounts[]
certManager.enabledEnable cert-managerfalse
certManager.issuerKindIssuer kindClusterIssuer
certManager.issuerNameIssuer namessh-key-issuer
certManager.createIssuerCreate issuertrue
daemon.enabledEnable Daemon Modefalse
daemon.modeDaemon mode (daemonset or none)daemonset
daemon.replicasNumber of replicas if using deployment mode1
daemon.nodeSelectorNode selector for port forwarding{}
ingress.enabledEnable Ingressfalse
ingress.classNameIngress Class""
ingress.annotationsAnnotations{}
ingress.pathPath/
ingress.domainsDomains[]

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartphp-nginx-ftp-stack is pinned at v0.4.0 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