Reference example · Laravel application

PHP Laravel values.

A Laravel web application with runtime storage and cache volumes.

values.yaml

replicaCount: 2
image: ghcr.io/example-org/laravel
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: APP_ENV
    value: production
  - name: APP_DEBUG
    value: "false"
envFrom:
  - configMapRef:
      name: laravel-config
envSecrets:
  enableEnv: true
  envs:
    - name: APP_KEY
      secretName: laravel-secrets
      secretKey: APP_KEY
    - name: DB_PASSWORD
      secretName: laravel-secrets
      secretKey: DB_PASSWORD
configMaps:
  - name: laravel-config
    data:
      LOG_CHANNEL: stderr
      SESSION_DRIVER: cookie

volumes:
  - name: laravel-storage
    emptyDir: {}
  - name: laravel-cache
    emptyDir: {}
volumeMounts:
  - name: laravel-storage
    mountPath: /var/www/html/storage
  - name: laravel-cache
    mountPath: /var/www/html/bootstrap/cache

resources:
  requests: {cpu: 100m, memory: 256Mi}
  limits: {cpu: 1000m, memory: 1Gi}
readinessProbe:
  httpGet: {path: /health, port: http}
livenessProbe:
  httpGet: {path: /health, port: http}
route:
  enabled: true
  gateway: external
  gatewayNamespace: gateway-system
  sectionName: https
  hostname: laravel.example.com

Deploy

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

Result

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

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

Package

Artifact Hub →