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

Handle namespace mapping #54

Closed
sseago opened this issue Nov 16, 2021 · 4 comments
Closed

Handle namespace mapping #54

sseago opened this issue Nov 16, 2021 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/blocker Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@sseago
Copy link
Contributor

sseago commented Nov 16, 2021

One feature that we have in the prior generation of Crane/MTC tools is the ability to migrate a workload to a different namespace on the destination cluster. We need something similar in the new crane workflow. There are a few things that we do in MTC via velero and plugins that we'd need to do here as well. This could all be done relatively easily as a crane plugin. It may be possible to do it via something like kustomize as well, but it would probably be more challenging to do it there, so for the moment I'd recommend a plugin for this.

Here are the things that we're currently dealing with that we also need this plugin (or other implementation) to handle:

  1. Modify metadata.namespace if the current namespace is in the mapping.
  2. For RoleBindings, subjects, usernames, and groups need to be modified if they reference namespaces that are being remapped
  3. For BuildConfigs, imagestream/imagestreamtag references need to be modified if they reference namespaces that are being remapped

Here are some cases which we have in velero plugins that deal with namespace swaps that we probably don't need here:

  1. image references (in pods, pod templates, etc.) that reference an internal image or istag within the image path -- this is already handled by the registry-replacement arg in the kubernetes plugin.
  2. The velero plugin actions for sccs and cluster role bindings -- crane is excluding cluster-scoped resources from scope, so we won't need this here either.
@djzager djzager added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 18, 2022
@eriknelson
Copy link
Contributor

We currently have a good idea how this should be accomplished, and it's using Kustomize to layer back in cluster specific details such as the target namespace. We have some examples of this in the crane-runner scenarios for crane cli. For RHO, I want to make sure that this works as we expect: The workload should migrate into the contextually active namespace that I'm running the wizard from, and the pipeline should handle that.

@eriknelson
Copy link
Contributor

/kind bug
/priority blocker
/triage accepted

@openshift-ci openshift-ci bot added kind/bug Categorizes issue or PR as related to a bug. priority/blocker Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Jun 24, 2022
@github-actions
Copy link

This issue synced with: https://issues.redhat.com/browse/MTRHO-66

@eriknelson eriknelson removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 24, 2022
@djzager
Copy link
Contributor

djzager commented Jun 30, 2022

Described how to accomplish this in the stateless application mirror example https://crane-docs.konveyor.io/content/examples/stateless-app-mirror/#apply-manifests-to-destination-cluster

@djzager djzager closed this as completed Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/blocker Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants