Install remote Knative components in canonical namespaces - #2349
Install remote Knative components in canonical namespaces#2349kahirokunn wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kahirokunn The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2349 +/- ##
==========================================
+ Coverage 65.84% 65.95% +0.11%
==========================================
Files 56 56
Lines 2673 2682 +9
==========================================
+ Hits 1760 1769 +9
Misses 777 777
Partials 136 136 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I plan to implement a separate validation rule to prevent the creation of more than one KnativeServing or KnativeEventing instance per cluster. |
a1af5ee to
fe54616
Compare
|
@dsimansk Hi ✋ PTAL. Thank you 🙏 |
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
fe54616 to
7ce0e6f
Compare
Fixes #2345
Proposed Changes
KnativeServingandKnativeEventingcomponents in their canonical spoke namespaces regardless of the hub management CR namespace.Design
The component kind determines the remote installation namespace:
KnativeServingknative-servingKnativeEventingknative-eventingLocal installations without
spec.clusterProfileRefcontinue to use the management CRmetadata.namespace.Verification Steps
E2E verification with Kind
Verified manually with three Kind clusters (
hub,cluster1, andcluster2), OCM-managedClusterProfileobjects, the managed-serviceaccount credential syncer,cp-creds, and Envoy Gateway.1. Set up OCM and ClusterProfile access
OCM was initialized on
hubwith ClusterProfile support.cluster1andcluster2were joined, accepted, assigned to thesandbox-fleetManagedClusterSet, and bound to theknative-operatornamespace. Both managed clusters reportedJoined=TrueandAvailable=True; both ClusterProfiles reportedControlPlaneHealthy=TrueandJoined=True.The managed-serviceaccount credential syncer and the cluster-proxy user server were enabled:
The
knative-operatorManagedServiceAccount was created for each spoke and labeled for ClusterProfile credential synchronization. The corresponding spoke service accounts were bound tocluster-adminfor this installation test. The resultingcluster1-knative-operatorandcluster2-knative-operatorcredentials appeared in the hub'sknative-operatornamespace, and both ClusterProfiles advertised theopen-cluster-managementaccess provider.2. Configure the operator to use cp-creds
The operator mounted
quay.io/open-cluster-management/cp-creds:latestat/access-plugins/cp-credsand used this provider configuration:{ "providers": [ { "name": "open-cluster-management", "execConfig": { "apiVersion": "client.authentication.k8s.io/v1", "command": "/access-plugins/cp-creds/cp-creds", "args": ["--managed-serviceaccount=knative-operator"], "provideClusterInfo": true, "interactiveMode": "Never" } } ] }3. Build and deploy this PR head
PATH="$(go env GOPATH)/bin:$PATH" \ KO_DOCKER_REPO=kind.local \ KIND_CLUSTER_NAME=hub \ ko apply -f config/ kubectl --context kind-hub -n knative-operator \ rollout status deployment/knative-operator --timeout=180sBoth referenced ClusterProfiles resolved through the configured
cp-credsprovider.4. Configure the Serving data plane on cluster1
Gateway API v1.4.1 experimental CRDs and Envoy Gateway v1.7.1 were installed on
cluster1with the GatewayNamespace deployment model. The following data-plane resources were configured:eg-external/eg-externaleg-external/knative-externaleg-internal/eg-internaleg-internal/knative-internalBoth GatewayClasses reported
Accepted=True; the internal Gateway reportedProgrammed=True. Because this local environment did not expose a LoadBalancer address, external traffic was verified through the external Envoy Service's NodePort on the Kind Docker network.5. Deploy Serving and Eventing from non-canonical hub namespaces
The management CR namespaces intentionally differed from the remote installation namespaces:
Both hub CRs reached
TargetClusterResolved=TrueandReady=True. All seven Serving Deployments became Available only incluster1/knative-serving; Knative Eventing reachedReady=Truewith its controller, webhook, and broker Deployments only incluster2/knative-eventing. No Knative Deployments appeared in either hub management namespace or on the wrong spoke.The remote anchors were created as
knativeserving-ocm-serving-root-ownerandknativeeventing-ocm-eventing-root-owner, and managed resources referenced the matching anchor.6. Verify Serving traffic
Observed response:
The external and cluster-local HTTPRoutes both reported
Accepted=TrueandResolvedRefs=True.7. Verify cleanup and recreation
Both management CRs were deleted:
Both CRs completed finalization. Their anchors and all anchor-owned Deployments were removed from
cluster1/knative-servingandcluster2/knative-eventing. After recreating the same management CRs, both returned toTargetClusterResolved=TrueandReady=True, and the Serving request returned the same response again.Upgrade note
Remote installations created before this change used the management CR namespace on the spoke. If an existing remote installation is not already in its canonical namespace:
The recreated installation is placed in
knative-servingorknative-eventing. No migration is required when the existing remote installation already uses its canonical namespace.Release Note