phpmyadmin
by HelmForge
A Helm chart for deploying phpMyAdmin on Kubernetes as a web-based MySQL/MariaDB administration tool
About this chart
phpMyAdmin
A Helm chart for deploying phpMyAdmin on Kubernetes with the official phpmyadmin image.
phpMyAdmin is a web UI for administering MySQL and MariaDB. This chart supports development installs, internal administration portals, and hardened production-style deployments with External Secrets, Gateway API, NetworkPolicy, dual-stack Services, optional shared sessions, and Kubernetes-native availability controls.
Install
helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install phpmyadmin helmforge/phpmyadmin
OCI:
helm install phpmyadmin oci://ghcr.io/helmforgedev/helm/phpmyadmin
Quick Start
helm install phpmyadmin oci://ghcr.io/helmforgedev/helm/phpmyadmin \
--set phpmyadmin.host=mysql.default.svc.cluster.local
Local access:
kubectl port-forward svc/phpmyadmin 8080:80
Open http://localhost:8080/.
Feature Summary
- Official
phpmyadmincontainer image. - Single-server, multi-server, and arbitrary-server login modes.
- Cookie, config, HTTP, and signon auth mode selection.
- Optional auto-login with inline Secret, existing Secret, or External Secrets Operator.
- External Secrets Operator support with
external-secrets.io/v1. - Ingress and Kubernetes Gateway API
HTTPRoute. - Service dual-stack options through
ipFamilyPolicyandipFamilies. - Optional NetworkPolicy for ingress and database egress.
- Optional ServiceAccount token automount control.
- Optional HPA and PodDisruptionBudget.
- Optional
/sessionsmount for multi-replica session stability. - Optional custom phpMyAdmin config through ConfigMap or
PMA_CONFIG_BASE64. - Optional configuration storage/control user variables.
- Optional custom themes mounted at
/www/themes.
Application Listener
containerPorts.http configures the real Apache listener through the official
image's APACHE_PORT environment variable. It also controls the container
port, probes, and NetworkPolicy ingress rule. service.port is the independent
Kubernetes Service port and routes to the named http target.
containerPorts:
http: 8088
service:
port: 80
Changing only service.port does not change Apache. Use
containerPorts.http when the process must listen on a different port.
Development vs Production
The default values are intentionally simple for development: one replica, no Ingress/Gateway, no NetworkPolicy, no ExternalSecret, and access through port-forward. This keeps a local install easy.
Production deployments should opt into the controls they need:
- Use
auth.existingSecretorexternalSecrets.authinstead of inline passwords. - Prefer
phpmyadmin.authType: cookieunless a controlledconfig,http, orsignonworkflow is required. - Expose phpMyAdmin through private networking, VPN, SSO/reverse proxy auth, or IP allowlists.
- Enable TLS at the Ingress or Gateway layer.
- Enable NetworkPolicy and restrict egress to DNS and the target database.
- Use least-privilege database accounts.
- Enable
sessions.enabledfor multi-replica deployments that rely on cookie/session state. - Add requests, limits, PDB, HPA, topology spread, and anti-affinity where appropriate.
Database Connectivity
Single MySQL/MariaDB server:
phpmyadmin:
host: mysql.default.svc.cluster.local
port: 3306
Multi-server dropdown:
phpmyadmin:
hosts: "mysql-primary.default.svc,mysql-replica.default.svc,mariadb.default.svc"
ports: "3306,3306,3306"
verboses: "Primary,Replica,MariaDB"
Arbitrary server mode:
phpmyadmin:
arbitrary: true
Authentication
Default cookie login:
phpmyadmin:
authType: cookie
auth:
blowfishSecret: "use-a-32-byte-random-secret-here"
Non-cookie auth modes are rendered into config.user.inc.php because the official phpMyAdmin image does not consume an auth-type environment variable:
phpmyadmin:
authType: http
When authType: http is used, the chart automatically switches the default probes to TCP checks because the application root returns 401
until HTTP authentication succeeds.
Auto-login with an existing Secret:
auth:
existingSecret: phpmyadmin-auth
existingSecretUsernameKey: username
existingSecretPasswordKey: password
existingSecretBlowfishKey: blowfish-secret
The Secret should contain:
apiVersion: v1
kind: Secret
metadata:
name: phpmyadmin-auth
type: Opaque
stringData:
username: admin
password: change-me
blowfish-secret: use-a-32-byte-random-secret-here
Auto-login skips the login form and should only be used behind strong network and identity controls.
When a blowfish secret is provided inline, by existing Secret, or by External Secrets Operator, the chart exposes it to the pod as
HELMFORGE_BLOWFISH_SECRET and writes $cfg['blowfish_secret'] through config.user.inc.php.
External Secrets Operator
The chart can render an ExternalSecret using external-secrets.io/v1. The External Secrets Operator
and the referenced SecretStore or ClusterSecretStore must already exist.
externalSecrets:
enabled: true
secretStoreRef:
name: platform-secrets
kind: ClusterSecretStore
auth:
enabled: true
usernameRemoteRef:
key: prod/phpmyadmin
property: username
passwordRemoteRef:
key: prod/phpmyadmin
property: password
blowfishSecretRemoteRef:
key: prod/phpmyadmin
property: blowfish-secret
Ingress
phpmyadmin:
host: mysql.default.svc.cluster.local
absoluteUri: "https://pma.example.com/"
ingress:
enabled: true
ingressClassName: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- host: pma.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: phpmyadmin-tls
hosts:
- pma.example.com
Gateway API
Gateway API support is opt-in and creates an HTTPRoute attached to an existing Gateway.
gatewayAPI:
enabled: true
parentRefs:
- name: public
namespace: gateway-system
sectionName: https
hostnames:
- pma.example.com
Service Dual Stack
Dual-stack is disabled by default and inherits the cluster default. Enable it only on clusters configured for IPv4/IPv6 Services.
service:
ipFamilyPolicy: PreferDualStack
ipFamilies:
- IPv4
- IPv6
NetworkPolicy
networkPolicy:
enabled: true
ingress:
allowSameNamespace: true
egress:
enabled: true
allowDNS: true
allowSameNamespaceDatabase: true
databasePort: 3306
Use extraFrom and extraTo to restrict traffic to Gateway/Ingress controller namespaces and database CIDRs or pod selectors.
Sessions And Replicas
phpMyAdmin is mostly stateless, but cookie/session flows benefit from a shared /sessions mount when running multiple replicas.
replicaCount: 2
sessions:
enabled: true
type: persistentVolumeClaim
accessModes:
- ReadWriteMany
size: 1Gi
For clusters without shared storage, keep replicaCount: 1 or use ingress stickiness.
Custom Configuration
Mount config.user.inc.php:
config:
customConfig: |
<?php
$cfg['ShowPhpInfo'] = false;
$cfg['MaxRows'] = 100;
The chart also generates config.user.inc.php when it needs to apply phpmyadmin.authType values other than cookie or a configured
blowfish secret. If config.customConfig is set, the custom block is appended after the generated block so advanced users can still override
phpMyAdmin settings deliberately.
Or pass base64 configuration through the official image variable:
phpmyadmin:
configBase64: "PD9waHAKJGNmZ1snU2hvd1BocEluZm8nXSA9IGZhbHNlOwo="
Production Example
See examples/production.yaml.
Architecture Guides
- External Secrets
Main Parameters
| Key | Default | Description |
|---|---|---|
containerPorts.http | 80 | Actual Apache HTTP listener |
phpmyadmin.host | "" | Single MySQL/MariaDB host |
phpmyadmin.hosts | "" | Comma-separated multi-server hosts |
phpmyadmin.ports | "" | Comma-separated multi-server ports |
phpmyadmin.verboses | "" | Comma-separated server display names |
phpmyadmin.arbitrary | false | Let users enter a host at login |
phpmyadmin.authType | cookie | phpMyAdmin auth mode |
phpmyadmin.uploadLimit | 64M | SQL import upload limit |
phpmyadmin.absoluteUri | "" | External URL when behind a proxy |
auth.existingSecret | "" | Existing auth Secret |
externalSecrets.enabled | false | Render ExternalSecret resources |
gatewayAPI.enabled | false | Render HTTPRoute |
service.ipFamilyPolicy | "" | Service IP family policy |
service.ipFamilies | [] | Service IP families |
networkPolicy.enabled | false | Render NetworkPolicy |
sessions.enabled | false | Mount /sessions |
autoscaling.enabled | false | Render HPA |
pdb.enabled | false | Render PDB |
serviceAccount.automountServiceAccountToken | false | Mount SA token into pods |
Validation
Recommended checks before promotion:
helm lint charts/phpmyadmin
helm unittest charts/phpmyadmin
helm template phpmyadmin charts/phpmyadmin -f charts/phpmyadmin/examples/production.yaml
For cluster validation, install into K3D/K3S with a test MySQL/MariaDB target and check pods, logs, events, Service endpoints, Ingress or Gateway route, and ExternalSecret reconciliation when ESO is enabled.
Security Scan: phpmyadmin
| Framework | Score |
|---|---|
| MITRE + NSA + SOC2 | 75.757576% |
Security posture: acceptable.
References
Deploy phpmyadmin with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has phpmyadmin 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 chartphpmyadmin is pinned at v2.2.1 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