feat: create developer-portal-fe helm chart#266
Conversation
|
|
- Created independent Helm chart for API7 Developer Portal Frontend - Added Chart.yaml with postgresql dependency (v12.12.10) - Created comprehensive values.yaml with all configuration options - Implemented templates following existing chart conventions: - _helpers.tpl with standard helper functions - secret.yaml for sensitive data (portal token, auth secret, db url) - configmap.yaml with config.yaml using env var placeholders - deployment.yaml with health probes and resource management - service.yaml for ClusterIP/NodePort/LoadBalancer - ingress.yaml with multi-version K8s support - serviceaccount.yaml for RBAC - NOTES.txt with installation instructions - Added .helmignore for package management - Created comprehensive README.md with parameters and examples - Chart passes helm lint validation - Chart templates render successfully with test values Co-authored-by: gxthrj <4413028+gxthrj@users.noreply.github.com> Agent-Logs-Url: https://github.com/api7/api7-helm-chart/sessions/1ade7860-9784-4049-8ea0-2fbcd795c1c1
Deployment Test Results (kind cluster, api7 namespace)Environment
Results
Issues Found1. 🔴 CRITICAL: Health check path
|
1. Change health check path from /healthz to / (configurable via values)
- The portal-fe app (v0.5.7) does not have a /healthz endpoint
- /healthz returns 404, causing liveness probe failures and pod restarts
- Root path / returns 200 and serves as a valid health check
2. Remove PostgreSQL image override (docker.io/postgres:16)
- The bitnami/postgresql subchart expects bitnami's own image
- Using the official postgres image with bitnami chart scripts is
not officially supported and may break with advanced features
- Let the subchart use its default bitnami/postgresql image
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Re-validation After FixesFixes pushed in commit 887a7a6. Re-deployed the chart on the same kind cluster. Results
Pod StatusNote: The 6 restarts were from the initial deployment before the bitnami PostgreSQL image was loaded into the kind cluster. Once PG was available, the FE pod started successfully and has been stable since. Fixes Applied
|
Previously, setting portal.existingSecret would skip creating the entire chart-managed secret, breaking DB_URL and AUTH_SECRET env vars unless they also had their own existingSecret configured. Now each secret field (portal.existingSecret, db.existingSecret, auth.existingSecret) is independently evaluated: - The chart secret is created if ANY of the three need it - Only keys without an existingSecret override are included - Each env var in the deployment references its own existingSecret or falls back to the chart-managed secret independently Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nic-6443
left a comment
There was a problem hiding this comment.
Code Review
Bugs Fixed (pushed to branch)
I found and fixed 3 issues during deployment testing:
-
🔴 Health probe path
/healthzdoesn't exist (commit887a7a6)- The app has no
/healthzroute — returns 404, causing liveness probe failures - Changed to
/(configurable viavalues.yaml)
- The app has no
-
🟡 PostgreSQL image override incompatible with bitnami chart (commit
887a7a6)docker.io/postgres:16works by coincidence but is not the intended image for the bitnami subchart- Removed override; bitnami chart now uses its default image
-
🔴 Secret management:
portal.existingSecretbreaks DB and auth secrets (commit6d0b6c6)- Setting
portal.existingSecretskipped creating the entire chart-managed secret DB_URLandAUTH_SECRETenv vars would reference a non-existent secret- Fixed: each
existingSecret(portal, db, auth) is now evaluated independently
- Setting
Convention Issues (non-blocking, for future consideration)
Compared with the existing api7 umbrella chart and gateway chart conventions:
| # | Severity | Issue |
|---|---|---|
| 1 | Medium | values.yaml uses camelCase (developerPortal) while api7 chart uses snake_case (developer_portal). Consider aligning. |
| 2 | Medium | service and ingress are separate top-level keys. api7 chart nests ingress under the service key (e.g., developer_portal_service.ingress). |
| 3 | Low | Config is fragmented across portal, db, auth, app top-level keys. api7 chart uses a single developer_portal_configuration block that's dumped into the ConfigMap. The new approach gives better UX but diverges from convention. |
| 4 | Low | Image pullPolicy defaults to IfNotPresent (api7 defaults to Always). May be intentional. |
What Looks Good ✅
- Template structure (_helpers.tpl, labels, selectors) follows api7 conventions well
- Independent
existingSecretsupport (after fix) is a nice improvement - ConfigMap env var placeholder approach (
${PORTAL_TOKEN}) is clean - Extra env vars/volumes/mounts support provides good extensibility
- Checksum annotations on deployment trigger rolling updates on config changes
- Ingress template handles multiple k8s API versions correctly
Override bitnami's default postgresql image with api7/postgresql:15.4.0-debian-11-r45, matching the same image used by the api7 umbrella chart. This ensures consistency and avoids pulling bitnami's default image which may be unavailable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements a standalone Helm chart for the API7 Developer Portal Frontend (Next.js app), separating it from the api7 umbrella chart. The frontend has its own PostgreSQL database for Better Auth user management and connects to the existing Portal API backend via URL + token.
Chart Structure
developer-portal-fev0.1.0 (appVersion 0.5.7) with PostgreSQL 12.12.10 dependencyConfiguration Strategy
Environment variables injected via Kubernetes Secrets, referenced in config.yaml using
${VAR}placeholders:Key Features
existingSecretreferences for portal token, DB URL, and auth secrettlsRejectUnauthorizedflag for development with self-signed certificates/(configurable) with configurable delaysArchitecture
Fixes Applied (post initial PR)
/healthzto/— the portal-fe app has no/healthzendpointdocker.io/postgres:16, using bitnami default imageexistingSecretsupport — previously settingportal.existingSecretwould break DB and auth secret refsDeployment Verified
Chart deployed and validated on a kind cluster with API7 EE v3.9.7. All components running successfully.