Skip to content

feat(common): default serviceDiscovery to internal view + tls-skip-verify - #1747

Merged
guimoreirar merged 1 commit into
mainfrom
feat/lerian-common-sd-defaults
Jul 24, 2026
Merged

feat(common): default serviceDiscovery to internal view + tls-skip-verify#1747
guimoreirar merged 1 commit into
mainfrom
feat/lerian-common-sd-defaults

Conversation

@guimoreirar

Copy link
Copy Markdown
Member

Makes the platform-standard SD defaults the built-in defaults of lerian-common.serviceDiscovery.env, so environments do not have to set them in every global.serviceDiscovery:

  • SD_PREFER_VIEW: externalinternal (in-cluster consumers prefer the internal K8s DNS view)
  • SD_TLS_SKIP_VERIFY: falsetrue

SD_TLS (false), SD_INTERNAL_SCHEME (http), SD_EXTERNAL_PORT (443) unchanged.

Only affects the fallback when global.serviceDiscovery.<field> is unset. Environments that set them explicitly (benedita dev-st sets both) are unchanged. serviceDiscovery.env has no merged consumer yet (midaz is the first), so no render regression.

Verified: with only global.serviceDiscovery.address set, the block now renders SD_PREFER_VIEW: "internal" + SD_TLS_SKIP_VERIFY: "true". strict: 0 violations.

…rify

Make the platform-standard SD defaults the built-in defaults of
serviceDiscovery.env so environments do not have to set them per-env:
- SD_PREFER_VIEW default external -> internal (in-cluster consumers prefer
  the internal K8s DNS view)
- SD_TLS_SKIP_VERIFY default false -> true

Only affects the fallback when global.serviceDiscovery does not set the
field; environments that set it explicitly (e.g. benedita) are unchanged.
No merged consumer of serviceDiscovery.env yet, so no render regression.
@guimoreirar
guimoreirar requested a review from a team as a code owner July 24, 2026 21:50
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The service-discovery environment helper now defaults SD_TLS_SKIP_VERIFY to true and SD_PREFER_VIEW to "internal". SD_WORKLOAD continues to default to an empty string.

Changes

Service discovery defaults

Layer / File(s) Summary
Derived environment defaults
charts/lerian-common/templates/_service_discovery.tpl
The helper changes the default values for SD_TLS_SKIP_VERIFY and SD_PREFER_VIEW, while retaining the existing SD_WORKLOAD default.

Possibly related PRs

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/lerian-common-sd-defaults

Comment @coderabbitai help to get the list of available commands.

guimoreirar added a commit that referenced this pull request Jul 24, 2026
…onfigmap)

Replace the flat SD_* passthrough with lerian-common.serviceDiscovery.env:
- enable per-app via ledger/crm.serviceDiscovery.enabled (SD_ENABLED emitted
  from the param); no SD_* in configmap (stays {} — clean).
- env-wide server config derived from global.serviceDiscovery; internal DNS
  and external https:// endpoints derived from the chart service + ingress.
- INERT when disabled or global.serviceDiscovery unset → backward-compatible
  (benedita keeps driving SD via extraEnvVars until it migrates).

Depends on #1747 for the internal/tls-skip-verify platform defaults.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charts/lerian-common/templates/_service_discovery.tpl`:
- Line 56: Update the SD_TLS_SKIP_VERIFY rendering in the service-discovery
template to preserve an explicitly configured false value. Replace the
default-based expression with a presence-aware lookup using the existing
service-discovery TLS configuration, while retaining true only when the setting
is absent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5cee1c42-987a-499c-b0aa-98bb77a92cab

📥 Commits

Reviewing files that changed from the base of the PR and between 947fa64 and b80ab83.

📒 Files selected for processing (1)
  • charts/lerian-common/templates/_service_discovery.tpl

Comment thread charts/lerian-common/templates/_service_discovery.tpl
@guimoreirar
guimoreirar merged commit 102366a into main Jul 24, 2026
4 checks passed
@guimoreirar
guimoreirar deleted the feat/lerian-common-sd-defaults branch July 24, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant