hierarchical-namespaces icon indicating copy to clipboard operation
hierarchical-namespaces copied to clipboard

Convert a full namespace to a subns and to be children of another subns

Open weilaaa opened this issue 2 years ago • 7 comments

I noticed that full namespaces can be children of subnamespaces by doing kubectl hns set staging --parent service-4, so if we need a way to convert a full namespace to a subnamespace and to be children of another subnamespace. just like:

team-a
├── [s] service-2
└── [s] service-4
     └── [s] staging

Why we need it? In some scenarios, our cluster already have a lot of full namespaces, and then we wanna take over them by subnamespaces way.

weilaaa avatar Apr 07 '22 07:04 weilaaa

I read codes and had a try that by two steps, I can take over full namespace as a subnamespace manually.

  1. add annotations to full namespaces ns-1, example: hnc.x-k8s.io/subnamespace-of: team-a
  2. create subnamespaceanchor with same name: kubectl hns create ns-1 -n team-a

That works, so if we will do it in crd of command line?

weilaaa avatar Apr 07 '22 07:04 weilaaa

Yes, that's the right way to solve this problem. Are you asking for a change in behaviour? And why are you trying to convert a full namespace into a subnamespace? Thanks!

On Thu, Apr 7, 2022 at 3:11 AM weilaaa @.***> wrote:

I read codes and had a try that by two steps, I can take over full namespace as a subnamespace manually.

  1. add annotations to full namespaces ns-1, example: hnc.x-k8s.io/subnamespace-of: team-a
  2. create subnamespaceanchor with same name: kubectl hns create ns-1 -n team-a

— Reply to this email directly, view it on GitHub https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/191#issuecomment-1091159228, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE43PZBG352NUV66XMCWEZDVD2DA7ANCNFSM5SYLHODQ . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

adrianludwin avatar Apr 07 '22 16:04 adrianludwin

Yep, I'm asking for a behavior change. As I said in Why we need it, assumed that our k8s cluster already had a lot of full namespaces, and I want to take over them by subnamespaces way, cause I want the features of subnamespaces-deep-dive rather than using simple HierarchyConfiguration.

weilaaa avatar Apr 18 '22 02:04 weilaaa

I'm willing to have a try if you think it alright.

weilaaa avatar Apr 18 '22 02:04 weilaaa

Sorry, I'm not sure I understand. What change in behaviour are you asking for HNC to do? Or does everything work if you follow your two steps?

We're thinking about making a change to always set the annotation on all namespaces in HNC v1.1, but we're not sure yet and we won't backport that to HNC v1.1. So then all you would have to do would be to create the anchor.

adrianludwin avatar Apr 19 '22 15:04 adrianludwin

Thanks for u answers. Everything works follow twos steps. By the way, can you easily reveal when the HA will be stable?

weilaaa avatar Apr 23 '22 15:04 weilaaa

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jul 22 '22 16:07 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Aug 21 '22 17:08 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Sep 20 '22 17:09 k8s-triage-robot

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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/test-infra repository.

k8s-ci-robot avatar Sep 20 '22 17:09 k8s-ci-robot

I think that in v1.1 (probably out in a month or two) we'll upgrade it to "beta," which means that we think it should work but there might still be some bugs or instability.

On Sat, Apr 23, 2022 at 11:14 AM weilaaa @.***> wrote:

Thanks for u answers. Everything works follow twos steps. By the way, can you easily reveal when the HA will be stable?

— Reply to this email directly, view it on GitHub https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/191#issuecomment-1107518945, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE43PZDIPHIS2LR3URLYXWLVGQHU3ANCNFSM5SYLHODQ . You are receiving this because you commented.Message ID: @.***>

adrianludwin avatar Oct 11 '22 07:10 adrianludwin