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

[BUG] Steve API does not expose information required to edit imported cluster #43191

Open
eva-vashkevich opened this issue Oct 17, 2023 · 11 comments
Assignees
Labels
area/import-k3s Imported K3s Clusters area/import-rke2 Imported RKE2 Clusters area/imported-cluster JIRA To be used in correspondence with the internal ticketing system. kind/bug Issues that are defects reported by users or that we know have reached a real release priority/1 status/ui-blocked team/hostbusters The team that is responsible for provisioning/managing downstream clusters + K8s version support
Milestone

Comments

@eva-vashkevich
Copy link
Member

Rancher Server Setup

  • Rancher version: v2.8-6cd32b985f0b39ef2eed363458f86a352c67a42b-head
  • Installation option (Docker install/Helm Chart):
    • If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc): v1.26.9+rke2r1
  • Proxy/Cert Details: self-signed

Information about the Cluster

  • Kubernetes version: any
  • Cluster Type (Local/Downstream):
    • If downstream, what type of cluster? (Custom/Imported or specify provider for Hosted/Infrastructure Provider): imported

User Information

  • What is the role of the user logged in? (Admin/Cluster Owner/Cluster Member/Project Owner/Project Member/Custom)
    • If custom, define the set of permissions: admin

Describe the bug

Steve API doesn't expose all the fields that are available to edit via Norman cluster object:

  • agentEnvVars
  • k3sConfig
  • enableNetworkPolicy
  • upgradeStartegy

To Reproduce

  1. Create K3s or RKE2 cluster
  2. Import created cluster
  3. View the provisioning cluster in the API UI

Result
Fields required to edit cluster are missing.

Expected Result

Fields required to edit cluster should be present.

Screenshots

Screenshot 2023-10-17 at 12 38 19 PM Screenshot 2023-10-17 at 12 37 33 PM

Additional context

Per rancher/dashboard#9563 (comment) UI wants to create and edit imported cluster using Steve, but it is not currently possible.

@gaktive gaktive added the JIRA To be used in correspondence with the internal ticketing system. label Nov 28, 2023
@gaktive
Copy link
Member

gaktive commented Nov 28, 2023

Internal reference: SURE-6536

@MbolotSuse
Copy link
Contributor

To level-set expectations before a more detailed explanation, this does not appear to be a bug or have anything to do with steve.

Rancher has several different cluster types - provisioning.cattle.io clusters are the newer v2 provisioning clusters. The clusters created by the use of the /v3/clusters endpoint are not provisioning.cattle.io clusters - they are management.cattle.io clusters. You can access these through Steve through the appropriate endpoint - /v1/management.cattle.io.clusters. Generally speaking, there is management type cluster for each provisioning type cluster (at least, in the current iteration). I would recommend reviewing the management type cluster to see if that has the values that you are looking for (my quick look says that it should).

Because of this, you have the following options:

  • You can change the UI code from using the provisioning.cattle.io.clusters endpoint to using the management.cattle.io.clusters endpoint, where appropriate. You may need to consult with the provisioning team to see when you should use each type.
  • You can request that the provisioning team evaluate syncing the respective values from the management.cattle.io clusters to the provisioning.cattle.io clusters.

I would recommend starting with the first option.

@eva-vashkevich can you evaluate the above options and see if they provide an adequate solution?

@MbolotSuse MbolotSuse added the status/awaiting-ui Indicates that UI updates are needed to complete the issue label Nov 30, 2023
@eva-vashkevich
Copy link
Member Author

@MbolotSuse I am looking into the options and will update the ticket soon. My understanding was that management.cattle.io is used by Norman and we are trying to move away from that, but I need to look into it further.

@eva-vashkevich
Copy link
Member Author

Hi
@MbolotSuse currently we are creating imported cluster using '/v1/provisioning.cattle.io.clusters' and not v3, so the approach of using management.cattle.io.clusters is inconsistent ( which is causing issue 9563)

@snasovich, in rancher/dashboard#9563 I believe you recommended to use provisioning cluster to edit Imported cluster. Is my understanding incorrect? Could you provide any input on what we should be using to edit and create imported cluster?

Thank you,
Evgeniya

@samjustus samjustus added team/hostbusters The team that is responsible for provisioning/managing downstream clusters + K8s version support and removed area/frameworks labels Dec 12, 2023
@samjustus
Copy link
Collaborator

@snasovich @Jono-SUSE-Rancher reassigning to Hostbusters

@eva-vashkevich
Copy link
Member Author

Hi @slickwarren do you have more information on what this issue is blocked on?
Thank you,
Evgeniya

@slickwarren
Copy link
Contributor

I think that was added by mistake when I first created the hostbusters board. I have little context on this issue but I don't think its blocked.

@gaktive
Copy link
Member

gaktive commented May 13, 2024

As I understand this, the current state is that UI is still blocked on this so I'll remove the awaiting-ui label so that it's clear where things are as the related SURE ticket has recent activity requesting status.

@snasovich snasovich removed the status/awaiting-ui Indicates that UI updates are needed to complete the issue label May 16, 2024
@snasovich snasovich self-assigned this May 16, 2024
@snasovich
Copy link
Collaborator

@gaktive, removed status/awaiting-ui as you're correct on that account - we're not awaiting UI here.

@eva-vashkevich ,

@snasovich, in rancher/dashboard#9563 I believe you recommended to use provisioning cluster to edit Imported cluster. Is my understanding incorrect? Could you provide any input on what we should be using to edit and create imported cluster?

Yes, the understanding at the time was that since cluster.provisioning.cattle.io object is primary (what is created when imported cluster object is initially created) it's that same object that should be modified going forward. However, I see that when actual K8s cluster is imported Rancher actually updates corresponding cluster.management.cattle.io object which holds a lot more fields many of which (like k3sConfig.kubernetesVersion) are needed for Edit Cluster page.
I'm also seeing some other bugs like if you create cluster.provisioning.cattle.io specifying spec.agentEnvVars on it which are then populated to spec.agentEnvVars of matching cluster.management.cattle.io - which is as expected. But then after appending additional env vars to spec.agentEnvVarson cluster.management.cattle.io object the API's initial response contains just-added values but retrieving object again via v1/management.cattle.io.clusters/(cluster-id) shows the original value - presumably the value gets overwritten as part of sync from cluster.provisioning.cattle.io to cluster.management.cattle.io.

TLDR - I would like to discuss it with the team to confirm what object should be manipulated for imported clusters and what issues should we address as clearly neither cluster.provisioning.cattle.io nor cluster.management.cattle.io currently supports all necessary fields or they don't actually work.

@eva-vashkevich
Copy link
Member Author

@snasovich Thank you for looking into this. One thing to note is that
on "management.cattle.io.cluster" update and remove are blocked under "links", so i don't think we can modify the cluster using "management.cattle.io.cluster"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import-k3s Imported K3s Clusters area/import-rke2 Imported RKE2 Clusters area/imported-cluster JIRA To be used in correspondence with the internal ticketing system. kind/bug Issues that are defects reported by users or that we know have reached a real release priority/1 status/ui-blocked team/hostbusters The team that is responsible for provisioning/managing downstream clusters + K8s version support
Projects
None yet
Development

No branches or pull requests

7 participants