-
Notifications
You must be signed in to change notification settings - Fork 23
HYPERFLEET-1146 - docs: update development env configuration #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ldornele
wants to merge
3
commits into
openshift-hyperfleet:main
Choose a base branch
from
ldornele:HYPERFLEET-1146
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,20 @@ For running the binary directly on your machine (development, debugging), see th | |
|
|
||
| --- | ||
|
|
||
| ## ⚠️ Production Security Warning | ||
|
|
||
| **IMPORTANT**: Default Helm values are for development. Production requires: | ||
|
|
||
| | Setting | Default | Production | Risk if not changed | | ||
| |---------|---------|------------|---------------------| | ||
| | JWT auth | `false` | `true` | ⚠️ Unauthenticated access | | ||
| | TLS | `false` | `true` | ⚠️ Plaintext credentials | | ||
| | Database | Built-in pod | External managed | Data loss on restart | | ||
|
|
||
| See [API Operator Guide](api-operator-guide.md) for complete production configuration. | ||
|
|
||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before deploying, ensure you have: | ||
|
|
@@ -274,6 +288,36 @@ During upgrade, in case schema changes have occurred in the new version, a DB mi | |
| helm uninstall hyperfleet-api --namespace hyperfleet-system | ||
| ``` | ||
|
|
||
| ## Helm Values | ||
|
|
||
| ### Key Configuration Options | ||
|
|
||
| | Parameter | Description | Default | | ||
| |-----------|-------------|---------| | ||
| | `image.registry` | Container registry | `CHANGE_ME` (must be set explicitly) | | ||
| | `image.repository` | Image repository | `openshift-hyperfleet/hyperfleet-api` | | ||
| | `image.tag` | Image tag | `latest` | | ||
| | `image.pullPolicy` | Image pull policy | `Always` | | ||
| | `config.adapters.required.cluster` | Cluster adapters required for Ready state | `[]` | | ||
| | `config.adapters.required.nodepool` | Nodepool adapters required for Ready state | `[]` | | ||
| | `config.server.jwt.enabled` | Enable JWT authentication | `false` (Helm default; app default is `true`) | | ||
| | `config.server.tls.enabled` | Enable TLS on the API listener | `false` | | ||
| | `config.database.ssl.mode` | SSL mode for database connection | `disable` | | ||
| | `database.postgresql.enabled` | Enable built-in PostgreSQL | `true` | | ||
| | `database.external.enabled` | Use external database | `false` | | ||
| | `database.external.secretName` | Secret containing database credentials | `hyperfleet-db-external` | | ||
| | `serviceMonitor.enabled` | Enable Prometheus Operator ServiceMonitor | `false` | | ||
| | `serviceMonitor.interval` | Metrics scrape interval | `30s` | | ||
| | `serviceMonitor.scrapeTimeout` | Metrics scrape timeout | `10s` | | ||
| | `serviceMonitor.labels` | Additional labels for Prometheus selector | `{}` | | ||
| | `serviceMonitor.namespace` | Namespace for ServiceMonitor (if different) | `""` | | ||
| | `replicaCount` | Number of API replicas | `1` | | ||
| | `resources.limits.cpu` | CPU limit | `500m` | | ||
| | `resources.limits.memory` | Memory limit | `512Mi` | | ||
| | `podDisruptionBudget.enabled` | Enable PodDisruptionBudget | `false` | | ||
| | `podDisruptionBudget.minAvailable` | Minimum available pods during disruption | `1` | | ||
| | `podDisruptionBudget.maxUnavailable` | Maximum unavailable pods during disruption | - | | ||
|
|
||
| ### Custom Values File | ||
|
|
||
| For repeatable deployments, create a `values.yaml` file: | ||
|
|
@@ -450,6 +494,20 @@ Before deploying to production, ensure: | |
| - [ ] **Disruption**: PodDisruptionBudget enabled (`podDisruptionBudget.enabled=true`) | ||
| - [ ] **Monitoring**: ServiceMonitor enabled if using Prometheus Operator | ||
|
|
||
| ## Production Best Practices | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can also add:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. Included logging format (JSON), log level (info), tracing enablement, and identity extraction to Production Best Practices. |
||
|
|
||
| - **Environment**: Use default (ProductionEnv) for production deployments; never set `HYPERFLEET_ENV=development` | ||
| - **Database**: Use external managed database (Cloud SQL, RDS, Azure Database) with automated backups | ||
| - **Secrets**: Store all sensitive data in Kubernetes Secrets, never in ConfigMap or values.yaml | ||
| - **Authentication**: Enable JWT authentication with `config.server.jwt.enabled=true` | ||
| - **Identity**: Enable identity extraction based on JWT claims or HTTP headers as appropriate | ||
| - **Logging**: Use JSON format (`config.logging.format=json`) and set level to `info` for production | ||
| - **Tracing**: Enable distributed tracing for observability in production environments | ||
| - **Resources**: Set CPU/memory limits and use multiple replicas for high availability | ||
| - **Images**: Use specific image tags (semantic versioning) instead of `latest` | ||
| - **Disruption**: Enable PodDisruptionBudget for zero-downtime during cluster maintenance | ||
| - **Health**: Configure health probes with appropriate timeouts for your workload | ||
|
|
||
| ### Configuration File Security | ||
|
|
||
| The configuration file path — set via `--config` or `HYPERFLEET_CONFIG` — is a trust boundary. The API validates configuration **content** on startup (unknown fields are rejected, required values are enforced, TLS/JWT/timeout settings are checked) and will refuse to start with an invalid configuration. However, **path and permission safety is the operator's responsibility**. The API reads whatever file the process can access at the given path without checking permissions or ownership. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning
Blocking
Category: Inconsistency
The "Key Configuration Options" table includes
config.server.jwt.enabledbut omitsconfig.server.tls.enabledandconfig.database.ssl.mode, even though the Production Security Warning table at the top of this file highlights all three as critical production settings. Someone using this table as a reference for production config would miss two of the three security-critical values.Suggested additions after the JWT row:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! I have added
config.server.tls.enabledandconfig.database.ssl.modeto the Key Configuration Options table, as suggested.