php

by Qonstrukt

Helm chartv0.2.0App 8.4-v8-apacheVerified publisher

A Helm Chart for a generic PHP application

About this chart

PHP

A Helm Chart for generic PHP applications on Kubernetes.

TL;DR

helm repo add qonstrukt https://qonstrukt.github.io/helm-charts/
helm install my-php-app qonstrukt/php

Introduction

This Chart uses these very complete PHP images to deploy a generic PHP application to Kubernetes.

It fully supports deployment of the multi-architecture docker image.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.x
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-php-app:

helm install my-php-app qonstrukt/php

Uninstalling the Chart

To uninstall/delete the my-php-app deployment:

helm uninstall my-php-app

Common parameters

KeyTypeDefaultDescription
fullnameOverridestring""Fully override the deployment name
nameOverridestring""Partially override the deployment name

Deployment parameters

KeyTypeDefaultDescription
image.pullPolicystring"IfNotPresent"Image pull policy
image.registrystring"docker.io"Image registry
image.repositorystring"qonstrukt/php"Image name
image.tagstring""Image tag
imagePullSecretslist[]Image pull secrets
strategyobject{}Pod deployment strategy
livenessProbeobjectsee values.yamlLiveness probe configuration
startupProbeobjectsee values.yamlStartup probe configuration
readinessProbeobjectsee values.yamlReadiness probe configuration
customLivenessProbeobject{}Custom liveness probe (overwrites default liveness probe configuration)
customStartupProbeobject{}Custom startup probe (overwrites default startup probe configuration)
customReadinessProbeobject{}Custom readiness probe (overwrites default readiness probe configuration)
resourcesobject{}Resource limits and requests
nodeSelectorobject{}Deployment node selector
podAnnotationsobject{}Additional pod annotations
podSecurityContextobjectsee values.yamlPod security context
securityContextobjectsee values.yamlContainer security context
envlist[]Additional container environmment variables
argslist[]Arguments for the container entrypoint process
serviceAccount.createboolfalseEnable service account creation
serviceAccount.namestring""Optional name of the service account
serviceAccount.annotationsobject{}Additional service account annotations
affinityobject{}Affinity for pod assignment
tolerationslist[]Tolerations for pod assignment
containerPortint80Internal http container port
replicaCountint1Number of replicas
revisionHistoryLimitintnilMaximum number of revisions maintained in revision history
podDisruptionBudgetobject{}Pod disruption budget
podDisruptionBudget.minAvailableintnilMinimum number of pods that must be available after eviction
podDisruptionBudget.maxUnavailableintnilMaximum number of pods that can be unavailable after eviction

Service paramters

KeyTypeDefaultDescription
service.portint80Apache or PHP-FPM service port
service.typestring"ClusterIP"Service type
service.nodePortintnilThe node port (only relevant for type LoadBalancer or NodePort)
service.clusterIPstringnilThe cluster ip address (only relevant for type LoadBalancer or NodePort)
service.loadBalancerIPstringnilThe load balancer ip address (only relevant for type LoadBalancer)
service.annotationsobject{}Additional service annotations

Ingress parameters

KeyTypeDefaultDescription
ingress.enabledboolfalseEnable ingress for web service
ingress.annotationsstringnilAdditional annotations for ingress
ingress.hosts[0].hoststring""Hostname for the ingress endpoint
ingress.hosts[0].host.paths[0].pathstring"/"Default root path
ingress.hosts[0].host.paths[0].pathTypestringImplementationSpecificIngress path type (ImplementationSpecific, Prefix, Exact)
ingress.tlslist[]Ingress TLS parameters
ingress.maxBodySizestring"64m"Maximum body size for post requests

Storage parameters

KeyTypeDefaultDescription
storage.accessModes[0]string"ReadWriteOnce"Storage access mode
storage.persistentVolumeClaimNamestringnilPVC name when existing storage volume should be used
storage.requestedSizestringnilSize for new PVC, when no existing PVC is used
storage.classNamestringnilStorage class name
storage.keepPvcboolfalseKeep a created Persistent volume claim when uninstalling the helm chart

Deploy php with OpenTenant

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