feat: add Gateway API HTTPRoute support & existing secret for DB credentials#70
Open
aagarwal-apexanalytix wants to merge 3 commits intogravitl:masterfrom
Open
Conversation
Add native support for Kubernetes Gateway API HTTPRoutes as an alternative (or complement) to traditional Ingress resources. New values: - gateway.enabled: toggle HTTPRoute generation (default: false) - gateway.annotations: optional annotations for HTTPRoute resources - gateway.parentRefs: list of parent Gateway references Creates three HTTPRoute resources (broker, api, dashboard) that derive hostnames from the existing ingress.hostPrefix.* + baseDomain values. Both ingress.enabled and gateway.enabled are independent flags and can coexist, allowing gradual migration from Ingress to Gateway API.
Most production PostgreSQL deployments enforce SSL. Changing the default from disable to require ensures secure connections out of the box.
Allow the chart to pull SQL_HOST, SQL_PORT, SQL_USER, SQL_PASS, and SQL_DB from an existing Kubernetes secret (e.g. CrunchyData pguser secret) instead of hardcoding them in the ConfigMap. This avoids duplicating credentials that are already managed by a PostgreSQL operator. When db.existingSecret.enabled is true, the five SQL_* keys are omitted from the ConfigMap and injected as env vars with secretKeyRef on both the netmaker StatefulSet and the MQ Deployment. Key mappings default to CrunchyData's pguser secret format but are fully configurable. Also reverts db.sslmode default to "disable" to match upstream.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
db.existingSecretsupport to pull DB credentials from an existing Kubernetes secret (e.g. CrunchyData pguser secret) instead of hardcoding them in the ConfigMapdb.sslmodedefault todisableto match upstreamChanges
1. Gateway API HTTPRoute support
values.yamlgatewaysection (disabled by default) withenabled,annotations, andparentRefsfieldstemplates/httproute.yamlgateway.networking.k8s.io/v1HTTPRoute resourcesNew values:
ingress.enabledandgateway.enabledare fully independent — both can be true for migration scenariosingress.hostPrefix.{broker,rest,ui}+baseDomaingateway.enabled: falsemeans existing deployments are unaffected2. Existing Kubernetes secret for DB credentials
values.yamldb.existingSecretblock withenabled,name, andkeyssub-fields; reverteddb.sslmodedefault todisabletemplates/configmap.ymlSQL_HOST/SQL_PORT/SQL_DB/SQL_USER/SQL_PASSwhenexistingSecret.enabledis true (SQL_SSL_MODEalways stays)templates/netmaker-statefulset.yamlenventries withsecretKeyRefthat override ConfigMap valuestemplates/mq.yamlenvblock for the MQ deploymentNew values:
existingSecret.enabledis false (default), behavior is identical to beforeenvFromfirst, thenenventries override, so the secret values take precedence over any ConfigMap valuesTest plan
helm template test .with defaults — ConfigMap has all SQL_* keys, no secretKeyRef, no HTTPRouteshelm template test . --set gateway.enabled=true --set 'gateway.parentRefs[0].name=my-gw'— verify 3 HTTPRoute resourceshelm template test . --set db.existingSecret.enabled=true --set db.existingSecret.name=postgres-pguser-usrnetmaker— ConfigMap omits SQL creds, both StatefulSet and MQ Deployment have secretKeyRef entrieshelm template test . --set db.existingSecret.enabled=true --set db.existingSecret.name=my-secret --set db.existingSecret.keys.host=my-host-key— verify custom key mappings work