Conversation
|
Hi @Itx-Psycho0. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi maintainers, I've implemented a fix for issue #3403 that makes the cluster domain configurable in the KEDA deployer. Summary:
The implementation is backward compatible and follows the existing patterns in the codebase. All tests pass and linting is clean. I'd appreciate your review when you have a chance. @lkingland @creydr @matejvasek Thanks! |
|
Is this only keda specific? |
|
@creydr please look at this. |
|
Isn't cluster domain setting of a cluster, not a function? |
wouldnt this also touch on raw k8s deployer? |
|
You're absolutely right on all points. Let me address the concerns: "Is this only KEDA specific?" "Isn't cluster domain setting of a cluster, not a function?" Proposed Better Solution - Auto-detect cluster domain from the cluster's DNS configuration Implementation approach: Should I rework the PR with this approach? I can: Let me know if this direction makes sense! |
|
Here, I had AI do some research and break it down into actionable steps. Beware potential hallucinations may follow: Shared contract (decide first — blocks everything else)
Operator (depends on contract)
CLI core helper
Global config (~/.config/func)
Deployers (consume — depends on CLI helper)
Docs
Suggested PR sequence
|
|
Thanks @Itx-Psycho0. As discussed, the per-function field isn't the right home for a cluster-level setting, so I'm closing this in favour of settling the cluster-config contract on #3403 first. Your tests here will be a good starting point once that's decided. |
|
/reopen |
|
@Itx-Psycho0: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@lkingland The full solution you outlined makes sense: Operator detects cluster domain from /etc/resolv.conf Option 1: Start fresh with PR #1 from your sequence - create the ClusterDomain() helper that just returns "cluster.local" for now, and wire all deployers through it? This would centralize the hardcoded references without changing behavior yet. Option 2: Wait until you and @creydr finalize the CRD contract (cluster-scoped singleton vs namespaced, RBAC grants, exact schema), then start implementing once that's decided? Option 3: Close this PR again and track progress on issue #3403 until the design is settled, then open a new PR series? The tests I added here cover the KEDA deployer part, so those can definitely be reused later. But I don't want to keep this PR open if it's blocking or confusing - happy to close it and work on the proper solution in a new PR once the approach is agreed. Let me know what works best! |
|
Thanks @Itx-Psycho0, that's a good summary. Option 1 with a pinch of Option 3 sounds good to me: A single ClusterDomain() helper which returns cluster.local for now, with the with the two places that hard-code it (pkg/k8s/deployer.go and pkg/keda/deployer.go) updated. That gives us no behavior change, and we can plug in the full path when it becomes avaiailable. The flag, the user config and the operator lookup once the question on #3403 is settled. |
The raw Kubernetes deployer (Trigger subscriber host) and the KEDA
deployer (interceptor bridge ExternalName) each hard-coded
"cluster.local" when building <name>.<namespace>.svc.<domain>
addresses.
Add k8s.ClusterDomain(), which returns DefaultClusterDomain
("cluster.local") for now, and use it in both places. There is no
behavior change. Resolving the domain from a flag, the user config or
the operator can be added inside the helper once the contract on
knative#3403 is settled, without touching the deployers again.
Tests cover the helper's default and check that both call sites build
their address from ClusterDomain().
Refs knative#3403
Signed-off-by: Itx-Psycho0 <anuragh3re@gmail.com>
4407fe7 to
f18b405
Compare
|
@lkingland Thanks! I've updated this PR to match what you described: Added There is no behavior change, and the branch is rebased on current main. The flag, the user config and the operator lookup can be added inside the helper once #3403 is settled. |
|
Thanks @Itx-Psycho0, looks good to me. Assuming the tests pass: /remove-lifecycle frozen |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Itx-Psycho0, lkingland The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What
This is the first step toward #3403, as agreed in #3682 (comment) (Option 1 with a bit of Option 3).
k8s.ClusterDomain()(pkg/k8s/cluster_domain.go). It returnsDefaultClusterDomain(cluster.local) for now.cluster.local:pkg/k8s/deployer.go: Trigger subscriber hostpkg/keda/deployer.go: interceptor bridge ServiceExternalNameThere is no behavior change. The flag, the per-context user config and the operator lookup can go inside the helper once the contract on #3403 is settled, without touching the deployers again.
The earlier per-function
deploy.clusterDomainfield is gone.The two remaining
cluster.localstrings are intentional:pkg/cluster/kubernetes.goconfigures the local dev cluster func creates (its domain is fixed), andpkg/pipelines/tekton/templates.goonly mentions it in a comment.Tests
TestClusterDomain: the helper returnscluster.local.TestSyncTriggers_SubscriberUsesClusterDomain: the created Trigger's subscriber host is<fn>.<ns>.svc.+ClusterDomain().Test_interceptorBridgeService_usesClusterDomain: the bridgeExternalNameis<interceptor>.<ns>.svc.+ClusterDomain().I checked that the call-site tests really go through the helper by making it return a different domain temporarily. Both call-site tests still passed and only
TestClusterDomainfailed.make checkis clean, and the unit tests pass forpkg/k8s,pkg/keda,pkg/deployerandpkg/knative.Refs #3403