rancher icon indicating copy to clipboard operation
rancher copied to clipboard

[BUG] Unable to provision RKE1 cluster with custom configuration for secret encryption

Open mantis-toboggan-md opened this issue 2 years ago • 3 comments

Rancher Server Setup

  • Rancher version: v2.9-ed8725676a615b0fb6851957f4295dad6593fb89-head
  • Installation option (Docker install/Helm Chart):
    • Helm install k3s v1.26.6+k3s1
  • Proxy/Cert Details: self-signed

Information about the Cluster

  • Kubernetes version: v1.27.8-rancher2-2
  • Cluster Type (Local/Downstream): Downstream RKE1 digital ocean

User Information Admin

Describe the bug RKE1 secrets encryption no longer accepts a custom configuration.

To Reproduce Create an RKE1 cluster in UI Use 'edit as yaml' option to add secrets encryption with a custom configurationa s documented here

Result The custom configuration resources are not saved.

Expected Result

Screenshots Request: Screen Shot 2024-01-30 at 11 25 40 AM

Response: Screen Shot 2024-01-30 at 11 26 09 AM

Additional context The same instructions worked on 2.7.0

mantis-toboggan-md avatar Jan 31 '24 16:01 mantis-toboggan-md

Hi @kinarashah can you take a look at this for our 2.9-Next scope?

Jono-SUSE-Rancher avatar Mar 05 '24 19:03 Jono-SUSE-Rancher

I think this is related to https://github.com/rancher/rancher/issues/44140, changes to encryption secret fields were merged in v2.7.1 so it makes sense that it works in v2.7.0.

kinarashah avatar Mar 05 '24 23:03 kinarashah

This is the intended behavior of the secrets migrator functionality, which rather than update the cluster.management.cattle.io/v3 object to reference secrets, it was decided to use norman to intercept the create/update request and stuff the sensitive information into secrets before it is committed to k8s, so the only place the data is exposed is within the api request to the v3 endpoint. The cluster object is "reassembled" before use within Rancher, pulling the secrets and creating the cluster object as it would have been, but a GET request for the cluster object will never return those sensitive values.

jakefhyde avatar Jun 21 '24 15:06 jakefhyde

@mantis-toboggan-md , could you please review the explanation in https://github.com/rancher/rancher/issues/44264#issuecomment-2182968247 and close the issue if this makes sense?

snasovich avatar Jul 01 '24 20:07 snasovich

Thanks for clarifying @jakefhyde - I'll close the issue then

mantis-toboggan-md avatar Jul 02 '24 14:07 mantis-toboggan-md