Skip to content
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

refactor(core): more renames to not overlap with original Kubevirt and CDI #156

Conversation

diafour
Copy link
Member

@diafour diafour commented Jun 25, 2024

Description

  • Rewrite app.kubernetes.io/managed-by labels value
  • Rewrite names for validatingwebhooks, mutatingwebhooks in Kubevirt.
  • Add deduplication and anti-shadowing algorithms: delete original resources from discovery and CRD list, prefix original labels on restore, un-prefix on rename.
  • Rename devices on nodes and change device plugin socket path, so virt-handlers can live together.
  • Remove upload.cdi.kubevirt.io ApiService.

Why do we need it, and what problem does it solve?

DVP can work together with original CDI and KubeVirt in the same cluster.

What is the expected result?

Working scenarios:

Install original cdi+kubevirt along with DVP

  1. Ensure DVP is installed
  2. Install CDI and KubeVirt, enable LiveMigration in Kubevirt CR.
  3. Launch VM in DVP and in original KubeVirt. Ensure PVCs are created and both VMs are in the Running state.
  4. Migrate both VMs. Ensure both are migrated.
  5. Uninstall KubeVirt and CDI.
  6. Ensure no cluster resources are left from original CDI and Kubevirt.
  7. Ensure no errors in logs in DVP components.

Install DVP along with original cdi+kubevirt

  1. Ensure original CDI and KubeVirt are installed.
  2. Enable DVP module.
  3. Launch VM in DVP and in original KubeVirt. Ensure PVCs are created and both VMs are in the Running state.
  4. Migrate both VMs. Ensure both are migrated.
  5. Disable DVP module. Ensure deckhouse queue is empty, no d8-virtualization namespace.
  6. Ensure no cluster resources are left from DVP (NodeGroupConfiguration, ClusterRole, internalvirtualization* CRDs etc.). Only 2 CRDs should remain: internalvirtualizationkubevirts and internalvirtualizationcdis.
  7. Ensure no errors in logs in original KubeVirt and CDI.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

@diafour diafour force-pushed the refactor/kube-api-rewriter/more-renames-for-running-original-kubevirt branch 4 times, most recently from 05dc65c to bccdfeb Compare July 2, 2024 11:58
@diafour diafour force-pushed the refactor/kube-api-rewriter/more-renames-for-running-original-kubevirt branch 6 times, most recently from 59d191d to f6d37bb Compare July 11, 2024 16:56
@diafour diafour marked this pull request as ready for review July 11, 2024 16:57
@diafour diafour requested review from hardcoretime and Isteb4k July 11, 2024 19:54
@diafour diafour force-pushed the refactor/kube-api-rewriter/more-renames-for-running-original-kubevirt branch from b538072 to 2c3870d Compare July 16, 2024 11:15
- Rename cluster resources: validatingwebhooks, mutatingwebhooks.
- Rename app.kubernetes.io/managed-by label value.
- Rename devices on nodes, rename unix socket path for Device Plugin API server.
- Remove upload.cdi.kubevirt.io ApiService.
- kube-api-rewriter: Rewrite name and value for labels and annotations.
- kube-api-rewriter: Add Exclude rules to exclude objects from API server.
- kube-api-rewriter: Exclude original CRDs from CRD list, exclude original groups/resources from discovery responses.
- kube-api-rewriter: Preserve original labels with prefix to save them during list-restore-update-rename transformation chain.
- fix CRD patching: patch metadata before patching /spec, fix problem with finalizers on CRDs

Signed-off-by: Ivan Mikheykin <[email protected]>
@diafour diafour force-pushed the refactor/kube-api-rewriter/more-renames-for-running-original-kubevirt branch from 2c3870d to eef924e Compare July 17, 2024 16:36
@universal-itengineer universal-itengineer merged commit 9a4db1a into main Jul 17, 2024
1 check passed
@universal-itengineer universal-itengineer deleted the refactor/kube-api-rewriter/more-renames-for-running-original-kubevirt branch July 17, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants