Apps declare volumes: name:/path[:ro] (mounts: still accepted). The gateway
binds /srv/zero-scale-volumes/<app>/<name> into the unit, running it as a
fixed zs-<app> dynamic user so ownership is stable. gateway install creates
zero-scale-volumes-pvc; delete-app --purge --delete-volumes removes the data.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uKdmp7tLySXvQXALz2x9V
- gateway install/upgrade renders an HA gateway (2 replicas, RollingUpdate,
PDB, hostname spread, downward-API namespace, RWX /opt/apps on the platform
class); a Helm-managed gateway is recorded and left alone
- gateway status shows which apps run on which replica
- ingress add-host/remove-host/list: one Ingress per host or wildcard, TLS
from a Secret or a cert-manager ClusterIssuer (wildcards require DNS-01),
upstream-hash-by $host pinning; hosts stored in the platform ConfigMap
- apply skips the per-app Ingress when routed hosts already cover the app
in the gateway's namespace and no OAuth is used; per-app Ingresses also pin
by host
- status, logs and binary updates reach every gateway replica
- delete-app --purge [--drop-database]; Postgres drops only databases whose
owner comment matches; apply records database_engine for later cleanup
- internal/appname: one naming rule (first label, lowercased, [a-z0-9] only)
- internal/registry: host -> app cache built from zero-scale-app ConfigMaps
(hosts key), with direct and legacy-name fallbacks and a 10s TTL
- gateway: units, binaries and config keyed by the app's canonical host, so
secondary hostnames share one process and one config
- reaper reads app config from the registry instead of the API every tick
- zero-scale-ctl writes a hosts key and uses the shared naming rule
- Introduced GatewayConfig struct to hold OAuth2 configuration in AppConfig.
- Implemented OAuthSetupName method to resolve shared OAuth2 profile name.
- Enhanced LoadConfig function to parse gateway configuration from the config file.
- Added oauth-setup command to create or update shared ingress-nginx OAuth2 setup profiles.
- Implemented ReconcileOAuthSetup function to provision/update OAuth2 credentials and resources.
- Created OAuth2 proxy deployment and service for shared OAuth2 setup.
- Added Ingress configuration for OAuth2 callback routing.
- Updated DeployBinary function to check and upload binaries based on SHA256 hash.
- Enhanced secret management in ProvisionDataLayer to support cross-service references.
- Updated ingress creation to support OAuth2 authentication.
- Implemented `database.go` for MySQL and PostgreSQL provisioning, including password generation and secret management.
- Created `k8s.go` for Kubernetes command execution, resource checks, and secret/configmap management.
- Developed `main.go` to handle CLI commands for applying configurations, checking status, logging, and managing applications.
- Added `storage.go` for binary deployment to the gateway pod and symlink configuration for application entrypoints.
- Enhanced CLI with commands for application management, including listing, deleting, and uploading binaries.